mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-07 23:47:39 +00:00
Fix missing match arms
This commit is contained in:
parent
f43edb2151
commit
a838a60caa
@ -1903,7 +1903,9 @@ impl Type {
|
|||||||
| TyKind::Dyn(_)
|
| TyKind::Dyn(_)
|
||||||
| TyKind::Function(_)
|
| TyKind::Function(_)
|
||||||
| TyKind::Alias(_)
|
| TyKind::Alias(_)
|
||||||
| TyKind::Foreign(_) => false,
|
| TyKind::Foreign(_)
|
||||||
|
| TyKind::Generator(..)
|
||||||
|
| TyKind::GeneratorWitness(..) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,6 +287,8 @@ impl HirDisplay for GenericArg {
|
|||||||
fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
||||||
match self.interned() {
|
match self.interned() {
|
||||||
crate::GenericArgData::Ty(ty) => ty.hir_fmt(f),
|
crate::GenericArgData::Ty(ty) => ty.hir_fmt(f),
|
||||||
|
crate::GenericArgData::Lifetime(lt) => lt.hir_fmt(f),
|
||||||
|
crate::GenericArgData::Const(c) => c.hir_fmt(f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -664,6 +666,8 @@ impl HirDisplay for Ty {
|
|||||||
write!(f, "{{unknown}}")?;
|
write!(f, "{{unknown}}")?;
|
||||||
}
|
}
|
||||||
TyKind::InferenceVar(..) => write!(f, "_")?,
|
TyKind::InferenceVar(..) => write!(f, "_")?,
|
||||||
|
TyKind::Generator(..) => write!(f, "{{generator}}")?,
|
||||||
|
TyKind::GeneratorWitness(..) => write!(f, "{{generator witness}}")?,
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -741,7 +745,7 @@ fn write_bounds_like_dyn_trait(
|
|||||||
if !first {
|
if !first {
|
||||||
write!(f, " + ")?;
|
write!(f, " + ")?;
|
||||||
}
|
}
|
||||||
// We assume that the self type is $0 (i.e. the
|
// We assume that the self type is ^0.0 (i.e. the
|
||||||
// existential) here, which is the only thing that's
|
// existential) here, which is the only thing that's
|
||||||
// possible in actual Rust, and hence don't print it
|
// possible in actual Rust, and hence don't print it
|
||||||
write!(f, "{}", f.db.trait_data(trait_).name)?;
|
write!(f, "{}", f.db.trait_data(trait_).name)?;
|
||||||
@ -783,6 +787,10 @@ fn write_bounds_like_dyn_trait(
|
|||||||
}
|
}
|
||||||
ty.hir_fmt(f)?;
|
ty.hir_fmt(f)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME implement these
|
||||||
|
WhereClause::LifetimeOutlives(_) => {}
|
||||||
|
WhereClause::TypeOutlives(_) => {}
|
||||||
}
|
}
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
@ -837,6 +845,10 @@ impl HirDisplay for WhereClause {
|
|||||||
ty.hir_fmt(f)?;
|
ty.hir_fmt(f)?;
|
||||||
}
|
}
|
||||||
WhereClause::AliasEq(_) => write!(f, "{{error}}")?,
|
WhereClause::AliasEq(_) => write!(f, "{{error}}")?,
|
||||||
|
|
||||||
|
// FIXME implement these
|
||||||
|
WhereClause::TypeOutlives(..) => {}
|
||||||
|
WhereClause::LifetimeOutlives(..) => {}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -881,9 +893,11 @@ impl HirDisplay for DomainGoal {
|
|||||||
DomainGoal::Holds(wc) => {
|
DomainGoal::Holds(wc) => {
|
||||||
write!(f, "Holds(")?;
|
write!(f, "Holds(")?;
|
||||||
wc.hir_fmt(f)?;
|
wc.hir_fmt(f)?;
|
||||||
write!(f, ")")
|
write!(f, ")")?;
|
||||||
}
|
}
|
||||||
|
_ => write!(f, "?")?,
|
||||||
}
|
}
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ impl<'a, 'b> Canonicalizer<'a, 'b> {
|
|||||||
DomainGoal::Holds(wc) => {
|
DomainGoal::Holds(wc) => {
|
||||||
DomainGoal::Holds(self.do_canonicalize(wc, DebruijnIndex::INNERMOST))
|
DomainGoal::Holds(self.do_canonicalize(wc, DebruijnIndex::INNERMOST))
|
||||||
}
|
}
|
||||||
|
_ => unimplemented!(),
|
||||||
};
|
};
|
||||||
self.into_canonicalized(InEnvironment { goal: result, environment: obligation.environment })
|
self.into_canonicalized(InEnvironment { goal: result, environment: obligation.environment })
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ pub(crate) fn trait_solve_query(
|
|||||||
db.trait_data(it.hir_trait_id()).name.to_string()
|
db.trait_data(it.hir_trait_id()).name.to_string()
|
||||||
}
|
}
|
||||||
DomainGoal::Holds(WhereClause::AliasEq(_)) => "alias_eq".to_string(),
|
DomainGoal::Holds(WhereClause::AliasEq(_)) => "alias_eq".to_string(),
|
||||||
|
_ => "??".to_string(),
|
||||||
});
|
});
|
||||||
log::info!("trait_solve_query({})", goal.value.goal.display(db));
|
log::info!("trait_solve_query({})", goal.value.goal.display(db));
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ impl TypeWalk for GenericArg {
|
|||||||
GenericArgData::Ty(ty) => {
|
GenericArgData::Ty(ty) => {
|
||||||
ty.walk(f);
|
ty.walk(f);
|
||||||
}
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,6 +123,7 @@ impl TypeWalk for WhereClause {
|
|||||||
match self {
|
match self {
|
||||||
WhereClause::Implemented(trait_ref) => trait_ref.walk(f),
|
WhereClause::Implemented(trait_ref) => trait_ref.walk(f),
|
||||||
WhereClause::AliasEq(alias_eq) => alias_eq.walk(f),
|
WhereClause::AliasEq(alias_eq) => alias_eq.walk(f),
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user