diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-09-02 10:59:53 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-09-09 05:21:32 +0000 |
| commit | 1ca83c6451783aaa77aa69643b70b22ef9e9a01a (patch) | |
| tree | 1c8d6ae32eb0353472adbb255bce0d408278482c /src | |
| parent | f0a52128ee2d522e12893637428d88a3287c818e (diff) | |
| download | rust-1ca83c6451783aaa77aa69643b70b22ef9e9a01a.tar.gz rust-1ca83c6451783aaa77aa69643b70b22ef9e9a01a.zip | |
Use trait select logic instead of query
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stderr | 27 |
2 files changed, 34 insertions, 4 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs index a79b67fb0db..17442e1b05a 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs @@ -16,16 +16,19 @@ impl const Drop for ConstImplWithDropGlue { fn drop(&mut self) {} } -const fn check<T: ~const Drop>() {} +const fn check<T: ~const Drop>(_: T) {} macro_rules! check_all { - ($($T:ty),*$(,)?) => {$( - const _: () = check::<$T>(); + ($($exp:expr),*$(,)?) => {$( + const _: () = check($exp); )*}; } check_all! { - ConstImplWithDropGlue, + NonTrivialDrop, + //~^ ERROR the trait bound + ConstImplWithDropGlue(NonTrivialDrop), + //~^ ERROR the trait bound } fn main() {} diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stderr new file mode 100644 index 00000000000..e962503d7df --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `NonTrivialDrop: Drop` is not satisfied + --> $DIR/const-drop-fail.rs:28:5 + | +LL | NonTrivialDrop, + | ^^^^^^^^^^^^^^ the trait `Drop` is not implemented for `NonTrivialDrop` + | +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:19:19 + | +LL | const fn check<T: ~const Drop>(_: T) {} + | ^^^^^^^^^^^ required by this bound in `check` + +error[E0277]: the trait bound `ConstImplWithDropGlue: Drop` is not satisfied + --> $DIR/const-drop-fail.rs:30:5 + | +LL | ConstImplWithDropGlue(NonTrivialDrop), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Drop` is not implemented for `ConstImplWithDropGlue` + | +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:19:19 + | +LL | const fn check<T: ~const Drop>(_: T) {} + | ^^^^^^^^^^^ required by this bound in `check` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. |
