Auto merge of #4215 - matthiaskrgr:rustup_9, r=flip1995

rustup https://github.com/rust-lang/rust/pull/61836/

changelog: none
This commit is contained in:
bors 2019-06-18 10:05:04 +00:00
commit 868f168c1c
9 changed files with 12 additions and 11 deletions

View File

@ -114,7 +114,7 @@ fn check_hash_peq<'a, 'tcx>(
cx, DERIVE_HASH_XOR_EQ, span, cx, DERIVE_HASH_XOR_EQ, span,
mess, mess,
|db| { |db| {
if let Some(node_id) = cx.tcx.hir().as_local_node_id(impl_id) { if let Some(node_id) = cx.tcx.hir().as_local_hir_id(impl_id) {
db.span_note( db.span_note(
cx.tcx.hir().span(node_id), cx.tcx.hir().span(node_id),
"`PartialEq` implemented here" "`PartialEq` implemented here"

View File

@ -32,7 +32,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
let map = cx.tcx.hir(); let map = cx.tcx.hir();
// only check top level `use` statements // only check top level `use` statements
for item in &m.item_ids { for item in &m.item_ids {
self.lint_item(cx, map.expect_item(map.hir_to_node_id(item.id))); self.lint_item(cx, map.expect_item(item.id));
} }
} }
} }

View File

@ -94,7 +94,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
span_lint( span_lint(
cx, cx,
BOXED_LOCAL, BOXED_LOCAL,
cx.tcx.hir().span_by_hir_id(node), cx.tcx.hir().span(node),
"local variable doesn't need to be boxed here", "local variable doesn't need to be boxed here",
); );
} }

View File

@ -346,7 +346,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
}, },
TyKind::Def(item, _) => { TyKind::Def(item, _) => {
let map = self.cx.tcx.hir(); let map = self.cx.tcx.hir();
if let ItemKind::Existential(ref exist_ty) = map.expect_item(map.hir_to_node_id(item.id)).node { if let ItemKind::Existential(ref exist_ty) = map.expect_item(item.id).node {
for bound in &exist_ty.bounds { for bound in &exist_ty.bounds {
if let GenericBound::Outlives(_) = *bound { if let GenericBound::Outlives(_) = *bound {
self.record(&None); self.record(&None);

View File

@ -947,7 +947,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
} }
let name = implitem.ident.name.as_str(); let name = implitem.ident.name.as_str();
let parent = cx.tcx.hir().get_parent_item(implitem.hir_id); let parent = cx.tcx.hir().get_parent_item(implitem.hir_id);
let item = cx.tcx.hir().expect_item_by_hir_id(parent); let item = cx.tcx.hir().expect_item(parent);
let def_id = cx.tcx.hir().local_def_id_from_hir_id(item.hir_id); let def_id = cx.tcx.hir().local_def_id_from_hir_id(item.hir_id);
let ty = cx.tcx.type_of(def_id); let ty = cx.tcx.type_of(def_id);
if_chain! { if_chain! {
@ -1070,7 +1070,7 @@ fn lint_or_fun_call<'a, 'tcx: 'a>(
if call_found { if call_found {
// don't lint for constant values // don't lint for constant values
let owner_def = self.cx.tcx.hir().get_parent_did_by_hir_id(expr.hir_id); let owner_def = self.cx.tcx.hir().get_parent_did(expr.hir_id);
let promotable = self let promotable = self
.cx .cx
.tcx .tcx

View File

@ -605,7 +605,7 @@ fn in_attributes_expansion(expr: &Expr) -> bool {
/// Tests whether `res` is a variable defined outside a macro. /// Tests whether `res` is a variable defined outside a macro.
fn non_macro_local(cx: &LateContext<'_, '_>, res: def::Res) -> bool { fn non_macro_local(cx: &LateContext<'_, '_>, res: def::Res) -> bool {
if let def::Res::Local(id) = res { if let def::Res::Local(id) = res {
!in_macro_or_desugar(cx.tcx.hir().span_by_hir_id(id)) !in_macro_or_desugar(cx.tcx.hir().span(id))
} else { } else {
false false
} }

View File

@ -146,8 +146,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
if let Some(self_def) = cx.tcx.type_of(self_did).ty_adt_def(); if let Some(self_def) = cx.tcx.type_of(self_did).ty_adt_def();
if self_def.did.is_local(); if self_def.did.is_local();
then { then {
let self_id = cx.tcx.hir().local_def_id_to_node_id(self_def.did.to_local()); let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_def.did.to_local());
if impling_types.contains(&self_id) { let node_id = cx.tcx.hir().hir_to_node_id(self_id);
if impling_types.contains(&node_id) {
return; return;
} }
} }

View File

@ -170,7 +170,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) { fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) {
if let ImplItemKind::Const(hir_ty, ..) = &impl_item.node { if let ImplItemKind::Const(hir_ty, ..) = &impl_item.node {
let item_hir_id = cx.tcx.hir().get_parent_node_by_hir_id(impl_item.hir_id); let item_hir_id = cx.tcx.hir().get_parent_node_by_hir_id(impl_item.hir_id);
let item = cx.tcx.hir().expect_item_by_hir_id(item_hir_id); let item = cx.tcx.hir().expect_item(item_hir_id);
// Ensure the impl is an inherent impl. // Ensure the impl is an inherent impl.
if let ItemKind::Impl(_, _, _, _, None, _, _) = item.node { if let ItemKind::Impl(_, _, _, _, None, _, _) = item.node {
let ty = hir_ty_to_ty(cx.tcx, hir_ty); let ty = hir_ty_to_ty(cx.tcx, hir_ty);

View File

@ -978,7 +978,7 @@ pub fn any_parent_is_automatically_derived(tcx: TyCtxt<'_>, node: HirId) -> bool
let mut prev_enclosing_node = None; let mut prev_enclosing_node = None;
let mut enclosing_node = node; let mut enclosing_node = node;
while Some(enclosing_node) != prev_enclosing_node { while Some(enclosing_node) != prev_enclosing_node {
if is_automatically_derived(map.attrs_by_hir_id(enclosing_node)) { if is_automatically_derived(map.attrs(enclosing_node)) {
return true; return true;
} }
prev_enclosing_node = Some(enclosing_node); prev_enclosing_node = Some(enclosing_node);