diff options
| author | Esteban Kuber <esteban@kuber.com.ar> | 2021-10-05 23:04:09 +0000 |
|---|---|---|
| committer | Esteban Kuber <esteban@kuber.com.ar> | 2021-11-20 18:54:31 +0000 |
| commit | 6b9d910639d50a26cec46e326e1556665b22decf (patch) | |
| tree | 773eff83fdd65cbe5b397373665889c97d4eccb2 /src/test/ui/const-generics/generic_const_exprs | |
| parent | 93542a8240c5f926ac5f3f99cef99366082f9c2b (diff) | |
| download | rust-6b9d910639d50a26cec46e326e1556665b22decf.tar.gz rust-6b9d910639d50a26cec46e326e1556665b22decf.zip | |
Point at source of trait bound obligations in more places
Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). Address part of #89418.
Diffstat (limited to 'src/test/ui/const-generics/generic_const_exprs')
| -rw-r--r-- | src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr | 5 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr index 3c7a740e843..02dce4f7a97 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr @@ -41,11 +41,6 @@ LL | IsLessOrEqual<I, 8>: True, | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>` | = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True` -note: required by a bound in `True` - --> $DIR/issue-72787.rs:8:1 - | -LL | pub trait True {} - | ^^^^^^^^^^^^^^ required by this bound in `True` error[E0283]: type annotations needed --> $DIR/issue-72787.rs:21:26 @@ -54,11 +49,6 @@ LL | IsLessOrEqual<I, 8>: True, | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>` | = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True` -note: required by a bound in `True` - --> $DIR/issue-72787.rs:8:1 - | -LL | pub trait True {} - | ^^^^^^^^^^^^^^ required by this bound in `True` error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr index ef785bf07eb..0332e82fe07 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr @@ -14,6 +14,11 @@ LL | self.reference.size() | ^^^^ | = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:` +note: required by a bound in `TensorSize::size` + --> $DIR/issue-83765.rs:9:31 + | +LL | fn size(&self) -> [usize; Self::DIM]; + | ^^^^^^^^^ required by this bound in `TensorSize::size` error[E0308]: mismatched types --> $DIR/issue-83765.rs:32:9 |
