Skip to content
Permalink
Browse files

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

Update pre-existing test's diagnostic output accordingly.
  • Loading branch information...
pnkfelix committed May 24, 2019
1 parent 64edaec commit 444f2bae5920a93677a9de6063897e5ce00491e7
@@ -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.
@@ -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() {
@@ -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;

0 comments on commit 444f2ba

Please sign in to comment.
You can’t perform that action at this time.