-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
start attempt to rustup to https://github.com/rust-lang/rust/pull/60462 #4060
Conversation
@@ -247,7 +247,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { | |||
if_chain! { | |||
if args.is_empty(); | |||
if let ExprKind::Path(qpath) = &callee.node; | |||
let def = self.tables.qpath_def(qpath, callee.hir_id); | |||
let def = self.tables.qpath_res(qpath, callee.hir_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also rename variables from def
to res
.
@@ -322,9 +322,9 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { | |||
fn fetch_path(&mut self, qpath: &QPath, id: HirId) -> Option<Constant> { | |||
use rustc::mir::interpret::GlobalId; | |||
|
|||
let def = self.tables.qpath_def(qpath, id); | |||
let def = self.tables.qpath_res(qpath, id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -2380,13 +2380,13 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> { | |||
if_chain! { | |||
if let ExprKind::Path(ref qpath) = ex.node; | |||
if let QPath::Resolved(None, _) = *qpath; | |||
let def = self.cx.tables.qpath_def(qpath, ex.hir_id); | |||
let def = self.cx.tables.qpath_res(qpath, ex.hir_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -600,9 +601,9 @@ fn in_attributes_expansion(expr: &Expr) -> bool { | |||
} | |||
|
|||
/// Tests whether `def` is a variable defined outside a macro. | |||
fn non_macro_local(cx: &LateContext<'_, '_>, def: &def::Def) -> bool { | |||
fn non_macro_local(cx: &LateContext<'_, '_>, def: &def::DefKind) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably wants to be res: def::Res
(also update the comment).
Oh, and, small nit: there's no need to pass any of these values by reference.
@@ -70,9 +70,9 @@ fn has_no_effect(cx: &LateContext<'_, '_>, expr: &Expr) -> bool { | |||
}, | |||
ExprKind::Call(ref callee, ref args) => { | |||
if let ExprKind::Path(ref qpath) = callee.node { | |||
let def = cx.tables.qpath_def(qpath, callee.hir_id); | |||
let def = cx.tables.qpath_res(qpath, callee.hir_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -153,9 +153,9 @@ fn reduce_expression<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr) -> Option<Vec | |||
}, | |||
ExprKind::Call(ref callee, ref args) => { | |||
if let ExprKind::Path(ref qpath) = callee.node { | |||
let def = cx.tables.qpath_def(qpath, callee.hir_id); | |||
let def = cx.tables.qpath_res(qpath, callee.hir_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -213,7 +213,7 @@ pub fn match_path_ast(path: &ast::Path, segments: &[&str]) -> bool { | |||
} | |||
|
|||
/// Gets the definition associated to a path. | |||
pub fn path_to_def(cx: &LateContext<'_, '_>, path: &[&str]) -> Option<def::Def> { | |||
pub fn path_to_def(cx: &LateContext<'_, '_>, path: &[&str]) -> Option<(def::Res)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path_to_res
Moved to #4061 . You should have push access. Also addressed eddyb's nits. |
Rustup to rustc 1.36.0-nightly (13fde05 2019-05-03) Trying to deal with changes from rust-lang/rust#60462 Moved from #4060 so everyone can collab on the rustup branch.
I am probably too tired to continue working on this right now, in case anyone else wants to pick this up, I put my current progress out there.
This is an attempt to rustup to rust-lang/rust#60462
changelog: none