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/consts/unstable-const-fn-in-libcore.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/consts/unstable-const-fn-in-libcore.stderr')
-rw-r--r-- | src/test/ui/consts/unstable-const-fn-in-libcore.stderr | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr new file mode 100644 index 000000000..180f9f10c --- /dev/null +++ b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr @@ -0,0 +1,34 @@ +error[E0015]: cannot call non-const closure in constant functions + --> $DIR/unstable-const-fn-in-libcore.rs:22:26 + | +LL | Opt::None => f(), + | ^^^ + | + = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants +help: consider further restricting this bound + | +LL | const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T { + | +++++++++++++++++++++++++++++ + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/unstable-const-fn-in-libcore.rs:17:53 + | +LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { + | ^ constant functions cannot evaluate destructors +... +LL | } + | - value is dropped here + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/unstable-const-fn-in-libcore.rs:17:47 + | +LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { + | ^^^^ constant functions cannot evaluate destructors +... +LL | } + | - value is dropped here + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0015, E0493. +For more information about an error, try `rustc --explain E0015`. |