Skip to content

Commit

Permalink
rustdoc: treat edition 2021 as unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Feb 17, 2021
1 parent a143517 commit ee0e841
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/config.rs
Expand Up @@ -1350,7 +1350,7 @@ pub fn parse_error_format(
error_format
}

fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
let edition = match matches.opt_str("edition") {
Some(arg) => Edition::from_str(&arg).unwrap_or_else(|_| {
early_error(
Expand Down
14 changes: 2 additions & 12 deletions src/librustdoc/config.rs
Expand Up @@ -16,7 +16,7 @@ use rustc_session::config::{CodegenOptions, DebuggingOptions, ErrorOutputType, E
use rustc_session::getopts;
use rustc_session::lint::Level;
use rustc_session::search_paths::SearchPath;
use rustc_span::edition::{Edition, DEFAULT_EDITION};
use rustc_span::edition::Edition;
use rustc_target::spec::TargetTriple;

use crate::core::new_handler;
Expand Down Expand Up @@ -469,17 +469,7 @@ impl Options {
}
}

let edition = if let Some(e) = matches.opt_str("edition") {
match e.parse() {
Ok(e) => e,
Err(_) => {
diag.struct_err("could not parse edition").emit();
return Err(1);
}
}
} else {
DEFAULT_EDITION
};
let edition = config::parse_crate_edition(&matches);

let mut id_map = html::markdown::IdMap::new();
id_map.populate(&html::render::INITIAL_IDS);
Expand Down

0 comments on commit ee0e841

Please sign in to comment.