Refine the message to at least *mention* the attribute itself.
Update pre-existing test's diagnostic output accordingly.
This commit is contained in:
parent
64edaec6b3
commit
444f2bae59
3 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue