start attempt to rustup to https://github.com/rust-lang/rust/pull/60462#4060
Closed
matthiaskrgr wants to merge 1 commit intorust-lang:masterfrom
Closed
start attempt to rustup to https://github.com/rust-lang/rust/pull/60462#4060matthiaskrgr wants to merge 1 commit intorust-lang:masterfrom
matthiaskrgr wants to merge 1 commit intorust-lang:masterfrom
Conversation
eddyb
reviewed
May 4, 2019
| 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); |
Member
There was a problem hiding this comment.
Also rename variables from def to res.
eddyb
reviewed
May 4, 2019
| use rustc::mir::interpret::GlobalId; | ||
|
|
||
| let def = self.tables.qpath_def(qpath, id); | ||
| let def = self.tables.qpath_res(qpath, id); |
eddyb
reviewed
May 4, 2019
| 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); |
eddyb
reviewed
May 4, 2019
|
|
||
| /// 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 { |
Member
There was a problem hiding this comment.
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.
eddyb
reviewed
May 4, 2019
| 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); |
eddyb
reviewed
May 4, 2019
| 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); |
eddyb
reviewed
May 4, 2019
|
|
||
| /// 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)> { |
Member
|
Moved to #4061 . You should have push access. Also addressed eddyb's nits. |
bors
added a commit
that referenced
this pull request
May 4, 2019
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.
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.
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