Skip to content

Commit 88d433e

Browse files
committed
Rebless
1 parent 12397ab commit 88d433e

9 files changed

+41
-3
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
struct X<const N: usize = {
22
(||1usize)()
3-
//~^ ERROR calls in constants are limited to
3+
//~^ ERROR cannot call
44
}>;
55

66
fn main() {}

src/test/ui/const-generics/issue-93647.stderr

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
1+
error[E0015]: cannot call non-const closure in constants
22
--> $DIR/issue-93647.rs:2:5
33
|
44
LL | (||1usize)()
55
| ^^^^^^^^^^^^
6+
|
7+
= note: closures need an RFC before allowed to be called in constants
8+
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
69

710
error: aborting due to previous error
811

src/test/ui/consts/const-fn-error.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const fn f(x: usize) -> usize {
66
//~^ ERROR mutable references
77
//~| ERROR cannot convert
88
//~| ERROR cannot call non-const fn
9-
//~| ERROR E0080
109
//~| ERROR `for` is not allowed in a `const fn`
1110
sum += i;
1211
}

src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
33
|
44
LL | a.plus(b)
55
| ^^^^^^^ the trait `~const Plus` is not implemented for `u32`
6+
|
7+
note: the trait `Plus` is implemented for `u32`, but that implementation is not `const`
8+
--> $DIR/call-const-trait-method-fail.rs:24:7
9+
|
10+
LL | a.plus(b)
11+
| ^^^^^^^
612

713
error[E0015]: cannot call non-const fn `<u32 as Plus>::plus` in constant functions
814
--> $DIR/call-const-trait-method-fail.rs:24:7

src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ error[E0277]: can't compare `T` with `T` in const contexts
33
|
44
LL | *t == *t
55
| ^^^^^^^^ no implementation for `T == T`
6+
|
7+
note: the trait `PartialEq` is implemented for `T`, but that implementation is not `const`
8+
--> $DIR/call-generic-method-fail.rs:5:5
9+
|
10+
LL | *t == *t
11+
| ^^^^^^^^
612

713
error[E0015]: cannot call non-const operator in constant functions
814
--> $DIR/call-generic-method-fail.rs:5:5

src/test/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satis
33
|
44
LL | NonConstImpl.a();
55
| ^^^ the trait `~const ConstDefaultFn` is not implemented for `NonConstImpl`
6+
|
7+
note: the trait `ConstDefaultFn` is implemented for `NonConstImpl`, but that implementation is not `const`
8+
--> $DIR/const-default-method-bodies.rs:25:18
9+
|
10+
LL | NonConstImpl.a();
11+
| ^^^
612

713
error[E0015]: cannot call non-const fn `<NonConstImpl as ConstDefaultFn>::a` in constant functions
814
--> $DIR/const-default-method-bodies.rs:25:18

src/test/ui/rfc-2632-const-trait-impl/cross-crate.gated.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrai
33
|
44
LL | NonConst.func();
55
| ^^^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
6+
|
7+
note: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst`, but that implementation is not `const`
8+
--> $DIR/cross-crate.rs:15:14
9+
|
10+
LL | NonConst.func();
11+
| ^^^^^^
612

713
error[E0015]: cannot call non-const fn `<cross_crate::NonConst as cross_crate::MyTrait>::func` in constant functions
814
--> $DIR/cross-crate.rs:15:14

src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ error[E0277]: the trait bound `(): ~const Tr` is not satisfied
33
|
44
LL | ().a()
55
| ^^^ the trait `~const Tr` is not implemented for `()`
6+
|
7+
note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
8+
--> $DIR/default-method-body-is-const-same-trait-ck.rs:10:12
9+
|
10+
LL | ().a()
11+
| ^^^
612

713
error[E0015]: cannot call non-const fn `<() as Tr>::a` in constant functions
814
--> $DIR/default-method-body-is-const-same-trait-ck.rs:10:12

src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ error[E0277]: the trait bound `T: ~const A` is not satisfied
33
|
44
LL | T::assoc()
55
| ^^^^^^^^^^ the trait `~const A` is not implemented for `T`
6+
|
7+
note: the trait `A` is implemented for `T`, but that implementation is not `const`
8+
--> $DIR/issue-88155.rs:9:5
9+
|
10+
LL | T::assoc()
11+
| ^^^^^^^^^^
612

713
error[E0015]: cannot call non-const fn `<T as A>::assoc` in constant functions
814
--> $DIR/issue-88155.rs:9:5

0 commit comments

Comments
 (0)