Auto merge of #28364 - petrochenkov:usegate, r=alexcrichton

Closes https://github.com/rust-lang/rust/issues/28075
Closes https://github.com/rust-lang/rust/issues/28388

r? @eddyb 
cc @brson
This commit is contained in:
bors 2015-09-22 01:12:26 +00:00
commit e9d2587766
18 changed files with 209 additions and 58 deletions

View file

@ -0,0 +1,25 @@
// Copyright 2015 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.
// Unstable entities should be caught in import lists
// aux-build:lint_stability.rs
#![allow(unused_imports)]
extern crate lint_stability;
use lint_stability::{unstable, deprecated}; //~ ERROR use of unstable library feature 'test_feature'
//~^ WARNING use of deprecated item
use lint_stability::unstable::{self as u}; //~ ERROR use of unstable library feature 'test_feature'
fn main() {
}

View file

@ -0,0 +1,15 @@
// Copyright 2015 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.
// Prefix in imports with empty braces should be resolved and checked privacy, stability, etc.
use foo::{}; //~ ERROR failed to resolve. foo
fn main() {}

View file

@ -0,0 +1,19 @@
// Copyright 2015 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.
// Prefix in imports with empty braces should be resolved and checked privacy, stability, etc.
mod m {
mod n {}
}
use m::n::{}; //~ ERROR module `n` is private
fn main() {}

View file

@ -0,0 +1,20 @@
// Copyright 2015 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.
// Prefix in imports with empty braces should be resolved and checked privacy, stability, etc.
// aux-build:lint_stability.rs
extern crate lint_stability;
use lint_stability::UnstableStruct::{}; //~ ERROR use of unstable library feature 'test_feature'
use lint_stability::StableStruct::{}; // OK
fn main() {}

View file

@ -14,7 +14,8 @@
#![feature(foo)] //~ ERROR unused or unknown feature
extern crate lint_output_format; //~ ERROR use of unstable library feature
use lint_output_format::{foo, bar};
use lint_output_format::{foo, bar}; //~ ERROR use of unstable library feature
//~^ WARNING use of deprecated item,
fn main() {
let _x = foo(); //~ WARNING #[warn(deprecated)] on by default