Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::Static),
Allow(Target::ForeignFn),
Allow(Target::ForeignStatic),
Allow(Target::ForeignTy),
Allow(Target::ExternCrate),
]);

Expand Down
6 changes: 6 additions & 0 deletions tests/ui/lint/auxiliary/lint_stability.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![crate_name="lint_stability"]
#![crate_type = "lib"]
#![feature(extern_types)]
#![feature(staged_api)]
#![feature(associated_type_defaults)]
#![stable(feature = "lint_stability", since = "1.0.0")]
Expand Down Expand Up @@ -186,3 +187,8 @@ macro_rules! macro_test_arg {
macro_rules! macro_test_arg_nested {
($func:ident) => (macro_test_arg!($func()));
}

extern "C" {
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub type UnstableForeignType;
}
5 changes: 4 additions & 1 deletion tests/ui/lint/lint-stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![allow(deprecated)]
#![allow(dead_code)]
#![feature(staged_api)]

#![feature(extern_types)]
#![stable(feature = "rust1", since = "1.0.0")]

#[macro_use]
Expand All @@ -18,6 +18,9 @@ mod cross_crate {

use lint_stability::*;

fn test_foreign_type(_: &mut UnstableForeignType) { //~ ERROR use of unstable library feature
}

fn test() {
type Foo = MethodTester;
let foo = MethodTester;
Expand Down
Loading