06c9e0f5f8
To accomplish this, we alter the checks in `rustc::middle::stability` to use the `StabilityLevel` defined in `syntax::attr` (which includes the version in which the feature was stabilized) rather than the local `StabilityLevel` in the same module, and make the `declared_stable_lang_features` field of `syntax::feature_gate::Features` hold a Vec of feature-name, span tuples (in analogy to the `declared_lib_features` field) rather than just spans. This is in the matter of issue #33394.
21 lines
794 B
Rust
21 lines
794 B
Rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
// file at the top-level directory of this distribution and at
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
|
|
// Testing that the stable_features lint catches use of stable
|
|
// language and lib features.
|
|
|
|
#![deny(stable_features)]
|
|
#![feature(test_accepted_feature)] //~ ERROR this feature has been stable since 1.0.0
|
|
#![feature(rust1)] //~ ERROR this feature has been stable since 1.0.0
|
|
|
|
fn main() {
|
|
let _foo: Vec<()> = Vec::new();
|
|
}
|