diff options
Diffstat (limited to 'tests/ui/rmeta')
-rw-r--r-- | tests/ui/rmeta/auxiliary/rmeta-meta.rs | 4 | ||||
-rw-r--r-- | tests/ui/rmeta/no_optitimized_mir.rs | 11 | ||||
-rw-r--r-- | tests/ui/rmeta/no_optitimized_mir.stderr | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/rmeta/auxiliary/rmeta-meta.rs b/tests/ui/rmeta/auxiliary/rmeta-meta.rs index 6d8ed95bd..6d4350495 100644 --- a/tests/ui/rmeta/auxiliary/rmeta-meta.rs +++ b/tests/ui/rmeta/auxiliary/rmeta-meta.rs @@ -6,3 +6,7 @@ pub struct Foo { pub field: i32, } + +pub fn missing_optimized_mir() { + println!("indeed"); +} diff --git a/tests/ui/rmeta/no_optitimized_mir.rs b/tests/ui/rmeta/no_optitimized_mir.rs new file mode 100644 index 000000000..c503005f1 --- /dev/null +++ b/tests/ui/rmeta/no_optitimized_mir.rs @@ -0,0 +1,11 @@ +// aux-build:rmeta-meta.rs +// no-prefer-dynamic +// build-fail + +// Check that we do not ICE when we need optimized MIR but it is missing. + +extern crate rmeta_meta; + +fn main() { + rmeta_meta::missing_optimized_mir(); +} diff --git a/tests/ui/rmeta/no_optitimized_mir.stderr b/tests/ui/rmeta/no_optitimized_mir.stderr new file mode 100644 index 000000000..a17024c53 --- /dev/null +++ b/tests/ui/rmeta/no_optitimized_mir.stderr @@ -0,0 +1,10 @@ +error: missing optimized MIR for an item in the crate `rmeta_meta` + | +note: missing optimized MIR for this item (was the crate `rmeta_meta` compiled with `--emit=metadata`?) + --> $DIR/auxiliary/rmeta-meta.rs:10:1 + | +LL | pub fn missing_optimized_mir() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + |