Skip to content

Commit e09a8e8

Browse files
committed
auto merge of #11091 : brson/rust/cratelinkattr, r=brson
This is set to *forbid* and prints a note explaining how to fix the problem.
2 parents 619c4fc + 26f1b4d commit e09a8e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6
-104
lines changed

src/etc/combine-tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def scrub(b):
4646
// AUTO-GENERATED FILE: DO NOT EDIT
4747
#[crate_id=\"run_pass_stage2#0.1\"];
4848
#[pkgid=\"run_pass_stage2#0.1\"];
49-
#[link(name=\"run_pass_stage2\", vers=\"0.1\")];
5049
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
5150
#[allow(warnings)];
5251
"""

src/librustc/middle/lint.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,12 @@ fn check_crate_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
872872
if !iter.any(|other_attr| { name.equiv(other_attr) }) {
873873
cx.span_lint(attribute_usage, attr.span, "unknown crate attribute");
874874
}
875+
if name.equiv(& &"link") {
876+
cx.tcx.sess.span_err(attr.span,
877+
"obsolete crate `link` attribute");
878+
cx.tcx.sess.note("the link attribute has been superceded by the crate_id \
879+
attribute, which has the format `#[crate_id = \"name#version\"]`");
880+
}
875881
}
876882
}
877883

src/test/auxiliary/cci_impl_lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="cci_impl_lib"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name="cci_impl_lib", vers="0.0")];
1412

1513
trait uint_helpers {
1614
fn to(&self, v: uint, f: |uint|);

src/test/auxiliary/cci_iter_lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="cci_iter_lib"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name="cci_iter_lib", vers="0.0")];
1412

1513
#[inline]
1614
pub fn iter<T>(v: &[T], f: |&T|) {

src/test/auxiliary/cci_no_inline_lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="cci_no_inline_lib"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name="cci_no_inline_lib", vers="0.0")];
1412

1513
// same as cci_iter_lib, more-or-less, but not marked inline
1614
pub fn iter(v: ~[uint], f: |uint|) {

src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#[feature(managed_boxes)];
1212
#[crate_id="crate_method_reexport_grrrrrrr2"];
13-
// NOTE: remove after the next snapshot
14-
#[link(name = "crate_method_reexport_grrrrrrr2")];
1513

1614
pub use name_pool::add;
1715

src/test/auxiliary/crateresolve1-1.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="crateresolve1#0.1"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name = "crateresolve1",
14-
vers = "0.1")];
1512

1613
#[crate_type = "lib"];
1714

src/test/auxiliary/crateresolve1-2.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="crateresolve1#0.2"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name = "crateresolve1",
14-
vers = "0.2")];
1512

1613
#[crate_type = "lib"];
1714

src/test/auxiliary/crateresolve1-3.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="crateresolve1#0.3"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name = "crateresolve1",
14-
vers = "0.3")];
1512

1613
#[crate_type = "lib"];
1714

src/test/auxiliary/crateresolve2-1.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// except according to those terms.
1010

1111
#[crate_id="crateresolve2#0.1"];
12-
// NOTE: remove after the next snapshot
13-
#[link(name = "crateresolve2",
14-
vers = "0.1")];
1512

1613
#[crate_type = "lib"];
1714

0 commit comments

Comments
 (0)