{syntax -> rustc_ast_passes}::feature_gate
This commit is contained in:
parent
ed69fbbc44
commit
6cbcb83022
@ -3378,9 +3378,11 @@ dependencies = [
|
||||
name = "rustc_ast_passes"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rustc_data_structures",
|
||||
"rustc_error_codes",
|
||||
"rustc_errors",
|
||||
"rustc_feature",
|
||||
"rustc_parse",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
@ -3553,6 +3555,7 @@ name = "rustc_expand"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rustc_ast_passes",
|
||||
"rustc_data_structures",
|
||||
"rustc_errors",
|
||||
"rustc_feature",
|
||||
|
@ -9,9 +9,11 @@ name = "rustc_ast_passes"
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4"
|
||||
rustc_data_structures = { path = "../librustc_data_structures" }
|
||||
rustc_errors = { path = "../librustc_errors", package = "rustc_errors" }
|
||||
rustc_error_codes = { path = "../librustc_error_codes" }
|
||||
rustc_feature = { path = "../librustc_feature" }
|
||||
rustc_parse = { path = "../librustc_parse" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
|
@ -1,9 +1,3 @@
|
||||
use crate::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId};
|
||||
use crate::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
|
||||
use crate::attr;
|
||||
use crate::sess::{feature_err, leveled_feature_err, GateStrength, ParseSess};
|
||||
use crate::visit::{self, FnKind, Visitor};
|
||||
|
||||
use rustc_error_codes::*;
|
||||
use rustc_errors::{struct_span_err, Handler};
|
||||
use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
|
||||
@ -11,6 +5,11 @@ use rustc_feature::{Features, GateIssue, UnstableFeatures};
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::Span;
|
||||
use syntax::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId};
|
||||
use syntax::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
|
||||
use syntax::attr;
|
||||
use syntax::sess::{feature_err, leveled_feature_err, GateStrength, ParseSess};
|
||||
use syntax::visit::{self, FnKind, Visitor};
|
||||
|
||||
use log::debug;
|
||||
|
@ -5,3 +5,4 @@
|
||||
#![feature(slice_patterns)]
|
||||
|
||||
pub mod ast_validation;
|
||||
pub mod feature_gate;
|
||||
|
@ -14,6 +14,7 @@ doctest = false
|
||||
rustc_serialize = { path = "../libserialize", package = "serialize" }
|
||||
log = "0.4"
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
rustc_ast_passes = { path = "../librustc_ast_passes" }
|
||||
rustc_data_structures = { path = "../librustc_data_structures" }
|
||||
rustc_errors = { path = "../librustc_errors" }
|
||||
rustc_feature = { path = "../librustc_feature" }
|
||||
|
@ -18,7 +18,6 @@ use rustc_span::{FileName, Span, DUMMY_SP};
|
||||
use syntax::ast::{self, AttrItem, Block, Ident, LitKind, NodeId, PatKind, Path};
|
||||
use syntax::ast::{ItemKind, MacArgs, MacStmtStyle, StmtKind};
|
||||
use syntax::attr::{self, is_builtin_attr, HasAttrs};
|
||||
use syntax::feature_gate;
|
||||
use syntax::mut_visit::*;
|
||||
use syntax::print::pprust;
|
||||
use syntax::ptr::P;
|
||||
@ -1062,7 +1061,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
|
||||
fn check_attributes(&mut self, attrs: &[ast::Attribute]) {
|
||||
let features = self.cx.ecfg.features.unwrap();
|
||||
for attr in attrs.iter() {
|
||||
feature_gate::check_attribute(attr, self.cx.parse_sess, features);
|
||||
rustc_ast_passes::feature_gate::check_attribute(attr, self.cx.parse_sess, features);
|
||||
validate_attr::check_meta(self.cx.parse_sess, attr);
|
||||
|
||||
// macros are expanded before any lint passes so this warning has to be hardcoded
|
||||
|
@ -399,7 +399,7 @@ fn configure_and_expand_inner<'a>(
|
||||
|
||||
// Needs to go *after* expansion to be able to check the results of macro expansion.
|
||||
sess.time("complete_gated_feature_checking", || {
|
||||
syntax::feature_gate::check_crate(
|
||||
rustc_ast_passes::feature_gate::check_crate(
|
||||
&krate,
|
||||
&sess.parse_sess,
|
||||
&sess.features_untracked(),
|
||||
|
@ -75,10 +75,6 @@ pub mod ast;
|
||||
pub mod attr;
|
||||
pub mod entry;
|
||||
pub mod expand;
|
||||
pub mod feature_gate {
|
||||
mod check;
|
||||
pub use check::{check_attribute, check_crate};
|
||||
}
|
||||
pub mod mut_visit;
|
||||
pub mod ptr;
|
||||
pub mod show_span;
|
||||
|
Loading…
x
Reference in New Issue
Block a user