Skip to content

Commit

Permalink
Rebless
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Feb 12, 2022
1 parent 12397ab commit 88d433e
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/const-generics/issue-93647.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct X<const N: usize = {
(||1usize)()
//~^ ERROR calls in constants are limited to
//~^ ERROR cannot call
}>;

fn main() {}
5 changes: 4 additions & 1 deletion src/test/ui/const-generics/issue-93647.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
error[E0015]: cannot call non-const closure in constants
--> $DIR/issue-93647.rs:2:5
|
LL | (||1usize)()
| ^^^^^^^^^^^^
|
= note: closures need an RFC before allowed to be called in constants
= note: calls in constants are limited to constant functions, tuple structs and tuple variants

error: aborting due to previous error

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/consts/const-fn-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const fn f(x: usize) -> usize {
//~^ ERROR mutable references
//~| ERROR cannot convert
//~| ERROR cannot call non-const fn
//~| ERROR E0080
//~| ERROR `for` is not allowed in a `const fn`
sum += i;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
|
LL | a.plus(b)
| ^^^^^^^ the trait `~const Plus` is not implemented for `u32`
|
note: the trait `Plus` is implemented for `u32`, but that implementation is not `const`
--> $DIR/call-const-trait-method-fail.rs:24:7
|
LL | a.plus(b)
| ^^^^^^^

error[E0015]: cannot call non-const fn `<u32 as Plus>::plus` in constant functions
--> $DIR/call-const-trait-method-fail.rs:24:7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0277]: can't compare `T` with `T` in const contexts
|
LL | *t == *t
| ^^^^^^^^ no implementation for `T == T`
|
note: the trait `PartialEq` is implemented for `T`, but that implementation is not `const`
--> $DIR/call-generic-method-fail.rs:5:5
|
LL | *t == *t
| ^^^^^^^^

error[E0015]: cannot call non-const operator in constant functions
--> $DIR/call-generic-method-fail.rs:5:5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satis
|
LL | NonConstImpl.a();
| ^^^ the trait `~const ConstDefaultFn` is not implemented for `NonConstImpl`
|
note: the trait `ConstDefaultFn` is implemented for `NonConstImpl`, but that implementation is not `const`
--> $DIR/const-default-method-bodies.rs:25:18
|
LL | NonConstImpl.a();
| ^^^

error[E0015]: cannot call non-const fn `<NonConstImpl as ConstDefaultFn>::a` in constant functions
--> $DIR/const-default-method-bodies.rs:25:18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrai
|
LL | NonConst.func();
| ^^^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
|
note: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst`, but that implementation is not `const`
--> $DIR/cross-crate.rs:15:14
|
LL | NonConst.func();
| ^^^^^^

error[E0015]: cannot call non-const fn `<cross_crate::NonConst as cross_crate::MyTrait>::func` in constant functions
--> $DIR/cross-crate.rs:15:14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0277]: the trait bound `(): ~const Tr` is not satisfied
|
LL | ().a()
| ^^^ the trait `~const Tr` is not implemented for `()`
|
note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
--> $DIR/default-method-body-is-const-same-trait-ck.rs:10:12
|
LL | ().a()
| ^^^

error[E0015]: cannot call non-const fn `<() as Tr>::a` in constant functions
--> $DIR/default-method-body-is-const-same-trait-ck.rs:10:12
Expand Down
6 changes: 6 additions & 0 deletions src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0277]: the trait bound `T: ~const A` is not satisfied
|
LL | T::assoc()
| ^^^^^^^^^^ the trait `~const A` is not implemented for `T`
|
note: the trait `A` is implemented for `T`, but that implementation is not `const`
--> $DIR/issue-88155.rs:9:5
|
LL | T::assoc()
| ^^^^^^^^^^

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

0 comments on commit 88d433e

Please sign in to comment.