Correctly walk import lists in AST visitors

This commit is contained in:
Vadim Petrochenkov 2015-09-12 16:10:12 +03:00
parent d3fc6e1858
commit 50e42ea9f7
15 changed files with 122 additions and 50 deletions

View file

@ -0,0 +1,22 @@
// 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
#![allow(unused_imports)]
use std::thread::{catch_panic, sleep}; //~ ERROR use of unstable library feature 'catch_panic'
//~^ ERROR use of unstable library feature 'thread_sleep'
use std::rt::{self}; //~ ERROR use of unstable library feature 'rt'
use std::rt::{};
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