Skip to content

Commit 2592b41

Browse files
committed
Add test to confirm usage of unstable foreign type error
Signed-off-by: Emmanuel Ugwu <emmanuelugwu121@gmail.com>
1 parent b973eb9 commit 2592b41

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

tests/ui/lint/auxiliary/lint_stability.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![crate_name="lint_stability"]
22
#![crate_type = "lib"]
3+
#![feature(extern_types)]
34
#![feature(staged_api)]
45
#![feature(associated_type_defaults)]
56
#![stable(feature = "lint_stability", since = "1.0.0")]
@@ -186,3 +187,8 @@ macro_rules! macro_test_arg {
186187
macro_rules! macro_test_arg_nested {
187188
($func:ident) => (macro_test_arg!($func()));
188189
}
190+
191+
extern "C" {
192+
#[unstable(feature = "unstable_test_feature", issue = "none")]
193+
pub type UnstableForeignType;
194+
}

tests/ui/lint/lint-stability.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
#![feature(extern_types)]
1010
#![stable(feature = "rust1", since = "1.0.0")]
1111

12-
extern "C" {
13-
#[unstable(feature = "fn_static", issue = "none")]
14-
type Ty;
15-
}
1612
#[macro_use]
1713
extern crate lint_stability;
1814

@@ -22,6 +18,9 @@ mod cross_crate {
2218

2319
use lint_stability::*;
2420

21+
fn test_foreign_type(_: &mut UnstableForeignType) { //~ ERROR use of unstable library feature
22+
}
23+
2524
fn test() {
2625
type Foo = MethodTester;
2726
let foo = MethodTester;

0 commit comments

Comments
 (0)