Fix rebase fallout
This commit is contained in:
parent
52fa900d62
commit
fa459a08e1
|
@ -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) {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue