Fix rebase fallout

This commit is contained in:
Oliver Scherer 2019-05-07 17:47:52 +02:00
parent 52fa900d62
commit fa459a08e1
3 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
use crate::hir; use crate::hir;
use crate::hir::def::{Namespace, Def}; use crate::hir::def::{Namespace, DefKind};
use crate::hir::map::{DefPathData, DisambiguatedDefPathData}; use crate::hir::map::{DefPathData, DisambiguatedDefPathData};
use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::middle::cstore::{ExternCrate, ExternCrateSource}; use crate::middle::cstore::{ExternCrate, ExternCrateSource};
@ -820,10 +820,10 @@ pub trait PrettyPrinter<'gcx: 'tcx, 'tcx>:
return Ok(self); return Ok(self);
} }
if let ConstValue::Unevaluated(did, substs) = ct.val { if let ConstValue::Unevaluated(did, substs) = ct.val {
match self.tcx().describe_def(did) { match self.tcx().def_kind(did) {
| Some(Def::Static(_)) | Some(DefKind::Static)
| Some(Def::Const(_)) | Some(DefKind::Const)
| Some(Def::AssociatedConst(_)) => p!(print_value_path(did, substs)), | Some(DefKind::AssociatedConst) => p!(print_value_path(did, substs)),
_ => if did.is_local() { _ => if did.is_local() {
let span = self.tcx().def_span(did); let span = self.tcx().def_span(did);
if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) { if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) {

View File

@ -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). // 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) { pub fn push_const_name(&self, c: &Const<'tcx>, output: &mut String, debug: bool) {
match c.val { 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. // FIXME(const_generics): we could probably do a better job here.
write!(output, "{:?}", c).unwrap() write!(output, "{:?}", c).unwrap()
} }

View File

@ -8,7 +8,7 @@ error[E0282]: type annotations needed
--> $DIR/cannot-infer-const-args.rs:9:5 --> $DIR/cannot-infer-const-args.rs:9:5
| |
LL | foo(); LL | foo();
| ^^^ cannot infer type for `fn() -> usize {foo::<_>}` | ^^^ cannot infer type for `fn() -> usize {foo::<_: usize>}`
error: aborting due to previous error error: aborting due to previous error