diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr')
-rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr new file mode 100644 index 000000000..9dbaffd4c --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr @@ -0,0 +1,78 @@ +error[E0277]: can't drop `NonTrivialDrop` in const contexts + --> $DIR/const-drop-fail.rs:43:5 + | +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call +... +LL | NonTrivialDrop, + | ^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct` + | + = note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:34:19 + | +LL | const fn check<T: ~const Destruct>(_: T) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check` +help: consider borrowing here + | +LL | &NonTrivialDrop, + | + +LL | &mut NonTrivialDrop, + | ++++ + +error[E0277]: can't drop `NonTrivialDrop` in const contexts + --> $DIR/const-drop-fail.rs:45:5 + | +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call +... +LL | ConstImplWithDropGlue(NonTrivialDrop), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop` + | +note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const` + --> $DIR/const-drop-fail.rs:45:5 + | +LL | ConstImplWithDropGlue(NonTrivialDrop), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required because it appears within the type `ConstImplWithDropGlue` + --> $DIR/const-drop-fail.rs:16:8 + | +LL | struct ConstImplWithDropGlue(NonTrivialDrop); + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:34:19 + | +LL | const fn check<T: ~const Destruct>(_: T) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check` + +error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: ~const Destruct` is not satisfied + --> $DIR/const-drop-fail.rs:47:5 + | +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call +... +LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct` + | +note: required because of the requirements on the impl of `~const Destruct` for `ConstDropImplWithBounds<NonTrivialDrop>` + --> $DIR/const-drop-fail.rs:28:25 + | +LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> { + | ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: 1 redundant requirement hidden + = note: required because of the requirements on the impl of `~const Destruct` for `ConstDropImplWithBounds<NonTrivialDrop>` +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:34:19 + | +LL | const fn check<T: ~const Destruct>(_: T) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check` +help: consider borrowing here + | +LL | &ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), + | + +LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), + | ++++ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. |