-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
allow_internal_unstable can be used to bypass incomplete_features warning #128175
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-allow_internal_unstable`#![feature(allow_internal_unstable)]``#![feature(allow_internal_unstable)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-allow_internal_unstable`#![feature(allow_internal_unstable)]``#![feature(allow_internal_unstable)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following example uses the incomplete
dyn_starfeature, which should trigger a warning, but the warning does not show:This is a problem since we want to use the lint to enforce that e.g. std does not depend on incomplete features, and this issue could lead to us accidentally depending on incomplete features anyway!
We probably have to make the incomplete_features lint scan not just the module-level
#![feature]declarations, but also theallow_internal_unstable(andrustc_allow_const_fn_unstable).Or, alternatively, maybe
allow_internal_unstableshould only allow features that are enabled in the crate where the macro is declared? It seems a bit odd to say "ah yes this macro can internally use feature X anywhere it is expanded" when feature X is not even available in the current crate.