diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-07-01 17:07:06 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-07-05 12:46:42 -0700 |
| commit | 41ed455db8cbde3cfff0d72e0ae383c20721b27a (patch) | |
| tree | e4ec549938c65faa455b84ce1a9f780cbe9d33ca /src/librustc/back | |
| parent | 812637e683ef1092cdd62704ab53f0b4c5aabe19 (diff) | |
| download | rust-41ed455db8cbde3cfff0d72e0ae383c20721b27a.tar.gz rust-41ed455db8cbde3cfff0d72e0ae383c20721b27a.zip | |
rustc: Repurpose the --crate-name CLI flag
In a cargo-driven world the primary location for the name of a crate will be in its manifest, not in the source file itself. The purpose of this flag is to reduce required duplication for new cargo projects. This is a breaking change because the existing --crate-name flag actually printed the crate name. This flag was renamed to --print-crate-name, and to maintain consistence, the --crate-file-name flag was renamed to --print-file-name. To maintain backwards compatibility, the --crate-file-name flag is still recognized, but it is deprecated. [breaking-change]
Diffstat (limited to 'src/librustc/back')
| -rw-r--r-- | src/librustc/back/link.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 497fcab44e1..c306a184ca1 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -556,6 +556,16 @@ pub fn find_crate_name(sess: Option<&Session>, s }; + match sess { + Some(sess) => { + match sess.opts.crate_name { + Some(ref s) => return validate(s.clone(), None), + None => {} + } + } + None => {} + } + let crate_name = attrs.iter().find(|at| at.check_name("crate_name")) .and_then(|at| at.value_str().map(|s| (at, s))); match crate_name { |
