-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 calling method on auto
trait
#105732
Labels
C-bug
Category: This is a bug.
F-auto_traits
`#![feature(auto_traits)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jruderman
added
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Dec 15, 2022
@rustbot claim |
Fixed the ICE, the error message now is: cat@LAPTOP-V6U0QKD4:~/code/rust$ j dev src/test/ui/methods/issues/issue-105732.rs
rustc +dev src/test/ui/methods/issues/issue-105732.rs
error[E0380]: auto traits cannot have associated items
--> src/test/ui/methods/issues/issue-105732.rs:4:8
|
3 | auto trait Foo {
| --- auto trait cannot have associated items
4 | fn g(&self); //~ ERROR auto traits cannot have associated items
| ---^-------- help: remove these associated items
error[E0599]: the method `g` exists for reference `&Self`, but its trait bounds were not satisfied
--> src/test/ui/methods/issues/issue-105732.rs:9:14
|
9 | self.g();
| ^
|
= note: the following trait bounds were not satisfied:
`Self: Foo`
which is required by `&Self: Foo`
`&Self: Foo`
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `g`, perhaps you need to add a supertrait for it:
|
7 | trait Bar: Foo {
| +++++
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0380, E0599.
For more information about an error, try `rustc --explain E0380`. I think the second error message should not come out, considering the |
This was referenced Dec 15, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 16, 2022
…trait, r=compiler-errors Fix ICE calling method on auto trait Fixes rust-lang#105732 r? `@compiler-errors`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 3, 2023
…ror, r=compiler-errors Refactoring report_method_error While working on rust-lang#105732, I found it's hard to follow this long function, so I tried to make it shorter. It's not easy for code reviewing, since so many lines of code changes, but only the positions are changed. Generally, I extract two sub-methods from `report_method_error`: https://github.com/rust-lang/rust/blob/397b66e77b279de5006facf87979f9ecff5c7f87/compiler/rustc_hir_typeck/src/method/suggest.rs#L117 to `note_candidates_on_method_error` And this long block: https://github.com/rust-lang/rust/blob/397b66e77b279de5006facf87979f9ecff5c7f87/compiler/rustc_hir_typeck/src/method/suggest.rs#L263 to `report_no_match_method_error`. r? `@compiler-errors`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
F-auto_traits
`#![feature(auto_traits)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Found with a modified fuzz-rustc
Code
Error output
error[E0380]: auto traits cannot have associated items
thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_hir_typeck/src/method/suggest.rs:691
Full output including backtrace
Regression
Regression in nightly-2022-11-05, somewhere in rollup 0950848, likely #103937 (CC @BoxyUwU)
Version
2022-12-14 fbf8b93
@rustbot label +F-auto_traits
The text was updated successfully, but these errors were encountered: