Rollup merge of #87158 - In-line:suggest-full-enum-variant-for-local-module, r=estebank
Suggest full enum variant for local modules
This commit is contained in:
commit
effea681c0
3 changed files with 29 additions and 1 deletions
|
|
@ -0,0 +1,10 @@
|
|||
mod option {
|
||||
pub enum O<T> {
|
||||
Some(T),
|
||||
None,
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _: option::O<()> = (); //~ ERROR 9:28: 9:30: mismatched types [E0308]
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/suggest-full-enum-variant-for-local-module.rs:9:28
|
||||
|
|
||||
LL | let _: option::O<()> = ();
|
||||
| ------------- ^^
|
||||
| | |
|
||||
| | expected enum `O`, found `()`
|
||||
| | help: try using a variant of the expected enum: `option::O::Some(())`
|
||||
| expected due to this
|
||||
|
|
||||
= note: expected enum `O<()>`
|
||||
found unit type `()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue