rust/src/test/ui/lint/lints-in-foreign-macros.rs

31 lines
985 B
Rust
Raw Normal View History

// Copyright 2018 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.
// aux-build:lints-in-foreign-macros.rs
// compile-pass
#![warn(unused_imports)]
2018-08-22 15:26:39 -05:00
#![warn(missing_docs)]
#[macro_use]
extern crate lints_in_foreign_macros;
macro_rules! foo {
() => {use std::string::ToString;} //~ WARN: unused import
}
mod a { foo!(); }
mod b { bar!(); }
mod c { baz!(use std::string::ToString;); } //~ WARN: unused import
mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import
2018-08-22 15:26:39 -05:00
mod e { baz!(pub fn undocumented() {}); }//~ WARN: missing documentation for a function
fn main() {}