about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-28 09:35:20 +0200
committerGitHub <noreply@github.com>2022-08-28 09:35:20 +0200
commit3142996a460ae41d3e8866203da577f70b5eefb2 (patch)
treef2eb7a6b649e51ad6726bd891c73ceb0c02def52 /src/test/ui
parent5b8081490f7aa71e947b04729cfa9ac0fd487d0b (diff)
parentb33c3d6cd68788f62b79814726004da45546bfa7 (diff)
downloadrust-3142996a460ae41d3e8866203da577f70b5eefb2.tar.gz
rust-3142996a460ae41d3e8866203da577f70b5eefb2.zip
Rollup merge of #101055 - TaKO8Ki:use-smaller-span, r=compiler-errors
Use smaller span for suggestions
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr4
-rw-r--r--src/test/ui/const-generics/issues/issue-87493.stderr8
-rw-r--r--src/test/ui/deprecation/deprecation-sanity.stderr4
-rw-r--r--src/test/ui/error-codes/E0107.stderr2
-rw-r--r--src/test/ui/error-codes/E0565-2.stderr4
-rw-r--r--src/test/ui/methods/method-on-ambiguous-numeric-type.stderr8
-rw-r--r--src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr2
7 files changed, 20 insertions, 12 deletions
diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
index a057fd19b16..d4bd673b84e 100644
--- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
+++ b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
@@ -50,7 +50,9 @@ error[E0565]: literal in `cfg` predicate value must be a string
   --> $DIR/cfg-attr-syntax-validation.rs:25:11
    |
 LL | #[cfg(a = b"hi")]
-   |           ^^^^^ help: consider removing the prefix: `"hi"`
+   |           -^^^^
+   |           |
+   |           help: consider removing the prefix
 
 error: expected unsuffixed literal or identifier, found `concat!("nonexistent")`
   --> $DIR/cfg-attr-syntax-validation.rs:30:25
diff --git a/src/test/ui/const-generics/issues/issue-87493.stderr b/src/test/ui/const-generics/issues/issue-87493.stderr
index f998c1187d8..653afae2191 100644
--- a/src/test/ui/const-generics/issues/issue-87493.stderr
+++ b/src/test/ui/const-generics/issues/issue-87493.stderr
@@ -13,15 +13,17 @@ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was su
   --> $DIR/issue-87493.rs:8:8
    |
 LL |     T: MyTrait<Assoc == S::Assoc>,
-   |        ^^^^^^^ ----------------- help: replace the generic bound with the associated type: `Assoc = Assoc == S::Assoc`
-   |        |
-   |        expected 0 generic arguments
+   |        ^^^^^^^ expected 0 generic arguments
    |
 note: trait defined here, with 0 generic parameters
   --> $DIR/issue-87493.rs:1:11
    |
 LL | pub trait MyTrait {
    |           ^^^^^^^
+help: replace the generic bound with the associated type
+   |
+LL |     T: MyTrait<Assoc = Assoc == S::Assoc>,
+   |                +++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/deprecation/deprecation-sanity.stderr b/src/test/ui/deprecation/deprecation-sanity.stderr
index 973c672df91..8b2b480d195 100644
--- a/src/test/ui/deprecation/deprecation-sanity.stderr
+++ b/src/test/ui/deprecation/deprecation-sanity.stderr
@@ -44,7 +44,9 @@ error[E0565]: literal in `deprecated` value must be a string
   --> $DIR/deprecation-sanity.rs:19:25
    |
 LL |     #[deprecated(note = b"test")]
-   |                         ^^^^^^^ help: consider removing the prefix: `"test"`
+   |                         -^^^^^^
+   |                         |
+   |                         help: consider removing the prefix
 
 error[E0565]: item in `deprecated` must be a key/value pair
   --> $DIR/deprecation-sanity.rs:22:18
diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr
index 5ca03b45d82..03430f8fa3a 100644
--- a/src/test/ui/error-codes/E0107.stderr
+++ b/src/test/ui/error-codes/E0107.stderr
@@ -142,7 +142,7 @@ LL | pub trait T {
 help: replace the generic bounds with the associated types
    |
 LL | fn trait_bound_generic<I: T<A = u8, B = u16>>(_i: I) {
-   |                             ~~~~~~  ~~~~~~~
+   |                             +++     +++
 
 error: aborting due to 10 previous errors
 
diff --git a/src/test/ui/error-codes/E0565-2.stderr b/src/test/ui/error-codes/E0565-2.stderr
index bb30bd7befb..097871bd319 100644
--- a/src/test/ui/error-codes/E0565-2.stderr
+++ b/src/test/ui/error-codes/E0565-2.stderr
@@ -2,7 +2,9 @@ error[E0565]: literal in `deprecated` value must be a string
   --> $DIR/E0565-2.rs:2:22
    |
 LL | #[deprecated(since = b"1.29", note = "hi")]
-   |                      ^^^^^^^ help: consider removing the prefix: `"1.29"`
+   |                      -^^^^^^
+   |                      |
+   |                      help: consider removing the prefix
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
index 0af58bc61f4..91733411637 100644
--- a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
+++ b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
@@ -18,7 +18,7 @@ LL |     let x = y.neg();
 help: you must specify a type for this binding, like `f32`
    |
 LL |     let y: f32 = 2.0;
-   |         ~~~~~~
+   |          +++++
 
 error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
   --> $DIR/method-on-ambiguous-numeric-type.rs:19:26
@@ -37,7 +37,7 @@ LL |     local_bar.pow(2);
 help: you must specify a type for this binding, like `i32`
    |
 LL |     ($ident:ident) => { let $ident: i32 = 42; }
-   |                             ~~~~~~~~~~~
+   |                                   +++++
 
 error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
   --> $DIR/method-on-ambiguous-numeric-type.rs:30:9
@@ -46,10 +46,10 @@ LL |     bar.pow(2);
    |         ^^^
    |
 help: you must specify a type for this binding, like `i32`
-  --> $DIR/auxiliary/macro-in-other-crate.rs:3:29
+  --> $DIR/auxiliary/macro-in-other-crate.rs:3:35
    |
 LL |     ($ident:ident) => { let $ident: i32 = 42; }
-   |                             ~~~~~~~~~~~
+   |                                   +++++
 
 error: aborting due to 5 previous errors
 
diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
index 7038a572bec..75b91923284 100644
--- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
+++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
@@ -12,7 +12,7 @@ LL | pub trait T<X, Y> {
 help: replace the generic bounds with the associated types
    |
 LL |     i: Box<dyn T<usize, usize, A = usize, C = usize, B=usize>>,
-   |                                ~~~~~~~~~  ~~~~~~~~~
+   |                                +++        +++
 
 error[E0191]: the value of the associated types `A` (from trait `T`), `C` (from trait `T`) must be specified
   --> $DIR/use-type-argument-instead-of-assoc-type.rs:7:16