Skip to content

Commit dee1107

Browse files
committed
Rename pkgid to crate_id
Closes #11035
1 parent b6933f8 commit dee1107

Some content is hidden

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

60 files changed

+72
-56
lines changed

src/etc/combine-tests.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def scrub(b):
4444
c.write(
4545
"""
4646
// AUTO-GENERATED FILE: DO NOT EDIT
47+
#[crate_id=\"run_pass_stage2#0.1\"];
4748
#[pkgid=\"run_pass_stage2#0.1\"];
4849
#[link(name=\"run_pass_stage2\", vers=\"0.1\")];
4950
#[feature(globs, macro_rules, struct_variant, managed_boxes)];

src/libextra/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Rust extras are part of the standard Rust distribution.
2020
2121
*/
2222

23+
// NOTE: remove after snapshot
2324
#[pkgid = "extra#0.9-pre"];
25+
#[crate_id = "extra#0.9-pre"];
2426
#[comment = "Rust extras"];
2527
#[license = "MIT/ASL2"];
2628
#[crate_type = "rlib"];

src/librustc/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// NOTE: remove after snapshot
1112
#[pkgid = "rustc#0.9-pre"];
13+
#[crate_id = "rustc#0.9-pre"];
1214
#[comment = "The Rust compiler"];
1315
#[license = "MIT/ASL2"];
1416
#[crate_type = "dylib"];

src/librustc/metadata/encoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1499,13 +1499,13 @@ fn synthesize_crate_attrs(ecx: &EncodeContext,
14991499

15001500
attr::mk_attr(
15011501
attr::mk_name_value_item_str(
1502-
@"pkgid",
1502+
@"crate_id",
15031503
ecx.link_meta.pkgid.to_str().to_managed()))
15041504
}
15051505

15061506
let mut attrs = ~[];
15071507
for attr in crate.attrs.iter() {
1508-
if "pkgid" != attr.name() {
1508+
if "crate_id" != attr.name() {
15091509
attrs.push(*attr);
15101510
}
15111511
}

src/librustc/middle/lint.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,8 @@ fn check_heap_item(cx: &Context, it: &ast::item) {
832832
}
833833

834834
static crate_attrs: &'static [&'static str] = &[
835-
"crate_type", "feature", "no_uv", "no_main", "no_std", "pkgid",
835+
// NOTE: remove pkgid after snapshot
836+
"crate_type", "feature", "no_uv", "no_main", "no_std", "pkgid", "crate_id",
836837
"desc", "comment", "license", "copyright", // not used in rustc now
837838
];
838839

src/librustdoc/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// NOTE: remove after snapshot
1112
#[pkgid = "rustdoc#0.9-pre"];
13+
#[crate_id = "rustdoc#0.9-pre"];
1214
#[desc = "rustdoc, the Rust documentation extractor"];
1315
#[license = "MIT/ASL2"];
1416
#[crate_type = "dylib"];

src/librustpkg/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
// rustpkg - a package manager and build system for Rust
1212

13+
// NOTE: remove after snapshot
1314
#[pkgid = "rustpkg#0.9-pre"];
15+
#[crate_id = "rustpkg#0.9-pre"];
1416
#[license = "MIT/ASL2"];
1517
#[crate_type = "dylib"];
1618

src/librustpkg/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1892,9 +1892,9 @@ fn pkgid_pointing_to_subdir() {
18921892
fs::mkdir_recursive(&foo_dir, io::UserRWX);
18931893
fs::mkdir_recursive(&bar_dir, io::UserRWX);
18941894
writeFile(&foo_dir.join("lib.rs"),
1895-
"#[pkgid=\"mockgh.loli.garden/mozilla/some_repo/extras/foo\"]; pub fn f() {}");
1895+
"#[crate_id=\"mockgh.loli.garden/mozilla/some_repo/extras/foo\"]; pub fn f() {}");
18961896
writeFile(&bar_dir.join("lib.rs"),
1897-
"#[pkgid=\"mockgh.loli.garden/mozilla/some_repo/extras/bar\"]; pub fn g() {}");
1897+
"#[crate_id=\"mockgh.loli.garden/mozilla/some_repo/extras/bar\"]; pub fn g() {}");
18981898

18991899
debug!("Creating a file in {}", workspace.display());
19001900
let testpkg_dir = workspace.join_many(["src", "testpkg-0.0"]);
@@ -2316,7 +2316,7 @@ fn find_sources_in_cwd() {
23162316
let source_dir = temp_dir.join("foo");
23172317
fs::mkdir_recursive(&source_dir, io::UserRWX);
23182318
writeFile(&source_dir.join("main.rs"),
2319-
"fn main() { let _x = (); }");
2319+
r#"#[crate_id="foo"]; fn main() { let _x = (); }"#);
23202320
command_line_test([~"install", ~"foo"], &source_dir);
23212321
assert_executable_exists(&source_dir.join(".rust"), "foo");
23222322
}

src/librustpkg/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ pub fn compile_input(context: &BuildContext,
291291
});
292292

293293
// Inject the pkgid attribute so we get the right package name and version
294-
if !attr::contains_name(crate.attrs, "pkgid") {
294+
if !attr::contains_name(crate.attrs, "crate_id") {
295295
// FIXME (#9639): This needs to handle non-utf8 paths
296296
let pkgid_attr =
297-
attr::mk_name_value_item_str(@"pkgid",
297+
attr::mk_name_value_item_str(@"crate_id",
298298
format!("{}\\#{}",
299299
pkg_id.path.as_str().unwrap(),
300300
pkg_id.version.to_str()).to_managed());

src/librustuv/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ via `close` and `delete` methods.
3434
3535
*/
3636

37+
// NOTE: remove after snapshot
3738
#[pkgid = "rustuv#0.9-pre"];
39+
#[crate_id = "rustuv#0.9-pre"];
3840
#[license = "MIT/ASL2"];
3941
#[crate_type = "rlib"];
4042
#[crate_type = "dylib"];

src/libstd/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
//!
4444
//! use std::prelude::*;
4545
46+
// NOTE: remove after snapshot
4647
#[pkgid = "std#0.9-pre"];
48+
#[crate_id = "std#0.9-pre"];
4749
#[comment = "The Rust standard library"];
4850
#[license = "MIT/ASL2"];
4951
#[crate_type = "rlib"];

src/libsyntax/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn find_linkage_metas(attrs: &[Attribute]) -> ~[@MetaItem] {
237237
}
238238

239239
pub fn find_pkgid(attrs: &[Attribute]) -> Option<PkgId> {
240-
match first_attr_value_str_by_name(attrs, "pkgid") {
240+
match first_attr_value_str_by_name(attrs, "crate_id") {
241241
None => None,
242242
Some(id) => from_str::<PkgId>(id),
243243
}

src/libsyntax/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
* macros.
1414
*/
1515

16+
// NOTE: remove pkgid after snapshot
1617
#[pkgid = "syntax#0.9-pre"];
18+
#[crate_id = "syntax#0.9-pre"];
1719
#[license = "MIT/ASL2"];
1820
#[crate_type = "dylib"];
1921
#[crate_type = "rlib"];

src/test/auxiliary/anon-extern-mod-cross-crate-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="anonexternmod#0.1"];
11+
#[crate_id="anonexternmod#0.1"];
1212

1313
use std::libc;
1414

src/test/auxiliary/cci_impl_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="cci_impl_lib"];
11+
#[crate_id="cci_impl_lib"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name="cci_impl_lib", vers="0.0")];
1414

src/test/auxiliary/cci_iter_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="cci_iter_lib"];
11+
#[crate_id="cci_iter_lib"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name="cci_iter_lib", vers="0.0")];
1414

src/test/auxiliary/cci_no_inline_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="cci_no_inline_lib"];
11+
#[crate_id="cci_no_inline_lib"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name="cci_no_inline_lib", vers="0.0")];
1414

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[feature(managed_boxes)];
12-
#[pkgid="crate_method_reexport_grrrrrrr2"];
12+
#[crate_id="crate_method_reexport_grrrrrrr2"];
1313
// NOTE: remove after the next snapshot
1414
#[link(name = "crate_method_reexport_grrrrrrr2")];
1515

src/test/auxiliary/crateresolve1-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve1#0.1"];
11+
#[crate_id="crateresolve1#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve1",
1414
vers = "0.1")];

src/test/auxiliary/crateresolve1-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve1#0.2"];
11+
#[crate_id="crateresolve1#0.2"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve1",
1414
vers = "0.2")];

src/test/auxiliary/crateresolve1-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve1#0.3"];
11+
#[crate_id="crateresolve1#0.3"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve1",
1414
vers = "0.3")];

src/test/auxiliary/crateresolve2-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve2#0.1"];
11+
#[crate_id="crateresolve2#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve2",
1414
vers = "0.1")];

src/test/auxiliary/crateresolve2-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve2#0.2"];
11+
#[crate_id="crateresolve2#0.2"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve2",
1414
vers = "0.2")];

src/test/auxiliary/crateresolve2-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve2#0.3"];
11+
#[crate_id="crateresolve2#0.3"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve2",
1414
vers = "0.3")];

src/test/auxiliary/crateresolve3-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve3#0.1"];
11+
#[crate_id="crateresolve3#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve3",
1414
vers = "0.1")];

src/test/auxiliary/crateresolve3-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve3#0.2"];
11+
#[crate_id="crateresolve3#0.2"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve3",
1414
vers = "0.2")];

src/test/auxiliary/crateresolve4a-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve4a#0.1"];
11+
#[crate_id="crateresolve4a#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve4a", vers = "0.1")];
1414
#[crate_type = "lib"];

src/test/auxiliary/crateresolve4a-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve4a#0.2"];
11+
#[crate_id="crateresolve4a#0.2"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve4a", vers= "0.2")];
1414
#[crate_type = "lib"];

src/test/auxiliary/crateresolve4b-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// aux-build:crateresolve4a-1.rs
1212
// aux-build:crateresolve4a-2.rs
13-
#[pkgid="crateresolve4b#0.1"];
13+
#[crate_id="crateresolve4b#0.1"];
1414
// NOTE: remove after the next snapshot
1515
#[link(name = "crateresolve4b", vers = "0.1")];
1616
#[crate_type = "lib"];

src/test/auxiliary/crateresolve4b-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// aux-build:crateresolve4a-1.rs
1212
// aux-build:crateresolve4a-2.rs
13-
#[pkgid="crateresolve4b#0.2"];
13+
#[crate_id="crateresolve4b#0.2"];
1414
// NOTE: remove after the next snapshot
1515
#[link(name = "crateresolve4b", vers = "0.2")];
1616
#[crate_type = "lib"];

src/test/auxiliary/crateresolve5-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve5#0.1"];
11+
#[crate_id="crateresolve5#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve5",
1414
vers = "0.1")];

src/test/auxiliary/crateresolve5-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve5#0.2"];
11+
#[crate_id="crateresolve5#0.2"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve5",
1414
vers = "0.2")];

src/test/auxiliary/crateresolve8-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// default link meta for 'package_id' will be equal to filestem
12-
#[pkgid="crateresolve8#0.1"];
12+
#[crate_id="crateresolve8#0.1"];
1313
// NOTE: remove after the next snapshot
1414
#[link(name = "crateresolve8",
1515
vers = "0.1")];

src/test/auxiliary/crateresolve_calories-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve_calories#0.1"];
11+
#[crate_id="crateresolve_calories#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve_calories",
1414
vers = "0.1",

src/test/auxiliary/crateresolve_calories-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="crateresolve_calories#0.1"];
11+
#[crate_id="crateresolve_calories#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "crateresolve_calories",
1414
vers = "0.1",

src/test/auxiliary/extern-crosscrate-source.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="externcallback#0.1"];
11+
#[crate_id="externcallback#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "externcallback",
1414
vers = "0.1")];

src/test/auxiliary/foreign_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="foreign_lib"];
11+
#[crate_id="foreign_lib"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name="foreign_lib", vers="0.0")];
1414

src/test/auxiliary/inline_dtor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="inline_dtor#0.1"];
11+
#[crate_id="inline_dtor#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name="inline_dtor", vers="0.1")];
1414

src/test/auxiliary/iss.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="issue6919_3#0.1"];
11+
#[crate_id="issue6919_3#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name="iss6919_3", vers="0.1")];
1414

src/test/auxiliary/issue-2380.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[feature(managed_boxes)];
12-
#[pkgid="a"];
12+
#[crate_id="a"];
1313
// NOTE: remove after the next snapshot
1414
#[link(name = "a", vers = "0.0")];
1515
#[crate_type = "lib"];

src/test/auxiliary/issue-2414-a.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[pkgid="a#0.1"];
11+
#[crate_id="a#0.1"];
1212
// NOTE: remove after the next snapshot
1313
#[link(name = "a", vers = "0.1")];
1414
#[crate_type = "lib"];

0 commit comments

Comments
 (0)