]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #71331 - Dylan-DPC:rollup-5rn1isc, r=Dylan-DPC
authorbors <bors@rust-lang.org>
Sun, 19 Apr 2020 19:53:42 +0000 (19:53 +0000)
committerbors <bors@rust-lang.org>
Sun, 19 Apr 2020 19:53:42 +0000 (19:53 +0000)
Rollup of 4 pull requests

Successful merges:

 - #71026 (Fix false "never constructed" warnings for `Self::` variant paths)
 - #71310 (Do not show DefId in diagnostics)
 - #71317 (miri-unleash test for llvm_asm)
 - #71324 (Fix some tests failing in `--pass check` mode)

Failed merges:

r? @ghost

1  2 
src/librustc_middle/ty/print/pretty.rs
src/librustc_passes/dead.rs

index 84360b90470b7719d976dcdfec518aa550b4fe85,cff4719cc8c030df1ea3968a5fb9dc4e2a1613d2..3bf067ebf1fe2aa3433747340d4a8faa0fe2f8fa
@@@ -639,9 -639,7 +639,7 @@@ pub trait PrettyPrinter<'tcx>
                          }
                      }
                  } else {
-                     // Cross-crate closure types should only be
-                     // visible in codegen bug reports, I imagine.
-                     p!(write("@{:?}", did));
+                     p!(write("@{}", self.tcx().def_path_str(did)));
  
                      if substs.as_generator().is_valid() {
                          let upvar_tys = substs.as_generator().upvar_tys();
                          }
                      }
                  } else {
-                     // Cross-crate closure types should only be
-                     // visible in codegen bug reports, I imagine.
-                     p!(write("@{:?}", did));
+                     p!(write("@{}", self.tcx().def_path_str(did)));
  
                      if substs.as_closure().is_valid() {
                          let upvar_tys = substs.as_closure().upvar_tys();
                      p!(write("::{:?}", promoted));
                  } else {
                      match self.tcx().def_kind(did) {
 -                        Some(DefKind::Static)
 -                        | Some(DefKind::Const)
 -                        | Some(DefKind::AssocConst) => p!(print_value_path(did, substs)),
 +                        Some(DefKind::Static | DefKind::Const | DefKind::AssocConst) => {
 +                            p!(print_value_path(did, substs))
 +                        }
                          _ => {
                              if did.is_local() {
                                  let span = self.tcx().def_span(did);
index e3dd4ddee06ca3985930abf8209e1874848488f5,ac1f3847d964c9910778311656e207610420cb03..c07087db607cccde2dfa820202a1ffc26471b8e9
@@@ -24,15 -24,13 +24,15 @@@ use rustc_span::symbol::sym
  // may need to be marked as live.
  fn should_explore(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
      match tcx.hir().find(hir_id) {
 -        Some(Node::Item(..))
 -        | Some(Node::ImplItem(..))
 -        | Some(Node::ForeignItem(..))
 -        | Some(Node::TraitItem(..))
 -        | Some(Node::Variant(..))
 -        | Some(Node::AnonConst(..))
 -        | Some(Node::Pat(..)) => true,
 +        Some(
 +            Node::Item(..)
 +            | Node::ImplItem(..)
 +            | Node::ForeignItem(..)
 +            | Node::TraitItem(..)
 +            | Node::Variant(..)
 +            | Node::AnonConst(..)
 +            | Node::Pat(..),
 +        ) => true,
          _ => false,
      }
  }
@@@ -69,7 -67,9 +69,7 @@@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 't
  
      fn handle_res(&mut self, res: Res) {
          match res {
 -            Res::Def(DefKind::Const, _)
 -            | Res::Def(DefKind::AssocConst, _)
 -            | Res::Def(DefKind::TyAlias, _) => {
 +            Res::Def(DefKind::Const | DefKind::AssocConst | DefKind::TyAlias, _) => {
                  self.check_def_id(res.def_id());
              }
              _ if self.in_pat => {}
@@@ -255,7 -255,9 +255,9 @@@ impl<'a, 'tcx> Visitor<'tcx> for MarkSy
              hir::ExprKind::Field(ref lhs, ..) => {
                  self.handle_field_access(&lhs, expr.hir_id);
              }
-             hir::ExprKind::Struct(_, ref fields, _) => {
+             hir::ExprKind::Struct(ref qpath, ref fields, _) => {
+                 let res = self.tables.qpath_res(qpath, expr.hir_id);
+                 self.handle_res(res);
                  if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).kind {
                      self.mark_as_used_if_union(adt, fields);
                  }