Given the following code: https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=b9b341939839ec733bf081c5ddf86e5b
enum OhNo<T, U> {
A(T),
B(U),
C,
}
fn uwu() {
OhNo::C::<u32, _>;
}
The current output is:
Compiling playground v0.0.1 (/playground)
error[E0282]: type annotations needed
--> src/lib.rs:8:5
|
8 | OhNo::C::<u32, _>;
| ^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `U` declared on the enum `OhNo`
|
help: consider specifying the generic arguments
|
8 | OhNo::<u32, _>::C::<u32, _>;
| ++++++++++
For more information about this error, try `rustc --explain E0282`.
error: could not compile `playground` due to previous error
But applying this causes an error, saying that C doesn't allow type arguments.
This happens on nightly and beta, but not on stable. I'm assuming the "consider specifying the generic arguments" was added recently.
I don't think we need the help here, because the generic arguments are already specified.
@rustbot label +D-invalid-suggestion
Given the following code: https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=b9b341939839ec733bf081c5ddf86e5b
The current output is:
But applying this causes an error, saying that
Cdoesn't allow type arguments.This happens on nightly and beta, but not on stable. I'm assuming the "consider specifying the generic arguments" was added recently.
I don't think we need the help here, because the generic arguments are already specified.
@rustbot label +D-invalid-suggestion