Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
In-line authored and compiler-errors committed Jul 4, 2022
1 parent 2557603 commit 3ff249a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![crate_type = "lib"]

extern crate core;

#[doc(hidden)]
pub mod __private {
pub use core::option::Option::{self, None, Some};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// aux-build:other_crate.rs

extern crate other_crate;

fn main() {
let x: Option<i32> = 1i32; //~ ERROR 6:26: 6:30: mismatched types [E0308]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0308]: mismatched types
--> $DIR/dont-suggest-doc-hidden-variant-for-enum.rs:6:26
|
LL | let x: Option<i32> = 1i32;
| ----------- ^^^^
| | |
| | expected enum `Option`, found `i32`
| | help: try using a variant of the expected enum: `Some(1i32)`
| expected due to this
|
= note: expected enum `Option<i32>`
found type `i32`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.

0 comments on commit 3ff249a

Please sign in to comment.