forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9e007d
commit 13bff3f
Showing
8 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,41 @@ | ||
error: expected a trait, found type | ||
--> $DIR/normalize-tait-in-const.rs:27:34 | ||
error: `~const` can only be applied to `#[const_trait]` traits | ||
--> $DIR/normalize-tait-in-const.rs:27:42 | ||
| | ||
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
error: `~const` can only be applied to `#[const_trait]` traits | ||
--> $DIR/normalize-tait-in-const.rs:27:69 | ||
| | ||
LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ||
| ^^^^^^^^ | ||
|
||
error[E0015]: cannot call non-const closure in constant functions | ||
--> $DIR/normalize-tait-in-const.rs:28:5 | ||
| | ||
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: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct + ~const Fn(&foo::Alias<'_>)>(fun: F) { | ||
| ++++++++++++++++++++++++++++ | ||
help: add `#![feature(effects)]` to the crate attributes to enable | ||
| | ||
LL + #![feature(effects)] | ||
| | ||
|
||
error[E0493]: destructor of `F` cannot be evaluated at compile-time | ||
--> $DIR/normalize-tait-in-const.rs:27:79 | ||
| | ||
LL | const fn with_positive<F: for<'a> ~const 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 4 previous errors | ||
|
||
Some errors have detailed explanations: E0015, E0493. | ||
For more information about an error, try `rustc --explain E0015`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn f<T: ?for<'a> Sized>() {} | ||
//~^ ERROR expected a trait, found type | ||
//~^ ERROR `for<...>` binder should be placed before trait bound modifiers | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
error: expected a trait, found type | ||
--> $DIR/issue-39089.rs:1:10 | ||
error: `for<...>` binder should be placed before trait bound modifiers | ||
--> $DIR/issue-39089.rs:1:13 | ||
| | ||
LL | fn f<T: ?for<'a> Sized>() {} | ||
| ^^^^^^^^^^^^^ | ||
| - ^^^^ | ||
| | | ||
| place the `for<...>` binder before any modifiers | ||
|
||
error: aborting due to 1 previous error | ||
|