Skip to content

Commit 70234f1

Browse files
committed
builtin_attrs.rs -> rustc_feature
1 parent d04b838 commit 70234f1

File tree

16 files changed

+31
-27
lines changed

16 files changed

+31
-27
lines changed

Cargo.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3575,6 +3575,7 @@ dependencies = [
35753575
"rustc_data_structures",
35763576
"rustc_error_codes",
35773577
"rustc_errors",
3578+
"rustc_feature",
35783579
"rustc_interface",
35793580
"rustc_lint",
35803581
"rustc_metadata",
@@ -3612,6 +3613,8 @@ dependencies = [
36123613
name = "rustc_feature"
36133614
version = "0.0.0"
36143615
dependencies = [
3616+
"lazy_static 1.3.0",
3617+
"rustc_data_structures",
36153618
"syntax_pos",
36163619
]
36173620

@@ -3855,6 +3858,7 @@ dependencies = [
38553858
"rustc_data_structures",
38563859
"rustc_error_codes",
38573860
"rustc_errors",
3861+
"rustc_feature",
38583862
"rustc_metadata",
38593863
"smallvec 1.0.0",
38603864
"syntax",

src/librustc_driver/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ rustc_target = { path = "../librustc_target" }
1919
rustc_lint = { path = "../librustc_lint" }
2020
rustc_data_structures = { path = "../librustc_data_structures" }
2121
errors = { path = "../librustc_errors", package = "rustc_errors" }
22+
rustc_feature = { path = "../librustc_feature" }
2223
rustc_metadata = { path = "../librustc_metadata" }
2324
rustc_mir = { path = "../librustc_mir" }
2425
rustc_parse = { path = "../librustc_parse" }

src/librustc_driver/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use errors::{PResult, registry::Registry};
4444
use rustc_interface::interface;
4545
use rustc_interface::util::get_codegen_sysroot;
4646
use rustc_data_structures::sync::SeqCst;
47+
use rustc_feature::find_gated_cfg;
4748

4849
use rustc_serialize::json::ToJson;
4950

@@ -62,7 +63,7 @@ use std::time::Instant;
6263

6364
use syntax::ast;
6465
use syntax::source_map::FileLoader;
65-
use syntax::feature_gate::{find_gated_cfg, UnstableFeatures};
66+
use syntax::feature_gate::UnstableFeatures;
6667
use syntax_pos::symbol::sym;
6768
use syntax_pos::FileName;
6869

src/librustc_feature/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ path = "lib.rs"
1010
doctest = false
1111

1212
[dependencies]
13+
rustc_data_structures = { path = "../librustc_data_structures" }
14+
lazy_static = "1.0.0"
1315
syntax_pos = { path = "../libsyntax_pos" }

src/libsyntax/feature_gate/builtin_attrs.rs renamed to src/librustc_feature/builtin_attrs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
use AttributeType::*;
44
use AttributeGate::*;
55

6+
use crate::{Features, Stability};
7+
68
use rustc_data_structures::fx::FxHashMap;
7-
use rustc_feature::{Features, Stability};
89
use syntax_pos::symbol::{Symbol, sym};
910
use lazy_static::lazy_static;
1011

src/librustc_feature/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
mod accepted;
1616
mod removed;
1717
mod active;
18+
mod builtin_attrs;
1819

1920
use std::fmt;
2021
use std::num::NonZeroU32;
@@ -67,3 +68,8 @@ pub enum Stability {
6768
pub use accepted::ACCEPTED_FEATURES;
6869
pub use active::{ACTIVE_FEATURES, Features, INCOMPLETE_FEATURES};
6970
pub use removed::{REMOVED_FEATURES, STABLE_REMOVED_FEATURES};
71+
pub use builtin_attrs::{
72+
AttributeGate, AttributeTemplate, AttributeType, find_gated_cfg, GatedCfg,
73+
BuiltinAttribute, BUILTIN_ATTRIBUTES, BUILTIN_ATTRIBUTE_MAP,
74+
deprecated_attributes, is_builtin_attr_name,
75+
};

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use lint::{LateContext, LintContext, LintArray};
3434
use lint::{LintPass, LateLintPass, EarlyLintPass, EarlyContext};
3535

3636
use rustc::util::nodemap::FxHashSet;
37+
use rustc_feature::{AttributeGate, AttributeTemplate, AttributeType, deprecated_attributes};
3738
use rustc_feature::Stability;
3839

3940
use syntax::tokenstream::{TokenTree, TokenStream};
@@ -42,8 +43,6 @@ use syntax::ptr::P;
4243
use syntax::attr::{self, HasAttrs};
4344
use syntax::source_map::Spanned;
4445
use syntax::edition::Edition;
45-
use syntax::feature_gate::{AttributeGate, AttributeTemplate, AttributeType};
46-
use syntax::feature_gate::deprecated_attributes;
4746
use syntax_pos::{BytePos, Span};
4847
use syntax::symbol::{Symbol, kw, sym};
4948
use syntax::errors::{Applicability, DiagnosticBuilder};

src/librustc_lint/unused.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use rustc::hir;
12
use rustc::hir::def::{Res, DefKind};
23
use rustc::hir::def_id::DefId;
34
use rustc::lint;
@@ -7,19 +8,17 @@ use rustc::ty::adjustment;
78
use rustc_data_structures::fx::FxHashMap;
89
use lint::{LateContext, EarlyContext, LintContext, LintArray};
910
use lint::{LintPass, EarlyLintPass, LateLintPass};
11+
use rustc_feature::{AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
1012

1113
use syntax::ast;
1214
use syntax::attr;
1315
use syntax::errors::{Applicability, pluralize};
14-
use syntax::feature_gate::{AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
1516
use syntax::print::pprust;
1617
use syntax::symbol::{kw, sym};
1718
use syntax::symbol::Symbol;
1819
use syntax::util::parser;
1920
use syntax_pos::{Span, BytePos};
2021

21-
use rustc::hir;
22-
2322
use log::debug;
2423

2524
declare_lint! {

src/librustc_parse/validate_attr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//! Meta-syntax validation logic of attributes for post-expansion.
22
33
use errors::{PResult, Applicability};
4-
use syntax::feature_gate::AttributeTemplate;
4+
use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP};
55
use syntax::ast::{self, Attribute, AttrKind, Ident, MetaItem, MetaItemKind};
66
use syntax::attr::mk_name_value_item_str;
77
use syntax::early_buffered_lints::BufferedEarlyLintId;
8-
use syntax::feature_gate::BUILTIN_ATTRIBUTE_MAP;
98
use syntax::token;
109
use syntax::tokenstream::TokenTree;
1110
use syntax::sess::ParseSess;

src/librustc_resolve/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ arena = { path = "../libarena" }
2020
errors = { path = "../librustc_errors", package = "rustc_errors" }
2121
syntax_pos = { path = "../libsyntax_pos" }
2222
rustc_data_structures = { path = "../librustc_data_structures" }
23+
rustc_feature = { path = "../librustc_feature" }
2324
rustc_metadata = { path = "../librustc_metadata" }
2425
rustc_error_codes = { path = "../librustc_error_codes" }
2526
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

0 commit comments

Comments
 (0)