resolve: Simplify import resolution for mixed 2015/2018 edition mode#58349
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 13, 2019
Merged
resolve: Simplify import resolution for mixed 2015/2018 edition mode#58349bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Centril
approved these changes
Feb 11, 2019
Contributor
Centril
left a comment
There was a problem hiding this comment.
lgtm, assigning over to double check...
Contributor
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! |
|
ping from triage @pnkfelix waiting for your review on this |
This was referenced Mar 10, 2019
Collaborator
|
☔ The latest upstream changes (presumably #59044) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
Author
|
This is now blocking another PR - #58805. |
Contributor
|
r=me assuming merge conflict is trivial to resolve. |
Contributor
Author
|
@bors r=pnkfelix |
Collaborator
|
📌 Commit 1d6f4d6 has been approved by |
Collaborator
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
Collaborator
|
☀️ Test successful - checks-travis, status-appveyor |
29 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Non-controversial part of #57745.
Before:
use foo;)::foo)After:
use foo;)::foo)I.e. only the behavior of the mixed local-2015-global-2018 mode is changed.
This mixed mode has two goals:
Both "before" and "after" variants address those regressions.
Any more complex fallback scheme (with more candidates) than "Crate-relative with fallback to Extern prelude" will give more regressions than [WIP] resolve: Fallback to extern crates in absolute paths on 2015 edition #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