File tree Expand file tree Collapse file tree 7 files changed +56
-7
lines changed
test/run-make/crate-name-priority Expand file tree Collapse file tree 7 files changed +56
-7
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: da4e4e4e0a7778a85748aa4a303b13f603e96b4b
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 8ddd286ea4ba4384a0dc9eae393ed515460a986e
5
- refs/heads/try: a0cfda53c4b7367f6494e3d746b35cea644ee50d
5
+ refs/heads/try: 35e21346216cc4c5a3b22bb6fb316f8c867f8c92
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ endif
171
171
# Main test targets
172
172
# #####################################################################
173
173
174
- check : cleantmptestlogs cleantestlibs tidy check-notidy
174
+ check : cleantmptestlogs cleantestlibs check-notidy tidy
175
175
176
176
check-notidy : cleantmptestlogs cleantestlibs all check-stage2
177
177
$(Q )$(CFG_PYTHON ) $(S ) src/etc/check-summary.py tmp/* .log
Original file line number Diff line number Diff line change @@ -903,10 +903,21 @@ pub fn build_output_filenames(input: &Input,
903
903
} ;
904
904
905
905
// If a crate name is present, we use it as the link name
906
- let stem = match attr:: find_crate_name ( attrs) {
907
- None => input. filestem ( ) ,
908
- Some ( name) => name. get ( ) . to_string ( ) ,
909
- } ;
906
+ let stem = sess. opts . crate_name . clone ( ) . or_else ( || {
907
+ attr:: find_crate_name ( attrs) . map ( |n| n. get ( ) . to_string ( ) )
908
+ } ) . or_else ( || {
909
+ // NB: this clause can be removed once #[crate_id] is no longer
910
+ // deprecated.
911
+ //
912
+ // Also note that this will be warned about later so we don't
913
+ // warn about it here.
914
+ use syntax:: crateid:: CrateId ;
915
+ attrs. iter ( ) . find ( |at| at. check_name ( "crate_id" ) )
916
+ . and_then ( |at| at. value_str ( ) )
917
+ . and_then ( |s| from_str :: < CrateId > ( s. get ( ) ) )
918
+ . map ( |id| id. name )
919
+ } ) . unwrap_or ( input. filestem ( ) ) ;
920
+
910
921
OutputFilenames {
911
922
out_directory : dirpath,
912
923
out_filestem : stem,
Original file line number Diff line number Diff line change @@ -575,12 +575,12 @@ impl LintPass for UnusedAttribute {
575
575
] ;
576
576
577
577
static CRATE_ATTRS : & ' static [ & ' static str ] = & [
578
+ "crate_name" ,
578
579
"crate_type" ,
579
580
"feature" ,
580
581
"no_start" ,
581
582
"no_main" ,
582
583
"no_std" ,
583
- "crate_id" ,
584
584
"desc" ,
585
585
"comment" ,
586
586
"license" ,
Original file line number Diff line number Diff line change
1
+ -include ../tools.mk
2
+
3
+ all :
4
+ $(RUSTC ) foo.rs
5
+ rm $(TMPDIR ) /$(call BIN,foo)
6
+ $(RUSTC ) foo.rs --crate-name bar
7
+ rm $(TMPDIR ) /$(call BIN,bar)
8
+ $(RUSTC ) foo1.rs
9
+ rm $(TMPDIR ) /$(call BIN,foo)
10
+ $(RUSTC ) foo1.rs --crate-name bar
11
+ rm $(TMPDIR ) /$(call BIN,bar)
12
+ $(RUSTC ) foo1.rs --crate-name bar -o $(TMPDIR ) /bar1
13
+ rm $(TMPDIR ) /$(call BIN,bar1)
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ crate_name = "foo" ]
12
+
13
+ fn main ( ) { }
14
+
You can’t perform that action at this time.
0 commit comments