("one of these", "items", String::new())
};
- let tail = if path.len() > 1 { "..." } else { "" };
let instead = if let Instead::Yes = instead { " instead" } else { "" };
let mut msg = if let IsPattern::Yes = is_pattern {
format!(
- "if you meant to match on {}{}{}, use the full path in the pattern{}",
- kind, instead, name, tail
+ "if you meant to match on {}{}{}, use the full path in the pattern",
+ kind, instead, name
)
} else {
- format!("consider importing {} {}{}{}", determiner, kind, instead, tail)
+ format!("consider importing {} {}{}", determiner, kind, instead)
};
for note in accessible_path_strings.iter().flat_map(|cand| cand.3.as_ref()) {
if let [first, .., last] = &path[..] {
err.span_suggestion_verbose(
first.ident.span.until(last.ident.span),
- "...and refer to it directly",
+ &format!("if you import `{}`, refer to it directly", last.ident),
String::new(),
Applicability::Unspecified,
);
LL | a::bar();
| ^^^ not found in `a`
|
-help: consider importing this function...
+help: consider importing this function
|
LL | use b::bar;
|
-help: ...and refer to it directly
+help: if you import `bar`, refer to it directly
|
LL - a::bar();
LL + bar();
|
LL | check(m1::TS);
| ~~
-help: consider importing one of these items instead...
+help: consider importing one of these items instead
|
LL | use m2::S;
|
LL | use xm2::S;
|
-help: ...and refer to it directly
+help: if you import `S`, refer to it directly
|
LL - check(m1::S);
LL + check(S);
|
LL | check(xm1::TS);
| ~~
-help: consider importing one of these items instead...
+help: consider importing one of these items instead
|
LL | use m2::S;
|
LL | use xm2::S;
|
-help: ...and refer to it directly
+help: if you import `S`, refer to it directly
|
LL - check(xm1::S);
LL + check(S);
|
LL | check(m7::TV);
| ~~
-help: consider importing one of these items instead...
+help: consider importing one of these items instead
|
LL | use m8::V;
|
LL | use xm8::V;
|
-help: ...and refer to it directly
+help: if you import `V`, refer to it directly
|
LL - check(m7::V);
LL + check(V);
|
LL | check(xm7::TV);
| ~~
-help: consider importing one of these items instead...
+help: consider importing one of these items instead
|
LL | use m8::V;
|
LL | use xm8::V;
|
-help: ...and refer to it directly
+help: if you import `V`, refer to it directly
|
LL - check(xm7::V);
LL + check(V);
LL | println!("{}", circular_modules_main::hi_str());
| ^^^^^^ not found in `circular_modules_main`
|
-help: consider importing this function...
+help: consider importing this function
|
LL | use hi_str;
|
-help: ...and refer to it directly
+help: if you import `hi_str`, refer to it directly
|
LL - println!("{}", circular_modules_main::hi_str());
LL + println!("{}", hi_str());
LL | let _ = namespaced_enums::A;
| ^ not found in `namespaced_enums`
|
-help: consider importing this unit variant...
+help: consider importing this unit variant
|
LL | use namespaced_enums::Foo::A;
|
-help: ...and refer to it directly
+help: if you import `A`, refer to it directly
|
LL - let _ = namespaced_enums::A;
LL + let _ = A;
LL | let _ = namespaced_enums::B(10);
| ^ not found in `namespaced_enums`
|
-help: consider importing this tuple variant...
+help: consider importing this tuple variant
|
LL | use namespaced_enums::Foo::B;
|
-help: ...and refer to it directly
+help: if you import `B`, refer to it directly
|
LL - let _ = namespaced_enums::B(10);
LL + let _ = B(10);
LL | let _ = namespaced_enums::C { a: 10 };
| ^ not found in `namespaced_enums`
|
-help: consider importing this variant...
+help: consider importing this variant
|
LL | use namespaced_enums::Foo::C;
|
-help: ...and refer to it directly
+help: if you import `C`, refer to it directly
|
LL - let _ = namespaced_enums::C { a: 10 };
LL + let _ = C { a: 10 };
LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize;
| ^^^^^^^ not found in `std::f64`
|
-help: consider importing one of these items...
+help: consider importing one of these items
|
LL | use std::f32::consts::LOG10_2;
|
LL | use std::f64::consts::LOG10_2;
|
-help: ...and refer to it directly
+help: if you import `LOG10_2`, refer to it directly
|
LL - const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize;
LL + const M: usize = (f64::from(N) * LOG10_2) as usize;
LL | let _map = std::hahmap::HashMap::new();
| ^^^^^^^ not found in `std::hahmap`
|
-help: consider importing this struct...
+help: consider importing this struct
|
LL | use std::collections::HashMap;
|
-help: ...and refer to it directly
+help: if you import `HashMap`, refer to it directly
|
LL - let _map = std::hahmap::HashMap::new();
LL + let _map = HashMap::new();
|
LL | let _: E = m::f;
| ~
-help: consider importing one of these items instead...
+help: consider importing one of these items instead
|
LL | use std::f32::consts::E;
|
LL | use std::f64::consts::E;
|
-help: ...and refer to it directly
+help: if you import `E`, refer to it directly
|
LL - let _: E = m::E;
LL + let _: E = E;
LL | let _: ::u8;
| ^^ not found in the crate root
|
-help: consider importing this builtin type...
+help: consider importing this builtin type
|
LL | use std::primitive::u8;
|
-help: ...and refer to it directly
+help: if you import `u8`, refer to it directly
|
LL - let _: ::u8;
LL + let _: u8;
LL | pub struct A<H: A::Trait>(pub H);
| ^^^^^ not found in `A`
|
-help: consider importing this trait...
+help: consider importing this trait
|
LL | use A::Trait;
|
-help: ...and refer to it directly
+help: if you import `Trait`, refer to it directly
|
LL - pub struct A<H: A::Trait>(pub H);
LL + pub struct A<H: Trait>(pub H);