Skip to content

Commit 132921b

Browse files
committed
Remove duplicated code
1 parent 144e259 commit 132921b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,7 @@ fn object_safety_violations_for_trait(
190190
tcx.def_path_str(trait_def_id)
191191
),
192192
);
193-
let spans = violation.spans();
194-
if spans.is_empty() {
195-
err.note(&violation.error_msg());
196-
} else {
197-
for span in spans {
198-
err.span_label(span, violation.error_msg());
199-
}
200-
}
193+
err.span_label(*span, violation.error_msg());
201194
err.emit();
202195
false
203196
} else {

0 commit comments

Comments
 (0)