mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Rollup merge of #163795 - GuillaumeGomez:note-default-edition, r=notriddle
When documenting without a specified `--edition`, emit a message Follow-up of rust-lang/rust#158102. cc @estebank r? @notriddle
This commit is contained in:
@@ -777,9 +777,7 @@ impl Options {
|
||||
}
|
||||
}
|
||||
|
||||
// We don't want rustdoc invocations to complain about the lack of `--edition`.
|
||||
let has_input = false;
|
||||
let edition = config::parse_crate_edition(early_dcx, matches, has_input);
|
||||
let edition = config::parse_crate_edition(early_dcx, matches, true);
|
||||
|
||||
let mut id_map = html::markdown::IdMap::new();
|
||||
let Some(external_html) = ExternalHtml::load(
|
||||
|
||||
@@ -17,17 +17,17 @@ fn main() {
|
||||
.actual_text("(rustc)", &out)
|
||||
.run();
|
||||
|
||||
// Ensure that we dont mention --edition when running rustdoc.
|
||||
rustdoc().edition("2015").input("main.rs").run().assert_stderr_not_contains("--edition");
|
||||
let out = rustdoc().input("main.rs").run().assert_stderr_contains("--edition").stderr_utf8();
|
||||
diff().expected_file("rustdoc-unspecified-edition.stderr").actual_text("(rustc)", &out).run();
|
||||
|
||||
// Ensure that we only mention --edition when documenting.
|
||||
let out = rustdoc().run_fail().assert_stderr_not_contains("--edition").stderr_utf8();
|
||||
diff()
|
||||
.expected_text("(test)", "error: missing file operand\n\n")
|
||||
.actual_text("(rustc)", &out)
|
||||
.run();
|
||||
|
||||
let out =
|
||||
rustdoc().input("main.rs").run().assert_stderr_not_contains("--edition").stderr_utf8();
|
||||
diff().expected_text("(test)", "").actual_text("(rustc)", &out).run();
|
||||
|
||||
// Ensure that we don't mention --edition when getting help.
|
||||
let result = bare_rustc().arg("--help").run();
|
||||
result.assert_stderr_not_contains("--edition");
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
`--edition` is unspecified, defaulting to `2015` while the latest is `2024`; it must be one of: <2015|2018|2021|2024|future>
|
||||
|
||||
Reference in New Issue
Block a user