]> git.lizzy.rs Git - rust.git/commitdiff
Tweak wording
authorEsteban Kuber <esteban@kuber.com.ar>
Tue, 3 May 2022 02:07:47 +0000 (02:07 +0000)
committerEsteban Kuber <esteban@kuber.com.ar>
Tue, 3 May 2022 02:07:47 +0000 (02:07 +0000)
compiler/rustc_resolve/src/diagnostics.rs
src/test/ui/macros/macro-outer-attributes.stderr
src/test/ui/namespace/namespace-mix.stderr
src/test/ui/parser/circular_modules_main.stderr
src/test/ui/resolve/enums-are-namespaced-xc.stderr
src/test/ui/resolve/issue-50599.stderr
src/test/ui/resolve/missing-in-namespace.stderr
src/test/ui/resolve/privacy-enum-ctor.stderr
src/test/ui/resolve/resolve-primitive-fallback.stderr
src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr

index f75ea583d852e744d87880de7adb186d1c5dd413..5d80f49626a0476ad92a4daa2bb8b8aeec32fea1 100644 (file)
@@ -2484,15 +2484,14 @@ fn show_candidates(
             ("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()) {
@@ -2523,7 +2522,7 @@ fn show_candidates(
             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,
                 );
index a9fb79b7b27cfb73a721b625162c001a28d86411..91073d3698d911887442f5f9425cbc4cda640e88 100644 (file)
@@ -4,11 +4,11 @@ error[E0425]: cannot find function `bar` in module `a`
 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();
index dd9c969fc82fe6ee69374753015e0660aff856f1..037a858d7e1012fdc56b94613bcc61121c87995a 100644 (file)
@@ -12,13 +12,13 @@ help: a tuple struct with a similar name exists
    |
 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);
@@ -40,13 +40,13 @@ help: a tuple struct with a similar name exists
    |
 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);
@@ -71,13 +71,13 @@ help: a tuple variant with a similar name exists
    |
 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);
@@ -104,13 +104,13 @@ help: a tuple variant with a similar name exists
    |
 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);
index f6f3babc2d5e3361cfb3accf020fd4f4eb60834c..c5434c72b382b6a3c289874e115555c6506af22d 100644 (file)
@@ -10,11 +10,11 @@ error[E0425]: cannot find function `hi_str` in module `circular_modules_main`
 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());
index f501683ebc95f49cb89133f92edfe97c7870cdcd..1d26a2c005872524a875f4441063b510a4165e42 100644 (file)
@@ -4,11 +4,11 @@ error[E0425]: cannot find value `A` in crate `namespaced_enums`
 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;
@@ -20,11 +20,11 @@ error[E0425]: cannot find function, tuple struct or tuple variant `B` in crate `
 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);
@@ -36,11 +36,11 @@ error[E0422]: cannot find struct, variant or union type `C` in crate `namespaced
 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 };
index ef0b30d98d8841d9d9620d80139589abdf861526..4cc035cb11e2034e9e0d178b1ac23d3e721c595b 100644 (file)
@@ -4,13 +4,13 @@ error[E0425]: cannot find value `LOG10_2` in module `std::f64`
 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;
index 265f370494aa72559595c6cc767357755472f773..338a5423aa472a58d602f924aace44b62d4f13fd 100644 (file)
@@ -4,11 +4,11 @@ error[E0433]: failed to resolve: could not find `hahmap` in `std`
 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();
index 4ac18c0e7959965a52c999411cd11ff88735f87f..ed89170fd8a75519ea4c3117ecbff87ae0bec5ff 100644 (file)
@@ -99,13 +99,13 @@ help: a function with a similar name exists
    |
 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;
index 3db3706ecf51dcbba3b4f86cbb053cba2662c7e1..fcbc28475f99880799cbfaafa5f04174374886f9 100644 (file)
@@ -10,11 +10,11 @@ error[E0412]: cannot find type `u8` in the crate root
 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;
index 413a0c8d60e2c3397a62f7fa3b8b801ce98370d9..a8b275f98034a80751f3aac5f78a40240b2a76d3 100644 (file)
@@ -4,11 +4,11 @@ error[E0405]: cannot find trait `Trait` in `A`
 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);