diff options
Diffstat (limited to 'tests/ui/reachable')
-rw-r--r-- | tests/ui/reachable/expr_box.rs | 8 | ||||
-rw-r--r-- | tests/ui/reachable/expr_box.stderr | 17 | ||||
-rw-r--r-- | tests/ui/reachable/reachable-unnameable-type-alias.rs | 16 |
3 files changed, 16 insertions, 25 deletions
diff --git a/tests/ui/reachable/expr_box.rs b/tests/ui/reachable/expr_box.rs deleted file mode 100644 index 00328ea01..000000000 --- a/tests/ui/reachable/expr_box.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(box_syntax)] -#![allow(unused_variables)] -#![deny(unreachable_code)] - -fn main() { - let x = box return; //~ ERROR unreachable - println!("hi"); -} diff --git a/tests/ui/reachable/expr_box.stderr b/tests/ui/reachable/expr_box.stderr deleted file mode 100644 index ea6472cbe..000000000 --- a/tests/ui/reachable/expr_box.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: unreachable expression - --> $DIR/expr_box.rs:6:13 - | -LL | let x = box return; - | ^^^^------ - | | | - | | any code following this expression is unreachable - | unreachable expression - | -note: the lint level is defined here - --> $DIR/expr_box.rs:3:9 - | -LL | #![deny(unreachable_code)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/reachable/reachable-unnameable-type-alias.rs b/tests/ui/reachable/reachable-unnameable-type-alias.rs new file mode 100644 index 000000000..461355f87 --- /dev/null +++ b/tests/ui/reachable/reachable-unnameable-type-alias.rs @@ -0,0 +1,16 @@ +// run-pass + +#![feature(staged_api)] +#![stable(feature = "a", since = "b")] + +mod inner_private_module { + // UnnameableTypeAlias isn't marked as reachable, so no stability annotation is required here + pub type UnnameableTypeAlias = u8; +} + +#[stable(feature = "a", since = "b")] +pub fn f() -> inner_private_module::UnnameableTypeAlias { + 0 +} + +fn main() {} |