-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix pretty HIR for anon consts in diagnostics #123926
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
enum Struct<const N: usize> { Variant { x: [(); N] } } | ||
|
||
fn test() { | ||
let x = Struct::<0>::Variant; | ||
//~^ ERROR expected value, found struct variant `Struct<0>::Variant` | ||
} | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0533]: expected value, found struct variant `Struct<0>::Variant` | ||
--> $DIR/error-variant-with-turbofishes.rs:4:13 | ||
| | ||
LL | let x = Struct::<0>::Variant; | ||
| ^^^^^^^^^^^^^^^^^^^^ not a value | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0533`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,9 @@ LL - let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | |
LL + let str::as_bytes; | ||
| | ||
|
||
error[E0533]: expected unit struct, unit variant or constant, found associated function `str<, T>::as_bytes` | ||
error[E0533]: expected unit struct, unit variant or constant, found associated function `str<{ | ||
fn str() { let (/*ERROR*/); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interestingly this seems to be the first time we leak There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For follow-up: Would it make sense to only print function signatures in fn main() {
let str::<{fn str<T>() { let _; }}, T>::as_bytes;
} |
||
}, T>::as_bytes` | ||
--> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:9 | ||
| | ||
LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used to print
Struct<>::Variant