Skip to content

Commit ee0e841

Browse files
committed
rustdoc: treat edition 2021 as unstable
1 parent a143517 commit ee0e841

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

compiler/rustc_session/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ pub fn parse_error_format(
13501350
error_format
13511351
}
13521352

1353-
fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
1353+
pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
13541354
let edition = match matches.opt_str("edition") {
13551355
Some(arg) => Edition::from_str(&arg).unwrap_or_else(|_| {
13561356
early_error(

src/librustdoc/config.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_session::config::{CodegenOptions, DebuggingOptions, ErrorOutputType, E
1616
use rustc_session::getopts;
1717
use rustc_session::lint::Level;
1818
use rustc_session::search_paths::SearchPath;
19-
use rustc_span::edition::{Edition, DEFAULT_EDITION};
19+
use rustc_span::edition::Edition;
2020
use rustc_target::spec::TargetTriple;
2121

2222
use crate::core::new_handler;
@@ -469,17 +469,7 @@ impl Options {
469469
}
470470
}
471471

472-
let edition = if let Some(e) = matches.opt_str("edition") {
473-
match e.parse() {
474-
Ok(e) => e,
475-
Err(_) => {
476-
diag.struct_err("could not parse edition").emit();
477-
return Err(1);
478-
}
479-
}
480-
} else {
481-
DEFAULT_EDITION
482-
};
472+
let edition = config::parse_crate_edition(&matches);
483473

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

0 commit comments

Comments
 (0)