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

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

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@petrochenkov
Copy link
Contributor

petrochenkov commented Feb 10, 2019

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

@Centril
Copy link
Contributor

Centril left a comment

lgtm, assigning over to double check...

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment