def_id: DefId,
generic_args: &'a GenericArgs<'a>,
span: Span,
- missing_type_params: Vec<String>,
+ missing_type_params: Vec<Symbol>,
inferred_params: Vec<Span>,
infer_args: bool,
is_object: bool,
// defaults. This will lead to an ICE if we are not
// careful!
if self.default_needs_object_self(param) {
- self.missing_type_params.push(param.name.to_string());
+ self.missing_type_params.push(param.name);
tcx.ty_error().into()
} else {
// This is a default type parameter.
.expect("missing associated type");
if !assoc_item.vis.is_accessible_from(def_scope, tcx) {
- let kind = match assoc_item.kind {
- ty::AssocKind::Type => "type",
- ty::AssocKind::Const => "const",
- _ => unreachable!(),
- };
tcx.sess
.struct_span_err(
binding.span,
- &format!("associated {kind} `{}` is private", binding.item_name),
+ &format!("{} `{}` is private", assoc_item.kind, binding.item_name),
)
- .span_label(binding.span, &format!("private associated {kind}"))
+ .span_label(binding.span, &format!("private {}", assoc_item.kind))
.emit();
}
tcx.check_stability(assoc_item.def_id, Some(hir_ref_id), binding.span, None);