summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr')
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr
new file mode 100644
index 000000000..9210f6427
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const-bound-on-not-const-associated-fn.stderr
@@ -0,0 +1,26 @@
+error: `~const` is not allowed here
+ --> $DIR/const-bound-on-not-const-associated-fn.rs:9:40
+ |
+LL | fn do_something_else() where Self: ~const MyTrait;
+ | ^^^^^^^^^^^^^^
+ |
+note: this function is not `const`, so it cannot have `~const` trait bounds
+ --> $DIR/const-bound-on-not-const-associated-fn.rs:9:8
+ |
+LL | fn do_something_else() where Self: ~const MyTrait;
+ | ^^^^^^^^^^^^^^^^^
+
+error: `~const` is not allowed here
+ --> $DIR/const-bound-on-not-const-associated-fn.rs:20:32
+ |
+LL | pub fn foo(&self) where T: ~const MyTrait {
+ | ^^^^^^^^^^^^^^
+ |
+note: this function is not `const`, so it cannot have `~const` trait bounds
+ --> $DIR/const-bound-on-not-const-associated-fn.rs:20:12
+ |
+LL | pub fn foo(&self) where T: ~const MyTrait {
+ | ^^^
+
+error: aborting due to 2 previous errors
+