Skip to content

Commit 4481349

Browse files
committed
Copy pasted from somewhere let's see it it fixes the vulnerability
1 parent ea22586 commit 4481349

File tree

1 file changed

+8
-0
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+8
-0
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
8686
// Check if the impl trait that we are considering is an impl of a local trait.
8787
self.maybe_suggest_blanket_trait_impl(self_ty, &mut diag);
8888
self.maybe_suggest_assoc_ty_bound(self_ty, &mut diag);
89+
if let Some(mut sugg) =
90+
self.tcx.dcx().steal_diagnostic(self_ty.span, StashKey::AssociatedTypeSuggestion)
91+
&& let Ok(ref mut s1) = err.suggestions
92+
&& let Ok(ref mut s2) = sugg.suggestions
93+
{
94+
s1.append(s2);
95+
sugg.cancel();
96+
}
8997
diag.stash(self_ty.span, StashKey::TraitMissingMethod)
9098
} else {
9199
tcx.node_span_lint(BARE_TRAIT_OBJECTS, self_ty.hir_id, self_ty.span, |lint| {

0 commit comments

Comments
 (0)