about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/ty/print/pretty.rs10
-rw-r--r--src/librustc_mir/monomorphize/item.rs2
-rw-r--r--src/test/ui/const-generics/cannot-infer-const-args.stderr2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc/ty/print/pretty.rs
index 53a5de689d8..d8150c1895b 100644
--- a/src/librustc/ty/print/pretty.rs
+++ b/src/librustc/ty/print/pretty.rs
@@ -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 @@ pub trait PrettyPrinter<'gcx: 'tcx, 'tcx>:
             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) {
diff --git a/src/librustc_mir/monomorphize/item.rs b/src/librustc_mir/monomorphize/item.rs
index 6b40245d39a..8b44f148fac 100644
--- a/src/librustc_mir/monomorphize/item.rs
+++ b/src/librustc_mir/monomorphize/item.rs
@@ -401,7 +401,7 @@ impl<'a, 'tcx> DefPathBasedNames<'a, 'tcx> {
     // 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()
             }
diff --git a/src/test/ui/const-generics/cannot-infer-const-args.stderr b/src/test/ui/const-generics/cannot-infer-const-args.stderr
index 5528c2fca6a..544cd05cdbe 100644
--- a/src/test/ui/const-generics/cannot-infer-const-args.stderr
+++ b/src/test/ui/const-generics/cannot-infer-const-args.stderr
@@ -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