Add failing test
This commit is contained in:
parent
c32dcbba18
commit
6d1100fa79
6 changed files with 69 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
#![crate_type = "lib"]
|
||||
|
||||
extern crate core;
|
||||
|
||||
pub mod __private {
|
||||
#[doc(hidden)]
|
||||
pub use core::option::Option::{self, None, Some};
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#![crate_type = "lib"]
|
||||
|
||||
extern crate core;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod __private {
|
||||
pub use core::option::Option::{self, None, Some};
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
// aux-build:hidden-child.rs
|
||||
|
||||
// FIXME(compiler-errors): This currently suggests the wrong thing.
|
||||
// UI test exists to track the problem.
|
||||
|
||||
extern crate hidden_child;
|
||||
|
||||
fn main() {
|
||||
let x: Option<i32> = 1i32; //~ ERROR mismatched types
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/hidden-child.rs:9:26
|
||||
|
|
||||
LL | let x: Option<i32> = 1i32;
|
||||
| ----------- ^^^^ expected enum `Option`, found `i32`
|
||||
| |
|
||||
| expected due to this
|
||||
|
|
||||
= note: expected enum `Option<i32>`
|
||||
found type `i32`
|
||||
help: try wrapping the expression in `hidden_child::__private::Some`
|
||||
|
|
||||
LL | let x: Option<i32> = hidden_child::__private::Some(1i32);
|
||||
| ++++++++++++++++++++++++++++++ +
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -0,0 +1,7 @@
|
|||
// aux-build:hidden-parent.rs
|
||||
|
||||
extern crate hidden_parent;
|
||||
|
||||
fn main() {
|
||||
let x: Option<i32> = 1i32; //~ ERROR mismatched types
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/hidden-parent.rs:6:26
|
||||
|
|
||||
LL | let x: Option<i32> = 1i32;
|
||||
| ----------- ^^^^ expected enum `Option`, found `i32`
|
||||
| |
|
||||
| expected due to this
|
||||
|
|
||||
= note: expected enum `Option<i32>`
|
||||
found type `i32`
|
||||
help: try wrapping the expression in `hidden_parent::__private::Some`
|
||||
|
|
||||
LL | let x: Option<i32> = hidden_parent::__private::Some(1i32);
|
||||
| +++++++++++++++++++++++++++++++ +
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
Add table
Reference in a new issue