Skip to content

Commit 4cd8cae

Browse files
ehusscuviper
authored andcommitted
rustdoc: treat edition 2021 as unstable
(cherry picked from commit ee0e841)
1 parent 4d25f46 commit 4cd8cae

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ pub fn parse_error_format(
12901290
error_format
12911291
}
12921292

1293-
fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
1293+
pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
12941294
let edition = match matches.opt_str("edition") {
12951295
Some(arg) => Edition::from_str(&arg).unwrap_or_else(|_| {
12961296
early_error(

src/librustdoc/config.rs

Lines changed: 2 additions & 12 deletions
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)