Store all generic bounds as where predicates.
This commit is contained in:
parent
05b29f9a92
commit
94449e6101
30 changed files with 770 additions and 953 deletions
|
@ -1267,13 +1267,11 @@ impl<'tcx> Visitor<'tcx> for DumpVisitor<'tcx> {
|
|||
match param.kind {
|
||||
hir::GenericParamKind::Lifetime { .. } => {}
|
||||
hir::GenericParamKind::Type { ref default, .. } => {
|
||||
self.process_bounds(param.bounds);
|
||||
if let Some(ref ty) = default {
|
||||
self.visit_ty(ty);
|
||||
}
|
||||
}
|
||||
hir::GenericParamKind::Const { ref ty, ref default } => {
|
||||
self.process_bounds(param.bounds);
|
||||
self.visit_ty(ty);
|
||||
if let Some(default) = default {
|
||||
self.visit_anon_const(default);
|
||||
|
|
|
@ -630,31 +630,6 @@ impl<'hir> Sig for hir::Generics<'hir> {
|
|||
param_text.push_str(&id_to_string(&scx.tcx.hir(), default.hir_id));
|
||||
}
|
||||
}
|
||||
if !param.bounds.is_empty() {
|
||||
param_text.push_str(": ");
|
||||
match param.kind {
|
||||
hir::GenericParamKind::Lifetime { .. } => {
|
||||
let bounds = param
|
||||
.bounds
|
||||
.iter()
|
||||
.map(|bound| match bound {
|
||||
hir::GenericBound::Outlives(lt) => lt.name.ident().to_string(),
|
||||
_ => panic!(),
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(" + ");
|
||||
param_text.push_str(&bounds);
|
||||
// FIXME add lifetime bounds refs.
|
||||
}
|
||||
hir::GenericParamKind::Type { .. } => {
|
||||
param_text.push_str(&bounds_to_string(param.bounds));
|
||||
// FIXME descend properly into bounds.
|
||||
}
|
||||
hir::GenericParamKind::Const { .. } => {
|
||||
// Const generics cannot contain bounds.
|
||||
}
|
||||
}
|
||||
}
|
||||
text.push_str(¶m_text);
|
||||
text.push(',');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue