Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 42053f9

Browse files
committedNov 26, 2018
Auto merge of #56240 - nikomatsakis:beta, r=pietroalbini
beta backports Backported PRs: - [x] Avoid panic when matching function call #55742 - [x] [beta] resolve: Implement edition hygiene for imports and absolute paths #56053 r? @ghost cc @rust-lang/release
2 parents 1a4f1f3 + 51ef55b commit 42053f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+678
-546
lines changed
 

‎src/librustc/ty/context.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,15 +1484,8 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
14841484
/// done with either: `-Ztwo-phase-borrows`, `#![feature(nll)]`,
14851485
/// or by opting into an edition after 2015.
14861486
pub fn two_phase_borrows(self) -> bool {
1487-
if self.features().nll || self.sess.opts.debugging_opts.two_phase_borrows {
1488-
return true;
1489-
}
1490-
1491-
match self.sess.edition() {
1492-
Edition::Edition2015 => false,
1493-
Edition::Edition2018 => true,
1494-
_ => true,
1495-
}
1487+
self.sess.rust_2018() || self.features().nll ||
1488+
self.sess.opts.debugging_opts.two_phase_borrows
14961489
}
14971490

14981491
/// What mode(s) of borrowck should we run? AST? MIR? both?

‎src/librustc/ty/item_path.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use ty::{self, DefIdTree, Ty, TyCtxt};
1414
use middle::cstore::{ExternCrate, ExternCrateSource};
1515
use syntax::ast;
1616
use syntax::symbol::{keywords, LocalInternedString, Symbol};
17-
use syntax_pos::edition::Edition;
1817

1918
use std::cell::Cell;
2019
use std::fmt::Debug;
@@ -140,7 +139,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
140139
debug!("push_krate_path: name={:?}", name);
141140
buffer.push(&name);
142141
}
143-
} else if self.sess.edition() == Edition::Edition2018 && !pushed_prelude_crate {
142+
} else if self.sess.rust_2018() && !pushed_prelude_crate {
144143
SHOULD_PREFIX_WITH_CRATE.with(|flag| {
145144
// We only add the `crate::` keyword where appropriate. In particular,
146145
// when we've not previously pushed a prelude crate to this path.

0 commit comments

Comments
 (0)
Please sign in to comment.