Skip to content

Commit 6cbcb83

Browse files
committed
{syntax -> rustc_ast_passes}::feature_gate
1 parent ed69fbb commit 6cbcb83

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

Cargo.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,9 +3378,11 @@ dependencies = [
33783378
name = "rustc_ast_passes"
33793379
version = "0.0.0"
33803380
dependencies = [
3381+
"log",
33813382
"rustc_data_structures",
33823383
"rustc_error_codes",
33833384
"rustc_errors",
3385+
"rustc_feature",
33843386
"rustc_parse",
33853387
"rustc_session",
33863388
"rustc_span",
@@ -3553,6 +3555,7 @@ name = "rustc_expand"
35533555
version = "0.0.0"
35543556
dependencies = [
35553557
"log",
3558+
"rustc_ast_passes",
35563559
"rustc_data_structures",
35573560
"rustc_errors",
35583561
"rustc_feature",

src/librustc_ast_passes/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ name = "rustc_ast_passes"
99
path = "lib.rs"
1010

1111
[dependencies]
12+
log = "0.4"
1213
rustc_data_structures = { path = "../librustc_data_structures" }
1314
rustc_errors = { path = "../librustc_errors", package = "rustc_errors" }
1415
rustc_error_codes = { path = "../librustc_error_codes" }
16+
rustc_feature = { path = "../librustc_feature" }
1517
rustc_parse = { path = "../librustc_parse" }
1618
rustc_session = { path = "../librustc_session" }
1719
rustc_span = { path = "../librustc_span" }

src/libsyntax/feature_gate/check.rs renamed to src/librustc_ast_passes/feature_gate.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
use crate::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId};
2-
use crate::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
3-
use crate::attr;
4-
use crate::sess::{feature_err, leveled_feature_err, GateStrength, ParseSess};
5-
use crate::visit::{self, FnKind, Visitor};
6-
71
use rustc_error_codes::*;
82
use rustc_errors::{struct_span_err, Handler};
93
use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
104
use rustc_feature::{Features, GateIssue, UnstableFeatures};
115
use rustc_span::source_map::Spanned;
126
use rustc_span::symbol::sym;
137
use rustc_span::Span;
8+
use syntax::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId};
9+
use syntax::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
10+
use syntax::attr;
11+
use syntax::sess::{feature_err, leveled_feature_err, GateStrength, ParseSess};
12+
use syntax::visit::{self, FnKind, Visitor};
1413

1514
use log::debug;
1615

src/librustc_ast_passes/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
#![feature(slice_patterns)]
66

77
pub mod ast_validation;
8+
pub mod feature_gate;

src/librustc_expand/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ doctest = false
1414
rustc_serialize = { path = "../libserialize", package = "serialize" }
1515
log = "0.4"
1616
rustc_span = { path = "../librustc_span" }
17+
rustc_ast_passes = { path = "../librustc_ast_passes" }
1718
rustc_data_structures = { path = "../librustc_data_structures" }
1819
rustc_errors = { path = "../librustc_errors" }
1920
rustc_feature = { path = "../librustc_feature" }

src/librustc_expand/expand.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use rustc_span::{FileName, Span, DUMMY_SP};
1818
use syntax::ast::{self, AttrItem, Block, Ident, LitKind, NodeId, PatKind, Path};
1919
use syntax::ast::{ItemKind, MacArgs, MacStmtStyle, StmtKind};
2020
use syntax::attr::{self, is_builtin_attr, HasAttrs};
21-
use syntax::feature_gate;
2221
use syntax::mut_visit::*;
2322
use syntax::print::pprust;
2423
use syntax::ptr::P;
@@ -1062,7 +1061,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
10621061
fn check_attributes(&mut self, attrs: &[ast::Attribute]) {
10631062
let features = self.cx.ecfg.features.unwrap();
10641063
for attr in attrs.iter() {
1065-
feature_gate::check_attribute(attr, self.cx.parse_sess, features);
1064+
rustc_ast_passes::feature_gate::check_attribute(attr, self.cx.parse_sess, features);
10661065
validate_attr::check_meta(self.cx.parse_sess, attr);
10671066

10681067
// macros are expanded before any lint passes so this warning has to be hardcoded

src/librustc_interface/passes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ fn configure_and_expand_inner<'a>(
399399

400400
// Needs to go *after* expansion to be able to check the results of macro expansion.
401401
sess.time("complete_gated_feature_checking", || {
402-
syntax::feature_gate::check_crate(
402+
rustc_ast_passes::feature_gate::check_crate(
403403
&krate,
404404
&sess.parse_sess,
405405
&sess.features_untracked(),

src/libsyntax/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ pub mod ast;
7575
pub mod attr;
7676
pub mod entry;
7777
pub mod expand;
78-
pub mod feature_gate {
79-
mod check;
80-
pub use check::{check_attribute, check_crate};
81-
}
8278
pub mod mut_visit;
8379
pub mod ptr;
8480
pub mod show_span;

0 commit comments

Comments
 (0)