Skip to content

Commit

Permalink
move comment about local trait
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehri01 committed Nov 26, 2023
1 parent af6b84a commit ee96a7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_infer/src/traits/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ pub fn report_object_safety_error<'tcx>(
to be resolvable dynamically; for more information visit \
<https://doc.rust-lang.org/reference/items/traits.html#object-safety>",
);

// Only provide the help if its a local trait, otherwise it's not actionable.
if trait_span.is_some() {
let mut reported_violations: Vec<_> = reported_violations.into_iter().collect();
reported_violations.sort();

// Only provide the help if its a local trait, otherwise it's not actionable.
let mut potential_solutions: Vec<_> =
reported_violations.into_iter().map(|violation| violation.solution()).collect();
potential_solutions.sort();
Expand Down

0 comments on commit ee96a7a

Please sign in to comment.