-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Enable effects for libcore #114776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bors
merged 6 commits into
rust-lang:master
from
fee1-dead-contrib:enable-effects-in-libcore
Sep 22, 2023
Merged
Enable effects for libcore #114776
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
04eec37
Enable effects for libcore
fee1-dead 7b1b175
fix bugs with effects fallback
fee1-dead a3b5f1a
ignore host effect params in rustdoc
fee1-dead 7446012
fix rustdoc tests
fee1-dead 2063ebc
bless the known-bug tests
fee1-dead ab168b6
fix clippy errors (ignore effects in certainty)
fee1-dead File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.