diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-05-04 11:18:33 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-05-04 11:18:33 -0700 |
| commit | b1951f450ae5ed34c3a14cda74036fe63a3abe91 (patch) | |
| tree | f72f2da795ccd6ebb66c1db25b42e149abb3ae02 | |
| parent | 10f66c71723bb7a674ddb698e7d188ec98e7a7a8 (diff) | |
| download | rust-b1951f450ae5ed34c3a14cda74036fe63a3abe91.tar.gz rust-b1951f450ae5ed34c3a14cda74036fe63a3abe91.zip | |
Make --edition imply the preview flag
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 9164694a1b7..4c6d0282c2a 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1848,6 +1848,12 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], let mut feature_checker = FeatureChecker::default(); + for &(.., f_edition, set) in ACTIVE_FEATURES.iter() { + if f_edition <= crate_edition { + set(&mut features, DUMMY_SP); + } + } + for attr in krate_attrs { if !attr.check_name("feature") { continue |
