Skip to content
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

Point out that behavior might be switched on 2015 and 2018 too one day #84590

Merged
merged 3 commits into from
Apr 30, 2021

Conversation

est31
Copy link
Member

@est31 est31 commented Apr 26, 2021

Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't have to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.

cc #25725, #65819, #66145, #84147 , and #84133 (comment)

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2021
@est31
Copy link
Member Author

est31 commented Apr 26, 2021

@cuviper
Copy link
Member

cuviper commented Apr 26, 2021

That clarification seems good to me.

Somewhat aside, you changed "behavior" to "behaviour" -- I don't know if we have an official position for the project documentation, but the US spelling is far more common throughout the repo.

@est31 est31 force-pushed the array_into_iter branch from 945ad3d to 162206c Compare April 26, 2021 18:47
@est31
Copy link
Member Author

est31 commented Apr 26, 2021

the US spelling is far more common throughout the repo.

Hmmm you're right, indeed it is:

$ rg "behaviour" {library,compiler}/ | wc -l ; rg "behavior" {library,compiler}/ | wc -l
42
490

I've changed it to US spelling.

Also btw., if you check the summary comment of the August 2020 crater run, it lists the following major regression causing crates: colored, lazy_static, jpeg-decoder, ring. Interestingly, only ring has versions at all that use edition 2018, the other crates in that list all use edition 2015 for their latest versions, so I assume this includes the offending versions too. ring has switched to edition 2018 starting with 0.14.0, which means most of its breakage causing versions are on edition 2018.

@cuviper
Copy link
Member

cuviper commented Apr 26, 2021

Also btw., if you check the summary comment of the August 2020 crater run, it lists the following major regression causing crates: colored, lazy_static, jpeg-decoder, ring. Interestingly, only ring has versions at all that use edition 2018, the other crates in that list all use edition 2015 for their latest versions, so I assume this includes the offending versions too. ring has switched to edition 2018 starting with 0.14.0, which means most of its breakage causing versions are on edition 2018.

Are you suggesting that we might want to migrate one edition without the other? If so, I think the only reason to force this at all would be to get rid of the attribute hack entirely, i.e. all or nothing.

@est31 est31 changed the title Point out that behaviour might be switched on 2015 and 2018 too one day Point out that behavior might be switched on 2015 and 2018 too one day Apr 26, 2021
@est31 est31 force-pushed the array_into_iter branch from 162206c to 5bd3187 Compare April 26, 2021 19:02
@est31
Copy link
Member Author

est31 commented Apr 26, 2021

Are you suggesting that we might want to migrate one edition without the other?

I don't really know. I mainly shared this because I found it interesting. If there is a difference between 2015 and 2018 then it should only be in timing, for the reason you stated. Right now, I think it's better to perform this change as part of edition 2021 so that people can deliberately opt into the breakage. What one should do with 2015 and 2018 can be decided at a later point in time. I don't really want to turn this thread into a discussion about when to migrate edition 2015 and 2018.... maybe I shouldn't have shared that observation, my fault sorry... The point of this PR to explicitly leave the option open, nothing more nothing less.

@cuviper
Copy link
Member

cuviper commented Apr 27, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 27, 2021

📌 Commit 5bd3187 has been approved by cuviper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 27, 2021
@nikomatsakis
Copy link
Contributor

@bors r-

I'm not sure about this.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 27, 2021
@nikomatsakis
Copy link
Contributor

Let me explain:

I'm trying to decide what actionable thing we want people to based on this. I guess we're saying that we don't want them to use .foo() methods on older editions, because we might break them, and they should instead code against IntoIter::into_iter directly or something?

I think it would be good to spell out the advice.

@est31 est31 force-pushed the array_into_iter branch from fe697c8 to 1d4b78d Compare April 27, 2021 23:39
@est31
Copy link
Member Author

est31 commented Apr 27, 2021

@nikomatsakis I've added a paragraph to the document. If I'm reading #84513 correctly it's also the plan to change the array_into_iter lint to make such suggestions as well.

@est31 est31 force-pushed the array_into_iter branch from 1d4b78d to 12642d9 Compare April 27, 2021 23:42
jackh726 added a commit to jackh726/rust that referenced this pull request Apr 28, 2021
Point out that behavior might be switched on 2015 and 2018 too one day

Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.

cc rust-lang#25725, rust-lang#65819, rust-lang#66145, rust-lang#84147 , and rust-lang#84133 (comment)
@jackh726
Copy link
Member

I think this failed in #84675

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2021
@cuviper
Copy link
Member

cuviper commented Apr 29, 2021

Same issue as #84147 (comment), which I fixed for my test case in commit f6a90ca.

On bootstrap the IntoIterator trait is not implemented
yet for arrays.
@cuviper
Copy link
Member

cuviper commented Apr 29, 2021

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 29, 2021

📌 Commit a352336 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2021
@nikomatsakis
Copy link
Contributor

@bors rollup

jackh726 added a commit to jackh726/rust that referenced this pull request Apr 29, 2021
Point out that behavior might be switched on 2015 and 2018 too one day

Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.

cc rust-lang#25725, rust-lang#65819, rust-lang#66145, rust-lang#84147 , and rust-lang#84133 (comment)
jackh726 added a commit to jackh726/rust that referenced this pull request Apr 29, 2021
Point out that behavior might be switched on 2015 and 2018 too one day

Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.

cc rust-lang#25725, rust-lang#65819, rust-lang#66145, rust-lang#84147 , and rust-lang#84133 (comment)
jackh726 added a commit to jackh726/rust that referenced this pull request Apr 29, 2021
Point out that behavior might be switched on 2015 and 2018 too one day

Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.

cc rust-lang#25725, rust-lang#65819, rust-lang#66145, rust-lang#84147 , and rust-lang#84133 (comment)
jackh726 added a commit to jackh726/rust that referenced this pull request Apr 29, 2021
Point out that behavior might be switched on 2015 and 2018 too one day

Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.

cc rust-lang#25725, rust-lang#65819, rust-lang#66145, rust-lang#84147 , and rust-lang#84133 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#84451 (Use flex more consistently)
 - rust-lang#84590 (Point out that behavior might be switched on 2015 and 2018 too one day)
 - rust-lang#84682 (Don't rebind in `transitive_bounds_that_define_assoc_type`)
 - rust-lang#84683 (Minor grammar tweaks for readability to btree internals)
 - rust-lang#84688 (Remove unnecessary CSS rules for search results)
 - rust-lang#84690 (Remove unneeded bottom margin on search results)
 - rust-lang#84692 (Link between std::env::{var, var_os} and std::env::{vars, vars_os})
 - rust-lang#84705 (make feature recommendations optional)
 - rust-lang#84706 (Drop alias `reduce` for `fold` - we have a `reduce` function)
 - rust-lang#84713 (Fix labels for regression issue template)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e720df6 into rust-lang:master Apr 30, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants