-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Match Ergonomics 2024: update old-edition behavior of feature gates #136093
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e24833a
add test revisions for old-edition behavior of feature gates
dianne 3e77657
remove old edition-2021-specific tests
dianne 8dc64a4
"classic2021" and "structural2021" rulesets: add eat-inherited-ref-al…
dianne 443c51d
"structural2021" ruleset: add fallback-to-outer (eat both) deref rule
dianne 1ed74aa
add mixed-edition tests
dianne 2c595d6
update unstable book
dianne 799e0f7
add FIXMEs for diagnostic improvements
dianne 2014962
"classic2021" ruleset: experimentally add fallback-to-outer (eat both)
dianne 37bcc1c
clarify wording on doc comment
dianne 0e758c4
rename `consider_inherited_ref_first` -> `consider_inherited_ref`
dianne 0a15bfb
simplify fallback-to-outer condition on old editions
dianne 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
48 changes: 48 additions & 0 deletions
48
...ui/pattern/rfc-3627-match-ergonomics-2024/experimental/auxiliary/mixed-editions-macros.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//@[classic2021] edition: 2024 | ||
//@[structural2021] edition: 2024 | ||
//@[classic2024] edition: 2021 | ||
//@[structural2024] edition: 2021 | ||
//! This contains macros in an edition *different* to the one used in `../mixed-editions.rs`, in | ||
//! order to test typing mixed-edition patterns. | ||
|
||
#[macro_export] | ||
macro_rules! match_ctor { | ||
($p:pat) => { | ||
[$p] | ||
}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! match_ref { | ||
($p:pat) => { | ||
&$p | ||
}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! bind { | ||
($i:ident) => { | ||
$i | ||
} | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! bind_ref { | ||
($i:ident) => { | ||
ref $i | ||
} | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! bind_mut { | ||
($i:ident) => { | ||
mut $i | ||
} | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! bind_ref_mut { | ||
($i:ident) => { | ||
ref mut $i | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2021.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,37 @@ | ||
error[E0507]: cannot move out of a shared reference | ||
--> $DIR/borrowck-errors.rs:31:29 | ||
| | ||
LL | if let Some(&Some(x)) = Some(&Some(&mut 0)) { | ||
| - ^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| data moved here | ||
| move occurs because `x` has type `&mut u32`, which does not implement the `Copy` trait | ||
| | ||
help: consider removing the borrow | ||
| | ||
LL - if let Some(&Some(x)) = Some(&Some(&mut 0)) { | ||
LL + if let Some(Some(x)) = Some(&Some(&mut 0)) { | ||
| | ||
|
||
error[E0596]: cannot borrow data in a `&` reference as mutable | ||
--> $DIR/borrowck-errors.rs:36:10 | ||
| | ||
LL | let &ref mut x = &0; | ||
| ^^^^^^^^^ cannot borrow as mutable | ||
|
||
error[E0596]: cannot borrow data in a `&` reference as mutable | ||
--> $DIR/borrowck-errors.rs:41:23 | ||
| | ||
LL | if let &Some(Some(x)) = &Some(&mut Some(0)) { | ||
| ^ cannot borrow as mutable | ||
|
||
error[E0596]: cannot borrow data in a `&` reference as mutable | ||
--> $DIR/borrowck-errors.rs:46:11 | ||
| | ||
LL | let &[x] = &&mut [0]; | ||
| ^ cannot borrow as mutable | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0507, E0596. | ||
For more information about an error, try `rustc --explain E0507`. |
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
Oops, something went wrong.
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.