X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Frustc_typeck%2Fsrc%2Fastconv%2Fmod.rs;h=58f4f02052f8bd64a7c9d964311fb73263a5e32a;hb=9e7b7d5e1c9199f372107e0ace1733c11d09fe37;hp=9e4da0580522b54fd21940f109c3fd1fd8e0329a;hpb=90c59e736b142965ce42c4a41f50d447c28faa74;p=rust.git diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index 9e4da058052..58f4f02052f 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -382,7 +382,7 @@ struct SubstsForAstPathCtxt<'a, 'tcx> { def_id: DefId, generic_args: &'a GenericArgs<'a>, span: Span, - missing_type_params: Vec, + missing_type_params: Vec, inferred_params: Vec, infer_args: bool, is_object: bool, @@ -514,7 +514,7 @@ fn inferred_kind( // 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. @@ -1150,17 +1150,12 @@ fn add_predicates_for_ast_type_binding( .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); @@ -2676,7 +2671,7 @@ fn ast_ty_to_ty_inner(&self, ast_ty: &hir::Ty<'_>, borrowed: bool, in_path: bool span, ty, opt_sugg: Some((span, Applicability::MachineApplicable)) - .filter(|_| ty.is_suggestable(tcx)), + .filter(|_| ty.is_suggestable(tcx, false)), }); ty