Skip to content
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

ICE: Default methods and &Self #8148

Closed
alexcrichton opened this issue Jul 31, 2013 · 2 comments
Closed

ICE: Default methods and &Self #8148

alexcrichton opened this issue Jul 31, 2013 · 2 comments
Labels
A-traits Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@alexcrichton
Copy link
Member

The following code gives an ICE:

trait Foo {
    fn foo(&Self) {}
}
fn main() {
}

with the message:

rust: task failed at 'index out of bounds: the len is 0 but the index is 0', /Users/alex/code/rust-opt/src/librustc/middle/liveness.rs:1598

ping @msullivan

@alexcrichton
Copy link
Member Author

I also then realized that this code doesn't parse:

trait Foo {
    fn foo(_: &Self) {}
}
fn main() {
}

@msullivan
Copy link
Contributor

Hm. This is the same bugs as #8468 and #8417. This was first, but I didn't notice it, so closing it as a dupe.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 13, 2022
Change `unnecessary_to_owned` `into_iter` suggestions to `MaybeIncorrect`

I am having a hard time finding a good solution for rust-lang#8148, so I am wondering if is enough to just change the suggestion's applicability to `MaybeIncorrect`?

I apologize, as I realize this is a bit of a cop out.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants