diff options
| author | Boxy <supbscripter@gmail.com> | 2024-05-29 17:06:50 +0100 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2024-05-29 17:06:54 +0100 |
| commit | d5bd4e233d2bb4415138e384e66379eedbc7e76e (patch) | |
| tree | 48097f82d6b2ccf2d0f8aec6744f377d16f2bd06 /tests/ui/specialization | |
| parent | da159eb331b27df528185c616b394bb0e1d2a4bd (diff) | |
| download | rust-d5bd4e233d2bb4415138e384e66379eedbc7e76e.tar.gz rust-d5bd4e233d2bb4415138e384e66379eedbc7e76e.zip | |
Partially implement `ConstArgHasType`
Diffstat (limited to 'tests/ui/specialization')
| -rw-r--r-- | tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs | 3 | ||||
| -rw-r--r-- | tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr | 36 |
2 files changed, 10 insertions, 29 deletions
diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs index 4d1cd4332fe..f89a463bc58 100644 --- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs +++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs @@ -7,8 +7,7 @@ struct S<const L: usize>; impl<const N: i32> Copy for S<N> {} //~^ ERROR: mismatched types -//~| ERROR: the trait bound `S<N>: Clone` is not satisfied -//~| ERROR: the constant `N` is not of type `usize` impl<const M: usize> Copy for S<M> {} +//~^ ERROR: conflicting implementations of trait `Copy` for type `S<_>` fn main() {} diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr index 716a4787948..1dac58e1f69 100644 --- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr +++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr @@ -1,29 +1,11 @@ -error[E0277]: the trait bound `S<N>: Clone` is not satisfied - --> $DIR/bad-const-wf-doesnt-specialize.rs:8:29 +error[E0119]: conflicting implementations of trait `Copy` for type `S<_>` + --> $DIR/bad-const-wf-doesnt-specialize.rs:10:1 | LL | impl<const N: i32> Copy for S<N> {} - | ^^^^ the trait `Clone` is not implemented for `S<N>` - | - = help: the trait `Clone` is implemented for `S<L>` -note: required by a bound in `Copy` - --> $SRC_DIR/core/src/marker.rs:LL:COL -help: consider annotating `S<N>` with `#[derive(Clone)]` - | -LL + #[derive(Clone)] -LL | struct S<const L: usize>; - | - -error: the constant `N` is not of type `usize` - --> $DIR/bad-const-wf-doesnt-specialize.rs:8:29 - | -LL | impl<const N: i32> Copy for S<N> {} - | ^^^^ expected `usize`, found `i32` - | -note: required by a bound in `S` - --> $DIR/bad-const-wf-doesnt-specialize.rs:6:10 - | -LL | struct S<const L: usize>; - | ^^^^^^^^^^^^^^ required by this bound in `S` + | -------------------------------- first implementation here +LL | +LL | impl<const M: usize> Copy for S<M> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S<_>` error[E0308]: mismatched types --> $DIR/bad-const-wf-doesnt-specialize.rs:8:31 @@ -31,7 +13,7 @@ error[E0308]: mismatched types LL | impl<const N: i32> Copy for S<N> {} | ^ expected `usize`, found `i32` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0277, E0308. -For more information about an error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0119, E0308. +For more information about an error, try `rustc --explain E0119`. |
