Closed
Description
Code
fn dothing() -> i32 {
match 5 {
x => dbg!(x),
}
todo!()
}
Current output
Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
--> src/lib.rs:3:14
|
3 | x => dbg!(x),
| ^^^^^^^ expected `()`, found integer
|
= note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to return this value
|
3 | x => return dbg!(x);,
| ++++++ +
For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` (lib) due to 1 previous error
Desired output
Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
--> src/lib.rs:3:14
|
3 | x => dbg!(x),
| ^^^^^^^ expected `()`, found integer
|
= note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to return this value
|
3 | x => return dbg!(x),
| ++++++
For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` (lib) due to 1 previous error
Rationale and extra context
when using #![feature(rustc_private)]
i even got this suggestion recommending i return DefKind from the GlobalCtxt::enter closure, which isn't even remotely the right type. it also seems to only show up when using macros? all around quite strange.
Other cases
No response
Rust Version
rustc 1.81.0-nightly (a70b2ae57 2024-06-09)
binary: rustc
commit-hash: a70b2ae57713ed0e7411c059d582ab382fc4166a
commit-date: 2024-06-09
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
Anything else?
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment