Skip to content

internal compiler error: drop_ty_immediate: non-box ty #9446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dcrewi opened this issue Sep 24, 2013 · 0 comments
Closed

internal compiler error: drop_ty_immediate: non-box ty #9446

dcrewi opened this issue Sep 24, 2013 · 0 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@dcrewi
Copy link
Contributor

dcrewi commented Sep 24, 2013

Minimal test case:

struct Wrapper(~str);

impl Wrapper {
    pub fn new() -> Wrapper {
        Wrapper(~"Bob")
    }

    pub fn say_hi(&self) {
        println(fmt!("hello %s", **self));
    }
}

impl Drop for Wrapper {
    fn drop(&mut self) {}
}

fn main() {
    {
        // This runs without complaint.
        let x = Wrapper::new();
        x.say_hi();
    }
    {
        // This fails to compile.
        // error: internal compiler error: drop_ty_immediate: non-box ty
        Wrapper::new().say_hi();
    }
}

I originally ran accross this when wrapping a *T, but it also fails when I try to wrap int and other numeric types, bool, Option<T>, ~T, and other structs that also wrap a single value of those types.

dcrewi added a commit to dcrewi/rust that referenced this issue Sep 28, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 9, 2022
Fix `range_{plus,minus}_one` bad suggestions

Fixes rust-lang#9431.

The current `range_plus_one` and `range_minus_one` suggestions are completely incorrect when macros are involved.

This commit resolves this by disabling the lints for any range expression that is expanded from a macro. The reasons for this are that it is very difficult to create a correct suggestion in this case and that false negatives are less important for pedantic lints.

changelog: Fix `range_{plus,minus}_one` bad suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

1 participant