mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Fix rebase fallout
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user