Skip to content

Commit 4b890f3

Browse files
Remove some span_of_impl+unwrap
1 parent 03bfbe1 commit 4b890f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
7676
let name = item1.ident(self.tcx).normalize_to_macros_2_0();
7777
let mut err = struct_span_err!(
7878
self.tcx.sess,
79-
self.tcx.span_of_impl(item1.def_id).unwrap(),
79+
self.tcx.def_span(item1.def_id),
8080
E0592,
8181
"duplicate definitions with name `{}`",
8282
name
8383
);
8484
err.span_label(
85-
self.tcx.span_of_impl(item1.def_id).unwrap(),
85+
self.tcx.def_span(item1.def_id),
8686
format!("duplicate definitions for `{}`", name),
8787
);
8888
err.span_label(
89-
self.tcx.span_of_impl(item2.def_id).unwrap(),
89+
self.tcx.def_span(item2.def_id),
9090
format!("other definition for `{}`", name),
9191
);
9292

0 commit comments

Comments
 (0)