-
Notifications
You must be signed in to change notification settings - Fork 889
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
Add style_edition 2027 #6324
Add style_edition 2027 #6324
Conversation
src/config/options.rs
Outdated
@@ -458,6 +462,8 @@ impl From<Edition> for rustc_span::edition::Edition { | |||
Edition::Edition2018 => Self::Edition2018, | |||
Edition::Edition2021 => Self::Edition2021, | |||
Edition::Edition2024 => Self::Edition2024, | |||
// TODO: update to 2027 after rustc change | |||
Edition::Edition2027 => Self::Edition2024, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@calebcartwright rustc_span::edition::Edition doesn't have Edition2027 yet, how should we solve this problem
@@ -30,7 +30,8 @@ macro_rules! style_edition_default { | |||
$crate::config::StyleEdition::Edition2015 | |||
| $crate::config::StyleEdition::Edition2018 | |||
| $crate::config::StyleEdition::Edition2021 => $default_2015, | |||
$crate::config::StyleEdition::Edition2024 => $default_2024, | |||
$crate::config::StyleEdition::Edition2024 | |||
| $crate::config::StyleEdition::Edition2027 => $default_2024, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edition2024 default will also extend to 2027. Is this the desired behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I think that's fine since we don't currently have plans to change any default option values for 2027
, but it would be nice to add a TODO comment explaining that we'll need to update the macro once we need to start changing defaults for 2027.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnhuichen want to remind you about the ask to add a comment here.
@johnhuichen Thanks for getting the ball rolling on this one. I think it would be best to keep this PR focused on just |
Sounds good, I can take another look |
@ytmimi I am a little tied up for the next couple of weeks, and won't be able to make too much progress with rustfmt. Let me know if the delay is alright with you, or if it's better if I unassigned myself from the tasks |
Thanks for the heads up! I don't think it should be an issue, but if the urgency around this changes we can open an alternative PR or build off of what you've got here. |
Also, just a small note: The team discourages merge commits so in the future please rebase your changes when getting your branch up to date. |
4dbeea4
to
0b0dbe8
Compare
@ytmimi I removed Edition::Edition2027 everywhere. Let me know if there is any other code changes where I need to make to add StylEdition2027 fyi: I am keeping intermediate commits so it's easier for you to see what changes I made since last time. Before merging I will rebase everything to 1 commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things looks good. Just want to add comments to the various places where 2027
defaults to 2024
.
@@ -523,6 +528,7 @@ impl From<StyleEdition> for rustc_span::edition::Edition { | |||
StyleEdition::Edition2018 => Self::Edition2018, | |||
StyleEdition::Edition2021 => Self::Edition2021, | |||
StyleEdition::Edition2024 => Self::Edition2024, | |||
StyleEdition::Edition2027 => Self::Edition2024, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a TODO comment here explaining that rustc_span::edition::Edition
doesn't have an Edition2027
variant.
@@ -30,7 +30,8 @@ macro_rules! style_edition_default { | |||
$crate::config::StyleEdition::Edition2015 | |||
| $crate::config::StyleEdition::Edition2018 | |||
| $crate::config::StyleEdition::Edition2021 => $default_2015, | |||
$crate::config::StyleEdition::Edition2024 => $default_2024, | |||
$crate::config::StyleEdition::Edition2024 | |||
| $crate::config::StyleEdition::Edition2027 => $default_2024, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnhuichen want to remind you about the ask to add a comment here.
2078ea8
to
fd6b892
Compare
I just added comments as requested |
fd6b892
to
c9fd22e
Compare
No description provided.