diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/const-generics/generic_const_exprs/issue-85848.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr | 18 | ||||
| -rw-r--r-- | src/test/ui/const-generics/issues/issue-86530.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/const-generics/issues/issue-86530.stderr | 18 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-77919.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-77919.stderr | 16 | ||||
| -rw-r--r-- | src/test/ui/recursion/issue-83150.rs | 2 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/crashes/ice-6252.stderr | 10 |
8 files changed, 56 insertions, 11 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs index e86ffbf1075..3a7f4c6184c 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs @@ -24,6 +24,7 @@ fn writes_to_path<C>(cap: &C) { writes_to_specific_path(&cap); //~^ ERROR: the trait bound `(): _Contains<&C>` is not satisfied [E0277] //~| ERROR: unconstrained generic constant + //~| ERROR: mismatched types [E0308] } fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr index 27f5dce9fb2..d45dfde9a79 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr @@ -18,7 +18,7 @@ note: required because of the requirements on the impl of `Delegates<()>` for `& LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {} | ^^^^^^^^^^^^ ^ note: required by a bound in `writes_to_specific_path` - --> $DIR/issue-85848.rs:29:31 + --> $DIR/issue-85848.rs:30:31 | LL | fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {} | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` @@ -43,11 +43,21 @@ note: required because of the requirements on the impl of `Delegates<()>` for `& LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {} | ^^^^^^^^^^^^ ^ note: required by a bound in `writes_to_specific_path` - --> $DIR/issue-85848.rs:29:31 + --> $DIR/issue-85848.rs:30:31 | LL | fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {} | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` -error: aborting due to 2 previous errors +error[E0308]: mismatched types + --> $DIR/issue-85848.rs:24:5 + | +LL | writes_to_specific_path(&cap); + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `true`, found `{ contains::<T, U>() }` + | + = note: expected type `true` + found type `{ contains::<T, U>() }` + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/issues/issue-86530.rs b/src/test/ui/const-generics/issues/issue-86530.rs index b024decd4e1..4a6ffd1f300 100644 --- a/src/test/ui/const-generics/issues/issue-86530.rs +++ b/src/test/ui/const-generics/issues/issue-86530.rs @@ -15,6 +15,7 @@ where fn unit_literals() { z(" "); //~^ ERROR: the trait bound `&str: X` is not satisfied + //~| ERROR: unconstrained generic constant } fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-86530.stderr b/src/test/ui/const-generics/issues/issue-86530.stderr index c63857b2314..c688f838dab 100644 --- a/src/test/ui/const-generics/issues/issue-86530.stderr +++ b/src/test/ui/const-generics/issues/issue-86530.stderr @@ -15,6 +15,22 @@ LL | where LL | T: X, | ^ required by this bound in `z` -error: aborting due to previous error +error: unconstrained generic constant + --> $DIR/issue-86530.rs:16:5 + | +LL | z(" "); + | ^ + | + = help: try adding a `where` bound using this expression: `where [(); T::Y]:` +note: required by a bound in `z` + --> $DIR/issue-86530.rs:11:10 + | +LL | fn z<T>(t: T) + | - required by a bound in this +... +LL | [(); T::Y]: , + | ^^^^ required by this bound in `z` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issues/issue-77919.rs b/src/test/ui/issues/issue-77919.rs index 966d76d148a..1d5d5930731 100644 --- a/src/test/ui/issues/issue-77919.rs +++ b/src/test/ui/issues/issue-77919.rs @@ -1,5 +1,6 @@ fn main() { [1; <Multiply<Five, Five>>::VAL]; + //~^ ERROR: constant expression depends on a generic parameter } trait TypeVal<T> { const VAL: T; diff --git a/src/test/ui/issues/issue-77919.stderr b/src/test/ui/issues/issue-77919.stderr index 97bd5ab36b6..c986e47fb55 100644 --- a/src/test/ui/issues/issue-77919.stderr +++ b/src/test/ui/issues/issue-77919.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `PhantomData` in this scope - --> $DIR/issue-77919.rs:9:9 + --> $DIR/issue-77919.rs:10:9 | LL | _n: PhantomData, | ^^^^^^^^^^^ not found in this scope @@ -10,7 +10,7 @@ LL | use std::marker::PhantomData; | error[E0412]: cannot find type `VAL` in this scope - --> $DIR/issue-77919.rs:11:63 + --> $DIR/issue-77919.rs:12:63 | LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} | - ^^^ not found in this scope @@ -18,7 +18,7 @@ LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} | help: you might be missing a type parameter: `, VAL` error[E0046]: not all trait items implemented, missing: `VAL` - --> $DIR/issue-77919.rs:11:1 + --> $DIR/issue-77919.rs:12:1 | LL | const VAL: T; | ------------- `VAL` from trait @@ -26,7 +26,15 @@ LL | const VAL: T; LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation -error: aborting due to 3 previous errors +error: constant expression depends on a generic parameter + --> $DIR/issue-77919.rs:2:9 + | +LL | [1; <Multiply<Five, Five>>::VAL]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to 4 previous errors Some errors have detailed explanations: E0046, E0412. For more information about an error, try `rustc --explain E0046`. diff --git a/src/test/ui/recursion/issue-83150.rs b/src/test/ui/recursion/issue-83150.rs index dc25004f89b..aa3f66b2e28 100644 --- a/src/test/ui/recursion/issue-83150.rs +++ b/src/test/ui/recursion/issue-83150.rs @@ -1,5 +1,5 @@ // build-fail - //~^ overflow evaluating +//~^ ERROR overflow evaluating the requirement fn main() { let mut iter = 0u8..1; diff --git a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr index c8239897f3a..d930d486fde 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr @@ -30,7 +30,15 @@ LL | const VAL: T; LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation -error: aborting due to 3 previous errors +error: constant expression depends on a generic parameter + --> $DIR/ice-6252.rs:13:9 + | +LL | [1; <Multiply<Five, Five>>::VAL]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to 4 previous errors Some errors have detailed explanations: E0046, E0412. For more information about an error, try `rustc --explain E0046`. |
