1
Fork 0

Refine the message to at least *mention* the attribute itself.

Update pre-existing test's diagnostic output accordingly.
This commit is contained in:
Felix S. Klock II 2019-05-24 14:55:15 +02:00
parent 64edaec6b3
commit 444f2bae59
3 changed files with 4 additions and 3 deletions

View file

@ -116,7 +116,8 @@ fn check_and_apply_linkage(
let llty2 = if let ty::RawPtr(ref mt) = ty.sty {
cx.layout_of(mt.ty).llvm_type(cx)
} else {
cx.sess().span_fatal(span, "must have type `*const T` or `*mut T`")
cx.sess().span_fatal(
span, "must have type `*const T` or `*mut T` due to `#[linkage]` attribute")
};
unsafe {
// Declare a symbol `foo` with the desired linkage.

View file

@ -7,7 +7,7 @@
extern {
#[linkage = "extern_weak"] static foo: i32;
//~^ ERROR: must have type `*const T` or `*mut T`
//~^ ERROR: must have type `*const T` or `*mut T` due to `#[linkage]` attribute
}
fn main() {

View file

@ -1,4 +1,4 @@
error: must have type `*const T` or `*mut T`
error: must have type `*const T` or `*mut T` due to `#[linkage]` attribute
--> $DIR/linkage2.rs:9:32
|
LL | #[linkage = "extern_weak"] static foo: i32;