Skip to content

resolve: Simplify import resolution for mixed 2015/2018 edition mode - #58349

Merged
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:uni201x
Mar 13, 2019
Merged

resolve: Simplify import resolution for mixed 2015/2018 edition mode#58349
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:uni201x

Conversation

@petrochenkov

Copy link
Copy Markdown
Contributor

Non-controversial part of #57745.

Before:

Local edition (per-span)Global edition (--edition)Imports (use foo;)Absolute paths (::foo)
2018AnyUniformExtern prelude
20152015Crate-relativeCrate-relative
20152018Crate-relative with fallback to Uniform (future-proofed to error if the result is not Crate-relative or from Extern prelude)Crate-relative with fallback to Extern prelude

After:

Local edition (per-span)Global edition (--edition)Imports (use foo;)Absolute paths (::foo)
2018AnyUniformExtern prelude
20152015Crate-relativeCrate-relative
20152018Crate-relative with fallback to Extern preludeCrate-relative with fallback to Extern prelude

I.e. only the behavior of the mixed local-2015-global-2018 mode is changed.
This mixed mode has two goals:

(I'll hopefully proceed with #57745 after mid-February.)

r? @Centril

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2019

@CentrilCentril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, assigning over to double check...

@Centril

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

@nikomatsakis

Copy link
Copy Markdown
Contributor

r? @pnkfelix -- sorry @petrochenkov for being slow. I've been pretty overloaded so I'm moving the review over to @pnkfelix who hopefully has a bit more time!

@Dylan-DPC-zz

Copy link
Copy Markdown

ping from triage @pnkfelix waiting for your review on this

@bors

bors commented Mar 12, 2019

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #59044) made this pull request unmergeable. Please resolve the merge conflicts.

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

This is now blocking another PR - #58805.

@pnkfelix

Copy link
Copy Markdown
Contributor

r=me assuming merge conflict is trivial to resolve.

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

@bors r=pnkfelix

@bors

bors commented Mar 12, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 1d6f4d6 has been approved by pnkfelix

@borsbors 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 Mar 12, 2019
@bors

bors commented Mar 13, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1d6f4d6 with merge 8bf1f1c...

bors added a commit that referenced this pull request Mar 13, 2019
resolve: Simplify import resolution for mixed 2015/2018 edition mode
Non-controversial part of #57745.
Before:
| Local edition (per-span) | Global edition (--edition) | Imports (`use foo;`) | Absolute paths (`::foo`) |
| ------------- |----------------|-----------------------------------------|------------------------------------------------|
| 2018 | Any | Uniform | Extern prelude |
| 2015 | 2015 | Crate-relative | Crate-relative |
| 2015 | 2018 | Crate-relative with fallback to Uniform (future-proofed to error if the result is not Crate-relative or from Extern prelude) | Crate-relative with fallback to Extern prelude |
After:
| Local edition (per-span) | Global edition (--edition) | Imports (`use foo;`) | Absolute paths (`::foo`) |
| ------------- |----------------|-----------------------------------------|------------------------------------------------|
| 2018 | Any | Uniform | Extern prelude |
| 2015 | 2015 | Crate-relative | Crate-relative |
| 2015 | 2018 | Crate-relative with fallback to Extern prelude | Crate-relative with fallback to Extern prelude |
I.e. only the behavior of the mixed local-2015-global-2018 mode is changed.
This mixed mode has two goals:
- Address regressions from #56053 (comment).
Both "before" and "after" variants address those regressions.
- Be retrofit-able to "full 2015" edition (#57745).
Any more complex fallback scheme (with more candidates) than "Crate-relative with fallback to Extern prelude" will give more regressions than #57745 (comment) and is therefore less retrofit-able while also being, well, more complex.
So, we can settle on "Crate-relative with fallback to Extern prelude".
(I'll hopefully proceed with #57745 after mid-February.)
r? @Centril
@bors

bors commented Mar 13, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-travis, status-appveyor
Approved by: pnkfelix
Pushing 8bf1f1c to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Mar 13, 2019
@bors
bors merged commit 1d6f4d6 into rust-lang:masterMar 13, 2019
@petrochenkov
petrochenkov deleted the uni201x branch June 5, 2019 16:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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.

7 participants

@petrochenkov@Centril@nikomatsakis@Dylan-DPC-zz@bors@pnkfelix@rust-highfive