forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#114776 - fee1-dead-contrib:enable-effects-in-…
…libcore, r=<try> Enable effects for libcore ~~r? `@oli-obk~~` forgot you are on vacation, oops
- Loading branch information
Showing
18 changed files
with
170 additions
and
131 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
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,34 +1,8 @@ | ||
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: ~const FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T { | ||
| +++++++++++++++++++++++++++++ | ||
|
||
error[E0493]: destructor of `F` cannot be evaluated at compile-time | ||
--> $DIR/unstable-const-fn-in-libcore.rs:17:60 | ||
| | ||
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T { | ||
| ^ the destructor for this type cannot be evaluated in constant functions | ||
... | ||
LL | } | ||
| - value is dropped here | ||
|
||
error[E0493]: destructor of `Opt<T>` cannot be evaluated at compile-time | ||
--> $DIR/unstable-const-fn-in-libcore.rs:17:54 | ||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/unstable-const-fn-in-libcore.rs:19:39 | ||
| | ||
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T { | ||
| ^^^^ the destructor for this type cannot be evaluated in constant functions | ||
... | ||
LL | } | ||
| - value is dropped here | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to previous error | ||
|
||
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,25 +1,8 @@ | ||
error[E0015]: cannot call non-const closure in constant functions | ||
--> $DIR/normalize-tait-in-const.rs:26: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: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const std::ops::Fn<(&Alias<'_>,)>>(fun: F) { | ||
| ++++++++++++++++++++++++++++++++++++ | ||
|
||
error[E0493]: destructor of `F` cannot be evaluated at compile-time | ||
--> $DIR/normalize-tait-in-const.rs:25:79 | ||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/normalize-tait-in-const.rs:25:42 | ||
| | ||
LL | const fn with_positive<F: ~const for<'a> 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 2 previous errors | ||
error: aborting due to previous error | ||
|
||
Some errors have detailed explanations: E0015, E0493. | ||
For more information about an error, try `rustc --explain E0015`. |
3 changes: 2 additions & 1 deletion
3
tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs
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
8 changes: 8 additions & 0 deletions
8
tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.stderr
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/const-closure-parse-not-item.rs:7:32 | ||
| | ||
LL | const fn test() -> impl ~const Fn() { | ||
| ^^^^ | ||
|
||
error: aborting due to previous error | ||
|
15 changes: 4 additions & 11 deletions
15
tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
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,15 +1,8 @@ | ||
error[E0015]: cannot call non-const closure in constant functions | ||
--> $DIR/const-closure-trait-method-fail.rs:15:5 | ||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/const-closure-trait-method-fail.rs:14:39 | ||
| | ||
LL | x(()) | ||
| ^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
help: consider further restricting this bound | ||
| | ||
LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 { | ||
| ++++++++++++++++++++++++++++++++ | ||
LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 { | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
15 changes: 4 additions & 11 deletions
15
tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.stderr
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,15 +1,8 @@ | ||
error[E0015]: cannot call non-const closure in constant functions | ||
--> $DIR/const-closure-trait-method.rs:15:5 | ||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/const-closure-trait-method.rs:14:39 | ||
| | ||
LL | x(()) | ||
| ^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
help: consider further restricting this bound | ||
| | ||
LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 { | ||
| ++++++++++++++++++++++++++++++++ | ||
LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 { | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
Oops, something went wrong.