use errors::{DiagnosticBuilder, Handler, FatalError};
use visit::{self, FnKind, Visitor};
use parse::ParseSess;
- use symbol::Symbol;
+ use symbol::{keywords, Symbol};
use std::env;
(active, doc_cfg, "1.21.0", Some(43781)),
// #[doc(masked)]
(active, doc_masked, "1.21.0", Some(44027)),
+ // #[doc(spotlight)]
+ (active, doc_spotlight, "1.22.0", Some(45040)),
// allow `#[must_use]` on functions and comparison operators (RFC 1940)
(active, fn_must_use, "1.21.0", Some(43302)),
// #![wasm_import_memory] attribute
(active, wasm_import_memory, "1.22.0", None),
+
+ // `crate` in paths
+ (active, crate_in_paths, "1.23.0", Some(45477)),
);
declare_features! (
gate_feature_post!(&self, doc_masked, attr.span,
"#[doc(masked)] is experimental"
);
+ } else if content.iter().any(|c| c.check_name("spotlight")) {
+ gate_feature_post!(&self, doc_spotlight, attr.span,
+ "#[doc(spotlight)] is experimental"
+ );
}
}
}
visit::walk_impl_item(self, ii);
}
+ fn visit_path(&mut self, path: &'a ast::Path, _id: NodeId) {
+ for segment in &path.segments {
+ if segment.identifier.name == keywords::Crate.name() {
+ gate_feature_post!(&self, crate_in_paths, segment.span,
+ "`crate` in paths is experimental");
+ }
+ }
+
+ visit::walk_path(self, path);
+ }
+
fn visit_vis(&mut self, vis: &'a ast::Visibility) {
if let ast::Visibility::Crate(span, ast::CrateSugar::JustCrate) = *vis {
gate_feature_post!(&self, crate_visibility_modifier, span,