X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_feature%2Flib.rs;h=01546f78257746cbaaeb8f4eb443ca266d116880;hb=e22ae2c096ed2b58ab0d6c029b8ae985a1749e1c;hp=c38bb3740af3a6e664dc686243b4e745c469d945;hpb=234c9f21d9930e4ae804d00b191d0780959cfcbe;p=rust.git diff --git a/src/librustc_feature/lib.rs b/src/librustc_feature/lib.rs index c38bb3740af..01546f78257 100644 --- a/src/librustc_feature/lib.rs +++ b/src/librustc_feature/lib.rs @@ -1,7 +1,8 @@ //! # Feature gates //! //! This crate declares the set of past and present unstable features in the compiler. -//! Feature gate checking itself is done in `libsyntax/feature_gate/check.rs` at the moment. +//! Feature gate checking itself is done in `librustc_ast_passes/feature_gate.rs` +//! at the moment. //! //! Features are enabled in programs via the crate-level attributes of //! `#![feature(...)]` with a comma-separated list of features. @@ -11,13 +12,13 @@ //! symbol to the `accepted` or `removed` modules respectively. mod accepted; -mod removed; mod active; mod builtin_attrs; +mod removed; +use rustc_span::{edition::Edition, symbol::Symbol, Span}; use std::fmt; use std::num::NonZeroU32; -use syntax_pos::{Span, edition::Edition, symbol::Symbol}; #[derive(Clone, Copy)] pub enum State { @@ -43,7 +44,7 @@ pub struct Feature { pub state: State, pub name: Symbol, pub since: &'static str, - issue: Option, // FIXME: once #58732 is done make this an Option + issue: Option, // FIXME: once #58732 is done make this an Option pub edition: Option, description: &'static str, } @@ -72,7 +73,7 @@ pub enum UnstableFeatures { /// during the build that feature-related lints are set to warn or above /// because the build turns on warnings-as-errors and uses lots of unstable /// features. As a result, this is always required for building Rust itself. - Cheat + Cheat, } impl UnstableFeatures { @@ -84,7 +85,7 @@ pub fn from_environment() -> UnstableFeatures { match (disable_unstable_features, bootstrap) { (_, true) => UnstableFeatures::Cheat, (true, _) => UnstableFeatures::Disallow, - (false, _) => UnstableFeatures::Allow + (false, _) => UnstableFeatures::Allow, } } @@ -117,7 +118,7 @@ fn find_lang_feature_issue(feature: Symbol) -> Option { pub enum GateIssue { Language, - Library(Option) + Library(Option), } pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option { @@ -128,10 +129,9 @@ pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option