diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-08-13 09:02:31 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-09-20 03:02:14 +0000 |
| commit | 04eec37dc2cababaecffd423e330d3c19d3c6169 (patch) | |
| tree | 55b68f8b57e28c6dd1fda1657cd14f4e8a3b7306 /tests/ui/impl-trait | |
| parent | 3b9e0feff480b8df3254e7a828f50a1a55b88885 (diff) | |
| download | rust-04eec37dc2cababaecffd423e330d3c19d3c6169.tar.gz rust-04eec37dc2cababaecffd423e330d3c19d3c6169.zip | |
Enable effects for libcore
Diffstat (limited to 'tests/ui/impl-trait')
| -rw-r--r-- | tests/ui/impl-trait/normalize-tait-in-const.stderr | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index 5fbba9a85ca..156c67d6ae0 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -1,25 +1,14 @@ -error[E0015]: cannot call non-const closure in constant functions - --> $DIR/normalize-tait-in-const.rs:26:5 +error: ~const can only be applied to `#[const_trait]` traits + --> $DIR/normalize-tait-in-const.rs:25:42 | -LL | fun(filter_positive()); - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -help: consider further restricting this bound - | -LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const std::ops::Fn<(&Alias<'_>,)>>(fun: F) { - | ++++++++++++++++++++++++++++++++++++ +LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { + | ^^^^^^^^^^^^^^^^^ -error[E0493]: destructor of `F` cannot be evaluated at compile-time - --> $DIR/normalize-tait-in-const.rs:25:79 +error: ~const can only be applied to `#[const_trait]` traits + --> $DIR/normalize-tait-in-const.rs:25:69 | LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^ the destructor for this type cannot be evaluated in constant functions -LL | fun(filter_positive()); -LL | } - | - value is dropped here + | ^^^^^^^^ error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0493. -For more information about an error, try `rustc --explain E0015`. |
