Skip to content

Commit 60aa96d

Browse files
committed
---
yaml --- r: 180154 b: refs/heads/tmp c: b6f55ef h: refs/heads/master v: v3
1 parent 61c9f44 commit 60aa96d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 73d5d89567ef155dc12ee7d7ed61e206e43bf74e
37+
refs/heads/tmp: b6f55efd5b21b2132dafa85c112b339ba498bc7c

branches/tmp/src/librustc/lint/builtin.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,10 @@ impl LintPass for InvalidNoMangleItems {
21072107
},
21082108
ast::ItemConst(..) => {
21092109
if attr::contains_name(it.attrs.as_slice(), "no_mangle") {
2110-
let msg = "const items should never be #[no_mangle]";
2110+
// Const items do not refer to a particular location in memory, and therefore
2111+
// don't have anything to attach a symbol to
2112+
let msg = "const items should never be #[no_mangle], consider instead using \
2113+
`pub static`";
21112114
cx.span_lint(NO_MANGLE_CONST_ITEMS, it.span, msg);
21122115
}
21132116
}

0 commit comments

Comments
 (0)