diff options
Diffstat (limited to 'compiler/rustc_save_analysis/src')
| -rw-r--r-- | compiler/rustc_save_analysis/src/dump_visitor.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_save_analysis/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_save_analysis/src/sig.rs | 5 |
3 files changed, 12 insertions, 6 deletions
diff --git a/compiler/rustc_save_analysis/src/dump_visitor.rs b/compiler/rustc_save_analysis/src/dump_visitor.rs index 40d60a8394b..617a28ed519 100644 --- a/compiler/rustc_save_analysis/src/dump_visitor.rs +++ b/compiler/rustc_save_analysis/src/dump_visitor.rs @@ -582,7 +582,7 @@ impl<'tcx> DumpVisitor<'tcx> { } ref v => { let mut value = format!("{}::{}", enum_data.name, name); - if let &hir::VariantData::Tuple(ref fields, _) = v { + if let hir::VariantData::Tuple(fields, _) = v { value.push('('); value.push_str( &fields @@ -653,7 +653,7 @@ impl<'tcx> DumpVisitor<'tcx> { let map = &self.tcx.hir(); self.nest_typeck_results(map.local_def_id(item.hir_id), |v| { v.visit_ty(&typ); - if let &Some(ref trait_ref) = trait_ref { + if let Some(trait_ref) = trait_ref { v.process_path(trait_ref.hir_ref_id, &hir::QPath::Resolved(None, &trait_ref.path)); } v.process_generic_params(generics, "", item.hir_id); @@ -1082,7 +1082,7 @@ impl<'tcx> DumpVisitor<'tcx> { ); } - if let &Some(ref default_ty) = default_ty { + if let Some(default_ty) = default_ty { self.visit_ty(default_ty) } } @@ -1343,9 +1343,12 @@ impl<'tcx> Visitor<'tcx> for DumpVisitor<'tcx> { self.visit_ty(ty); } } - hir::GenericParamKind::Const { ref 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); + } } } } diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs index eed9f2eb74d..056c0b3d9d5 100644 --- a/compiler/rustc_save_analysis/src/lib.rs +++ b/compiler/rustc_save_analysis/src/lib.rs @@ -825,7 +825,7 @@ impl<'tcx> SaveContext<'tcx> { for attr in attrs { if let Some(val) = attr.doc_str() { // FIXME: Should save-analysis beautify doc strings itself or leave it to users? - result.push_str(&beautify_doc_string(val)); + result.push_str(&beautify_doc_string(val).as_str()); result.push('\n'); } else if self.tcx.sess.check_name(attr, sym::doc) { if let Some(meta_list) = attr.meta_item_list() { diff --git a/compiler/rustc_save_analysis/src/sig.rs b/compiler/rustc_save_analysis/src/sig.rs index ff445d727fa..ab3da270fe6 100644 --- a/compiler/rustc_save_analysis/src/sig.rs +++ b/compiler/rustc_save_analysis/src/sig.rs @@ -614,9 +614,12 @@ impl<'hir> Sig for hir::Generics<'hir> { start: offset + text.len(), end: offset + text.len() + param_text.as_str().len(), }); - if let hir::GenericParamKind::Const { ref ty } = param.kind { + if let hir::GenericParamKind::Const { ref ty, ref default } = param.kind { param_text.push_str(": "); param_text.push_str(&ty_to_string(&ty)); + if let Some(ref _default) = default { + // FIXME(const_generics_defaults): push the `default` value here + } } if !param.bounds.is_empty() { param_text.push_str(": "); |
