Skip to content

Commit 690bc57

Browse files
committed
Swap primary/secondary spans for E0458
1 parent 713f96d commit 690bc57

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/librustc_metadata/native_libs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for Collector<'a, 'tcx> {
7474
"dylib" => cstore::NativeUnknown,
7575
"framework" => cstore::NativeFramework,
7676
k => {
77-
struct_span_err!(self.tcx.sess, m.span, E0458,
77+
struct_span_err!(self.tcx.sess, item.span, E0458,
7878
"unknown kind: `{}`", k)
79-
.span_label(item.span(), "unknown kind").emit();
79+
.span_label(item.span(), "unknown kind")
80+
.span_label(m.span, "").emit();
8081
cstore::NativeUnknown
8182
}
8283
};

src/test/ui/bad/bad-extern-link-attrs.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ LL | #[link(name = "")]
1111
| ^^^^^^^^^^^^^^^^^^ empty name given
1212

1313
error[E0458]: unknown kind: `bar`
14-
--> $DIR/bad-extern-link-attrs.rs:4:1
14+
--> $DIR/bad-extern-link-attrs.rs:4:22
1515
|
1616
LL | #[link(name = "foo", kind = "bar")]
17-
| ^^^^^^^^^^^^^^^^^^^^^------------^^
17+
| ---------------------^^^^^^^^^^^^--
1818
| |
1919
| unknown kind
2020

src/test/ui/error-codes/E0458.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0458]: unknown kind: `wonderful_unicorn`
2-
--> $DIR/E0458.rs:1:1
2+
--> $DIR/E0458.rs:1:8
33
|
44
LL | #[link(kind = "wonderful_unicorn")] extern {}
5-
| ^^^^^^^--------------------------^^
5+
| -------^^^^^^^^^^^^^^^^^^^^^^^^^^--
66
| |
77
| unknown kind
88

0 commit comments

Comments
 (0)