diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-06 13:21:18 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-07-05 12:38:42 -0700 |
| commit | 50ee1ec1b4f107122d8037ac7b0b312afa6eb0ac (patch) | |
| tree | 6e812d9727a61ccea67f3bc922557d6d45736fbd /src/librustdoc/core.rs | |
| parent | aaff4e05e19b48d81e4ecb3337f288f42d06edd0 (diff) | |
| download | rust-50ee1ec1b4f107122d8037ac7b0b312afa6eb0ac.tar.gz rust-50ee1ec1b4f107122d8037ac7b0b312afa6eb0ac.zip | |
rustc: Remove CrateId and all related support
This commit removes all support in the compiler for the #[crate_id] attribute and all of its derivative infrastructure. A list of the functionality removed is: * The #[crate_id] attribute no longer exists * There is no longer the concept of a version of a crate * Version numbers are no longer appended to symbol names * The --crate-id command line option has been removed To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the crate itself should be mentioned. The version/path of the old crate id should be removed. For a transitionary state, the #[crate_id] attribute is still accepted if the #[crate_name] is not present, but it is warned about if it is the only identifier present. RFC: 0035-remove-crate-id [breaking-change]
Diffstat (limited to 'src/librustdoc/core.rs')
| -rw-r--r-- | src/librustdoc/core.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 245b2d162a7..058face151c 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -12,6 +12,7 @@ use rustc; use rustc::{driver, middle}; use rustc::middle::{privacy, ty}; use rustc::lint; +use rustc::back::link; use syntax::ast; use syntax::parse::token; @@ -83,7 +84,8 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<String>) use rustc::driver::driver::{FileInput, phase_1_parse_input, phase_2_configure_and_expand, - phase_3_run_analysis_passes}; + phase_3_run_analysis_passes, + build_output_filenames}; use rustc::driver::config::build_configuration; let input = FileInput(cpath.clone()); @@ -115,13 +117,19 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<String>) } let krate = phase_1_parse_input(&sess, cfg, &input); + + let t_outputs = build_output_filenames(&input, &None, &None, + krate.attrs.as_slice(), &sess); + let name = link::find_crate_name(Some(&sess), krate.attrs.as_slice(), + t_outputs.out_filestem.as_slice()); + let (krate, ast_map) - = phase_2_configure_and_expand(&sess, krate, &from_str("rustdoc").unwrap()) + = phase_2_configure_and_expand(&sess, krate, name.as_slice()) .expect("phase_2_configure_and_expand aborted in rustdoc!"); let driver::driver::CrateAnalysis { exported_items, public_items, ty_cx, .. - } = phase_3_run_analysis_passes(sess, &krate, ast_map); + } = phase_3_run_analysis_passes(sess, &krate, ast_map, name); debug!("crate: {:?}", krate); (DocContext { |
