Skip to content

ICE: fn in default method of trait #9123

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
klutzy opened this issue Sep 11, 2013 · 0 comments
Closed

ICE: fn in default method of trait #9123

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

Comments

@klutzy
Copy link
Contributor

klutzy commented Sep 11, 2013

#[crate_type = "lib"];

pub trait X {
    fn x() {
        fn f() { }
        f();
    }
}

Build error with RUST_LOG=rustc:

error: internal compiler error: encode_symbol: id not found 4
task <unnamed> failed at 'explicit failure', C:\home\stone\rust\src\libsyntax\diagnostic.rs:95
task <unnamed> failed at 'explicit failure', C:\home\stone\rust\src\librustc\rustc.rs:376

It only failed when I tried to build library. I tested it on win32, but I think it is not windows-specific.

I found it when I tried to wrap default method to escape from #8753.

flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 11, 2022
`explicit_auto_deref` changes

fixes rust-lang#9123
fixes rust-lang#9109
fixes rust-lang#9143
fixes rust-lang#9101

This avoid suggesting code which hits a rustc bug. Basically `&{x}` won't use auto-deref if the target type is `Sized`.

changelog: Don't suggest using auto deref for block expressions when the target type is `Sized`
changelog: Include the borrow in the suggestion for `explicit_auto_deref`
changelog: Don't lint `explicit_auto_deref` on `dyn Trait` return
changelog: Don't lint `explicit_auto_deref` when other adjustments are required
changelog: Lint `explicit_auto_deref` in implicit return positions for closures
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

Successfully merging a pull request may close this issue.

1 participant