rust/tests/ui/lint/lint-qualification.rs

21 lines
390 B
Rust
Raw Normal View History

2014-10-27 17:37:07 -05:00
#![deny(unused_qualifications)]
2019-08-11 11:55:14 -05:00
#![allow(deprecated)]
mod foo {
pub fn bar() {}
}
fn main() {
use foo::bar;
foo::bar(); //~ ERROR: unnecessary qualification
bar();
2016-10-22 17:08:08 -05:00
let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345
2016-10-22 17:08:08 -05:00
macro_rules! m { () => {
$crate::foo::bar(); // issue #37357
::foo::bar(); // issue #38682
} }
m!();
}