]> git.lizzy.rs Git - rust.git/commitdiff
Fix rebase fallout
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 7 May 2019 15:47:52 +0000 (17:47 +0200)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Sat, 25 May 2019 08:07:02 +0000 (10:07 +0200)
src/librustc/ty/print/pretty.rs
src/librustc_mir/monomorphize/item.rs
src/test/ui/const-generics/cannot-infer-const-args.stderr

index 53a5de689d85f4e1063bef2eb44ba4fae05e5cba..d8150c1895b9863f2eee6207e717887946b8af0a 100644 (file)
@@ -1,5 +1,5 @@
 use crate::hir;
-use crate::hir::def::{Namespace, Def};
+use crate::hir::def::{Namespace, DefKind};
 use crate::hir::map::{DefPathData, DisambiguatedDefPathData};
 use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
 use crate::middle::cstore::{ExternCrate, ExternCrateSource};
@@ -820,10 +820,10 @@ fn pretty_print_const(
             return Ok(self);
         }
         if let ConstValue::Unevaluated(did, substs) = ct.val {
-            match self.tcx().describe_def(did) {
-                | Some(Def::Static(_))
-                | Some(Def::Const(_))
-                | Some(Def::AssociatedConst(_)) => p!(print_value_path(did, substs)),
+            match self.tcx().def_kind(did) {
+                | Some(DefKind::Static)
+                | Some(DefKind::Const)
+                | Some(DefKind::AssociatedConst) => p!(print_value_path(did, substs)),
                 _ => if did.is_local() {
                     let span = self.tcx().def_span(did);
                     if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) {
index 6b40245d39a8eae5fb7c094cb85f3d8bd0d122d0..8b44f148facf6dd9608fbe88f8677a64bf08dfad 100644 (file)
@@ -401,7 +401,7 @@ pub fn push_type_name(&self, t: Ty<'tcx>, output: &mut String, debug: bool) {
     // as well as the unprintable types of constants (see `push_type_name` for more details).
     pub fn push_const_name(&self, c: &Const<'tcx>, output: &mut String, debug: bool) {
         match c.val {
-            ConstValue::Scalar(..) | ConstValue::Slice(..) | ConstValue::ByRef(..) => {
+            ConstValue::Scalar(..) | ConstValue::Slice { .. } | ConstValue::ByRef(..) => {
                 // FIXME(const_generics): we could probably do a better job here.
                 write!(output, "{:?}", c).unwrap()
             }
index 5528c2fca6a3ba43e3ddba53fc864af54b789953..544cd05cdbebf9cb7a40964eb2fbfb6b01c02ff9 100644 (file)
@@ -8,7 +8,7 @@ error[E0282]: type annotations needed
   --> $DIR/cannot-infer-const-args.rs:9:5
    |
 LL |     foo();
-   |     ^^^ cannot infer type for `fn() -> usize {foo::<_>}`
+   |     ^^^ cannot infer type for `fn() -> usize {foo::<_: usize>}`
 
 error: aborting due to previous error