Description
The following example uses the incomplete dyn_star
feature, which should trigger a warning, but the warning does not show:
#![feature(allow_internal_unstable)]
#![feature(decl_macro, staged_api, example)]
#![allow(internal_features)]
#![unstable(feature = "example", issue = "none")]
#[allow_internal_unstable(dyn_star)]
macro generate {
($name:ident) => {
fn $name() {
use std::fmt::Debug;
let _x: dyn* Debug;
}
}
}
generate!(example);
fn main() {
example();
}
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 the allow_internal_unstable
(and rustc_allow_const_fn_unstable
).
Or, alternatively, maybe allow_internal_unstable
should 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.