mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Auto merge of #149717 - matthiaskrgr:rollup-spntobh, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang/rust#149659 (Look for typos when reporting an unknown nightly feature) - rust-lang/rust#149699 (Implement `Vec::from_fn`) - rust-lang/rust#149700 (rustdoc: fix bugs with search aliases and merging) - rust-lang/rust#149713 (Update windows-gnullvm platform support doc) - rust-lang/rust#149716 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
pub struct Dep1;
|
||||
pub struct Dep2;
|
||||
pub struct Dep3;
|
||||
pub struct Dep4;
|
||||
|
||||
//@ hasraw crates.js 'dep1'
|
||||
//@ hasraw search.index/name/*.js 'Dep1'
|
||||
//@ has dep1/index.html
|
||||
#[doc(alias = "dep1_missing")]
|
||||
pub struct Dep5;
|
||||
@@ -0,0 +1,4 @@
|
||||
//@ hasraw crates.js 'dep2'
|
||||
//@ hasraw search.index/name/*.js 'Second'
|
||||
//@ has dep2/index.html
|
||||
pub struct Second;
|
||||
@@ -0,0 +1,4 @@
|
||||
//@ !hasraw crates.js 'dep_missing'
|
||||
//@ !hasraw search.index/name/*.js 'DepMissing'
|
||||
//@ has dep_missing/index.html
|
||||
pub struct DepMissing;
|
||||
@@ -0,0 +1,88 @@
|
||||
// Running --merge=finalize without an input crate root should not trigger ICE.
|
||||
// Issue: https://github.com/rust-lang/rust/issues/146646
|
||||
|
||||
//@ needs-target-std
|
||||
|
||||
use run_make_support::{htmldocck, path, rustdoc};
|
||||
|
||||
fn main() {
|
||||
let out_dir = path("out");
|
||||
let merged_dir = path("merged");
|
||||
let parts_out_dir = path("parts");
|
||||
|
||||
rustdoc()
|
||||
.input("dep1.rs")
|
||||
.out_dir(&out_dir)
|
||||
.arg("-Zunstable-options")
|
||||
.arg(format!("--parts-out-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=none")
|
||||
.run();
|
||||
assert!(parts_out_dir.join("dep1.json").exists());
|
||||
|
||||
let output = rustdoc()
|
||||
.arg("-Zunstable-options")
|
||||
.out_dir(&out_dir)
|
||||
.arg(format!("--include-parts-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=finalize")
|
||||
.run();
|
||||
output.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
|
||||
|
||||
rustdoc()
|
||||
.input("dep2.rs")
|
||||
.out_dir(&out_dir)
|
||||
.arg("-Zunstable-options")
|
||||
.arg(format!("--parts-out-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=none")
|
||||
.run();
|
||||
assert!(parts_out_dir.join("dep2.json").exists());
|
||||
|
||||
let output2 = rustdoc()
|
||||
.arg("-Zunstable-options")
|
||||
.out_dir(&out_dir)
|
||||
.arg(format!("--include-parts-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=finalize")
|
||||
.run();
|
||||
output2.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
|
||||
|
||||
rustdoc()
|
||||
.input("dep1.rs")
|
||||
.out_dir(&out_dir)
|
||||
.arg("-Zunstable-options")
|
||||
.arg(format!("--parts-out-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=none")
|
||||
.run();
|
||||
assert!(parts_out_dir.join("dep1.json").exists());
|
||||
|
||||
let output3 = rustdoc()
|
||||
.arg("-Zunstable-options")
|
||||
.out_dir(&out_dir)
|
||||
.arg(format!("--include-parts-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=finalize")
|
||||
.run();
|
||||
output3.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
|
||||
|
||||
// dep_missing is different, because --parts-out-dir is not supplied
|
||||
rustdoc().input("dep_missing.rs").out_dir(&out_dir).run();
|
||||
assert!(parts_out_dir.join("dep2.json").exists());
|
||||
|
||||
rustdoc()
|
||||
.input("dep1.rs")
|
||||
.out_dir(&out_dir)
|
||||
.arg("-Zunstable-options")
|
||||
.arg(format!("--parts-out-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=none")
|
||||
.run();
|
||||
assert!(parts_out_dir.join("dep1.json").exists());
|
||||
|
||||
let output4 = rustdoc()
|
||||
.arg("-Zunstable-options")
|
||||
.out_dir(&out_dir)
|
||||
.arg(format!("--include-parts-dir={}", parts_out_dir.display()))
|
||||
.arg("--merge=finalize")
|
||||
.run();
|
||||
output4.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
|
||||
|
||||
htmldocck().arg(&out_dir).arg("dep1.rs").run();
|
||||
htmldocck().arg(&out_dir).arg("dep2.rs").run();
|
||||
htmldocck().arg(&out_dir).arg("dep_missing.rs").run();
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
#![feature(unknown_rust_feature)] //~ ERROR unknown feature
|
||||
#![feature(
|
||||
unknown_rust_feature,
|
||||
//~^ ERROR unknown feature
|
||||
|
||||
// Typo for lang feature
|
||||
associated_types_default,
|
||||
//~^ ERROR unknown feature
|
||||
//~| HELP there is a feature with a similar name
|
||||
|
||||
// Typo for lib feature
|
||||
core_intrnisics,
|
||||
//~^ ERROR unknown feature
|
||||
//~| HELP there is a feature with a similar name
|
||||
)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -1,9 +1,33 @@
|
||||
error[E0635]: unknown feature `unknown_rust_feature`
|
||||
--> $DIR/unknown-feature.rs:1:12
|
||||
--> $DIR/unknown-feature.rs:2:5
|
||||
|
|
||||
LL | #![feature(unknown_rust_feature)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
LL | unknown_rust_feature,
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0635]: unknown feature `associated_types_default`
|
||||
--> $DIR/unknown-feature.rs:6:5
|
||||
|
|
||||
LL | associated_types_default,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
help: there is a feature with a similar name: `associated_type_defaults`
|
||||
|
|
||||
LL - associated_types_default,
|
||||
LL + associated_type_defaults,
|
||||
|
|
||||
|
||||
error[E0635]: unknown feature `core_intrnisics`
|
||||
--> $DIR/unknown-feature.rs:11:5
|
||||
|
|
||||
LL | core_intrnisics,
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
help: there is a feature with a similar name: `core_intrinsics`
|
||||
|
|
||||
LL - core_intrnisics,
|
||||
LL + core_intrinsics,
|
||||
|
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0635`.
|
||||
|
||||
@@ -9,7 +9,7 @@ note: if you're trying to build a new `Vec<_, _>` consider using one of the foll
|
||||
Vec::<T>::with_capacity
|
||||
Vec::<T>::try_with_capacity
|
||||
Vec::<T>::from_raw_parts
|
||||
and 6 others
|
||||
and 7 others
|
||||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
||||
help: the function `contains` is implemented on `[_]`
|
||||
|
|
||||
|
||||
@@ -9,7 +9,7 @@ note: if you're trying to build a new `Vec<Q>` consider using one of the followi
|
||||
Vec::<T>::with_capacity
|
||||
Vec::<T>::try_with_capacity
|
||||
Vec::<T>::from_raw_parts
|
||||
and 6 others
|
||||
and 7 others
|
||||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
||||
help: there is an associated function `new` with a similar name
|
||||
|
|
||||
|
||||
Reference in New Issue
Block a user