Skip to content

Commit e8f90b1

Browse files
Don't show foreign types as an allowed target if the feature is not enabled
1 parent 1ae7c49 commit e8f90b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,9 @@ pub(crate) fn allowed_targets_applied(
10601060
if !features.stmt_expr_attributes() {
10611061
allowed_targets.retain(|t| !matches!(t, Target::Expression | Target::Statement));
10621062
}
1063+
if !features.extern_types() {
1064+
allowed_targets.retain(|t| !matches!(t, Target::ForeignTy));
1065+
}
10631066
}
10641067

10651068
// We define groups of "similar" targets.

0 commit comments

Comments
 (0)