2024-03-04 00:25:51 -06:00
|
|
|
//@ check-pass
|
|
|
|
|
2024-04-11 13:10:34 -05:00
|
|
|
#![warn(redundant_imports)]
|
2024-03-04 00:25:51 -06:00
|
|
|
|
|
|
|
mod foo {
|
|
|
|
use std::fmt;
|
|
|
|
|
|
|
|
pub struct String;
|
|
|
|
|
|
|
|
impl String {
|
|
|
|
pub fn new() -> String {
|
|
|
|
String{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Display for String {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
write!(f, "String")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
{
|
2024-04-11 13:10:34 -05:00
|
|
|
use std::string::String; //~ WARNING the item `String` is imported redundantly
|
2024-03-04 00:25:51 -06:00
|
|
|
// 'String' from 'std::string::String'.
|
|
|
|
let s = String::new();
|
|
|
|
println!("{}", s);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
// 'String' from 'std::string::String'.
|
|
|
|
let s = String::new();
|
|
|
|
println!("{}", s);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
use foo::*;
|
|
|
|
// 'String' from 'foo::String'.
|
|
|
|
let s = String::new();
|
|
|
|
println!("{}", s);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|