diff options
| author | bors <bors@rust-lang.org> | 2021-05-06 15:19:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-05-06 15:19:39 +0000 |
| commit | d44f647ffcff0e1ff2c0f45b6a0ce9796d80f1ca (patch) | |
| tree | 11e72654b4a65b93a5c4249357b092a0c4293f26 /src/test | |
| parent | 109248a4eb99bc83684c94ca4ef36f2fadc17e2a (diff) | |
| parent | ccc820e1f8eb8d8d142bd93d578bb5c7d9bb6775 (diff) | |
| download | rust-d44f647ffcff0e1ff2c0f45b6a0ce9796d80f1ca.tar.gz rust-d44f647ffcff0e1ff2c0f45b6a0ce9796d80f1ca.zip | |
Auto merge of #84982 - Dylan-DPC:rollup-q4cbec2, r=Dylan-DPC
Rollup of 8 pull requests
Successful merges:
- #83507 (Implement RFC 2951: Native link modifiers)
- #84328 (Stablize {HashMap,BTreeMap}::into_{keys,values})
- #84712 (Simplify chdir implementation and minimize unsafe block)
- #84851 (:arrow_up: rust-analyzer)
- #84923 (Only compute Obligation `cache_key` once in `register_obligation_at`)
- #84945 (E0583: Include secondary path in error message)
- #84949 (Fix typo in `MaybeUninit::array_assume_init` safety comment)
- #84950 (Revert PR 83866)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
27 files changed, 132 insertions, 22 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr b/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr index f287f87408c..de215b2163b 100644 --- a/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr +++ b/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr @@ -10,7 +10,6 @@ note: the lint level is defined here LL | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]` - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr index 94d6d461651..195aaca32a2 100644 --- a/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr +++ b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr @@ -10,47 +10,36 @@ note: the lint level is defined here LL | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]` - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: unknown disambiguator `bar` --> $DIR/unknown-disambiguator.rs:3:35 | LL | //! Linking to [foo@banana] and [`bar@banana!()`]. | ^^^ - | - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: unknown disambiguator `foo` --> $DIR/unknown-disambiguator.rs:9:34 | LL | //! And with weird backticks: [``foo@hello``] [foo`@`hello]. | ^^^ - | - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: unknown disambiguator `foo` --> $DIR/unknown-disambiguator.rs:9:48 | LL | //! And with weird backticks: [``foo@hello``] [foo`@`hello]. | ^^^ - | - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: unknown disambiguator `` --> $DIR/unknown-disambiguator.rs:6:31 | LL | //! And to [no disambiguator](@nectarine) and [another](@apricot!()). | ^ - | - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: unknown disambiguator `` --> $DIR/unknown-disambiguator.rs:6:57 | LL | //! And to [no disambiguator](@nectarine) and [another](@apricot!()). | ^ - | - = note: see https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators error: aborting due to 6 previous errors diff --git a/src/test/ui/error-codes/E0583.stderr b/src/test/ui/error-codes/E0583.stderr index dbe70035595..c7bbbf11499 100644 --- a/src/test/ui/error-codes/E0583.stderr +++ b/src/test/ui/error-codes/E0583.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `module_that_doesnt_exist` LL | mod module_that_doesnt_exist; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: to create the module `module_that_doesnt_exist`, create file "$DIR/module_that_doesnt_exist.rs" + = help: to create the module `module_that_doesnt_exist`, create file "$DIR/module_that_doesnt_exist.rs" or "$DIR/module_that_doesnt_exist/mod.rs" error: aborting due to previous error diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers.rs new file mode 100644 index 00000000000..2d00aa2a3cf --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers.rs @@ -0,0 +1,5 @@ +#[link(name = "foo", modifiers = "")] +//~^ ERROR: native link modifiers are experimental +extern "C" {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers.stderr b/src/test/ui/feature-gates/feature-gate-native_link_modifiers.stderr new file mode 100644 index 00000000000..20a2d6a26fa --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers.stderr @@ -0,0 +1,12 @@ +error[E0658]: native link modifiers are experimental + --> $DIR/feature-gate-native_link_modifiers.rs:1:22 + | +LL | #[link(name = "foo", modifiers = "")] + | ^^^^^^^^^^^^^^ + | + = note: see issue #81490 <https://github.com/rust-lang/rust/issues/81490> for more information + = help: add `#![feature(native_link_modifiers)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs new file mode 100644 index 00000000000..4cf8067592e --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs @@ -0,0 +1,8 @@ +#![allow(incomplete_features)] +#![feature(native_link_modifiers)] + +#[link(name = "foo", modifiers = "+as-needed")] +//~^ ERROR: `#[link(modifiers="as-needed")]` is unstable +extern "C" {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.stderr b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.stderr new file mode 100644 index 00000000000..08ce807851b --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.stderr @@ -0,0 +1,12 @@ +error[E0658]: `#[link(modifiers="as-needed")]` is unstable + --> $DIR/feature-gate-native_link_modifiers_as_needed.rs:4:34 + | +LL | #[link(name = "foo", modifiers = "+as-needed")] + | ^^^^^^^^^^^^ + | + = note: see issue #81490 <https://github.com/rust-lang/rust/issues/81490> for more information + = help: add `#![feature(native_link_modifiers_as_needed)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.rs new file mode 100644 index 00000000000..b2b1dc28e47 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.rs @@ -0,0 +1,8 @@ +#![allow(incomplete_features)] +#![feature(native_link_modifiers)] + +#[link(name = "foo", modifiers = "+bundle")] +//~^ ERROR: `#[link(modifiers="bundle")]` is unstable +extern "C" {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.stderr b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.stderr new file mode 100644 index 00000000000..b3e22b0644a --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.stderr @@ -0,0 +1,12 @@ +error[E0658]: `#[link(modifiers="bundle")]` is unstable + --> $DIR/feature-gate-native_link_modifiers_bundle.rs:4:34 + | +LL | #[link(name = "foo", modifiers = "+bundle")] + | ^^^^^^^^^ + | + = note: see issue #81490 <https://github.com/rust-lang/rust/issues/81490> for more information + = help: add `#![feature(native_link_modifiers_bundle)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.rs new file mode 100644 index 00000000000..042ce0b3f65 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.rs @@ -0,0 +1,8 @@ +#![allow(incomplete_features)] +#![feature(native_link_modifiers)] + +#[link(name = "foo", modifiers = "+verbatim")] +//~^ ERROR: `#[link(modifiers="verbatim")]` is unstable +extern "C" {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.stderr b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.stderr new file mode 100644 index 00000000000..8159416edfa --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.stderr @@ -0,0 +1,12 @@ +error[E0658]: `#[link(modifiers="verbatim")]` is unstable + --> $DIR/feature-gate-native_link_modifiers_verbatim.rs:4:34 + | +LL | #[link(name = "foo", modifiers = "+verbatim")] + | ^^^^^^^^^^^ + | + = note: see issue #81490 <https://github.com/rust-lang/rust/issues/81490> for more information + = help: add `#![feature(native_link_modifiers_verbatim)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.rs new file mode 100644 index 00000000000..ca801e59114 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.rs @@ -0,0 +1,8 @@ +#![allow(incomplete_features)] +#![feature(native_link_modifiers)] + +#[link(name = "foo", modifiers = "+whole-archive")] +//~^ ERROR: `#[link(modifiers="whole-archive")]` is unstable +extern "C" {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.stderr b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.stderr new file mode 100644 index 00000000000..cacaa789ecb --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.stderr @@ -0,0 +1,12 @@ +error[E0658]: `#[link(modifiers="whole-archive")]` is unstable + --> $DIR/feature-gate-native_link_modifiers_whole_archive.rs:4:34 + | +LL | #[link(name = "foo", modifiers = "+whole-archive")] + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #81490 <https://github.com/rust-lang/rust/issues/81490> for more information + = help: add `#![feature(native_link_modifiers_whole_archive)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr b/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr index d96a48cde9f..301a1e1341e 100644 --- a/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr +++ b/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr @@ -1,3 +1,5 @@ +warning: library kind `static-nobundle` has been superseded by specifying `-bundle` on library kind `static`. Try `static:-bundle` + error[E0658]: kind="static-nobundle" is unstable | = note: see issue #37403 <https://github.com/rust-lang/rust/issues/37403> for more information diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle.rs b/src/test/ui/feature-gates/feature-gate-static-nobundle.rs index 05c52f9dbea..e4bfe8e8e05 100644 --- a/src/test/ui/feature-gates/feature-gate-static-nobundle.rs +++ b/src/test/ui/feature-gates/feature-gate-static-nobundle.rs @@ -1,5 +1,6 @@ #[link(name = "foo", kind = "static-nobundle")] -//~^ ERROR: kind="static-nobundle" is unstable +//~^ WARNING: library kind `static-nobundle` has been superseded by specifying modifier `-bundle` with library kind `static` +//~^^ ERROR: kind="static-nobundle" is unstable extern "C" {} fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr index 3a3c86c3429..9695618207c 100644 --- a/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr +++ b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr @@ -1,3 +1,9 @@ +warning: library kind `static-nobundle` has been superseded by specifying modifier `-bundle` with library kind `static` + --> $DIR/feature-gate-static-nobundle.rs:1:22 + | +LL | #[link(name = "foo", kind = "static-nobundle")] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0658]: kind="static-nobundle" is unstable --> $DIR/feature-gate-static-nobundle.rs:1:1 | @@ -7,6 +13,6 @@ LL | #[link(name = "foo", kind = "static-nobundle")] = note: see issue #37403 <https://github.com/rust-lang/rust/issues/37403> for more information = help: add `#![feature(static_nobundle)]` to the crate attributes to enable -error: aborting due to previous error +error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr b/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr index 52296042eb4..7bc8efd7e4a 100644 --- a/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `baz` LL | pub mod baz; | ^^^^^^^^^^^^ | - = help: to create the module `baz`, create file "$DIR/auxiliary/foo/bar/baz.rs" + = help: to create the module `baz`, create file "$DIR/auxiliary/foo/bar/baz.rs" or "$DIR/auxiliary/foo/bar/baz/mod.rs" error: aborting due to previous error diff --git a/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr b/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr index 91b3fe15c4b..31e4206a546 100644 --- a/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr +++ b/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `missing` LL | mod missing; | ^^^^^^^^^^^^ | - = help: to create the module `missing`, create file "$DIR/foo/missing.rs" + = help: to create the module `missing`, create file "$DIR/foo/missing.rs" or "$DIR/foo/missing/mod.rs" error: aborting due to previous error diff --git a/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr b/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr index f519de46c76..9d252398b7a 100644 --- a/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr +++ b/src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `missing` LL | mod missing; | ^^^^^^^^^^^^ | - = help: to create the module `missing`, create file "$DIR/foo_inline/inline/missing.rs" + = help: to create the module `missing`, create file "$DIR/foo_inline/inline/missing.rs" or "$DIR/foo_inline/inline/missing/mod.rs" error: aborting due to previous error diff --git a/src/test/ui/native-library-link-flags/empty-kind-1.rs b/src/test/ui/native-library-link-flags/empty-kind-1.rs new file mode 100644 index 00000000000..6f93d38ca93 --- /dev/null +++ b/src/test/ui/native-library-link-flags/empty-kind-1.rs @@ -0,0 +1,6 @@ +// Unspecified kind should fail with an error + +// compile-flags: -l =mylib +// error-pattern: unknown library kind ``, expected one of dylib, framework, or static + +fn main() {} diff --git a/src/test/ui/native-library-link-flags/empty-kind-1.stderr b/src/test/ui/native-library-link-flags/empty-kind-1.stderr new file mode 100644 index 00000000000..2a4a82d538f --- /dev/null +++ b/src/test/ui/native-library-link-flags/empty-kind-1.stderr @@ -0,0 +1,2 @@ +error: unknown library kind ``, expected one of dylib, framework, or static + diff --git a/src/test/ui/native-library-link-flags/empty-kind-2.rs b/src/test/ui/native-library-link-flags/empty-kind-2.rs new file mode 100644 index 00000000000..c0c35577057 --- /dev/null +++ b/src/test/ui/native-library-link-flags/empty-kind-2.rs @@ -0,0 +1,6 @@ +// Unspecified kind should fail with an error + +// compile-flags: -l :+bundle=mylib +// error-pattern: unknown library kind ``, expected one of dylib, framework, or static + +fn main() {} diff --git a/src/test/ui/native-library-link-flags/empty-kind-2.stderr b/src/test/ui/native-library-link-flags/empty-kind-2.stderr new file mode 100644 index 00000000000..2a4a82d538f --- /dev/null +++ b/src/test/ui/native-library-link-flags/empty-kind-2.stderr @@ -0,0 +1,2 @@ +error: unknown library kind ``, expected one of dylib, framework, or static + diff --git a/src/test/ui/parser/mod_file_not_exist.stderr b/src/test/ui/parser/mod_file_not_exist.stderr index 4e08125625f..62456d51880 100644 --- a/src/test/ui/parser/mod_file_not_exist.stderr +++ b/src/test/ui/parser/mod_file_not_exist.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `not_a_real_file` LL | mod not_a_real_file; | ^^^^^^^^^^^^^^^^^^^^ | - = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" + = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` --> $DIR/mod_file_not_exist.rs:7:16 diff --git a/src/test/ui/parser/mod_file_not_exist_windows.stderr b/src/test/ui/parser/mod_file_not_exist_windows.stderr index 73cdf098b00..d5143dbe982 100644 --- a/src/test/ui/parser/mod_file_not_exist_windows.stderr +++ b/src/test/ui/parser/mod_file_not_exist_windows.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `not_a_real_file` LL | mod not_a_real_file; | ^^^^^^^^^^^^^^^^^^^^ | - = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" + = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` --> $DIR/mod_file_not_exist_windows.rs:7:16 diff --git a/src/test/ui/parser/unsafe-mod.stderr b/src/test/ui/parser/unsafe-mod.stderr index 259b2c1d61e..dac6e7a3550 100644 --- a/src/test/ui/parser/unsafe-mod.stderr +++ b/src/test/ui/parser/unsafe-mod.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `n` LL | unsafe mod n; | ^^^^^^^^^^^^^ | - = help: to create the module `n`, create file "$DIR/n.rs" + = help: to create the module `n`, create file "$DIR/n.rs" or "$DIR/n/mod.rs" error: module cannot be declared unsafe --> $DIR/unsafe-mod.rs:1:1 diff --git a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr index e857a1e60e5..dd0dac95e36 100644 --- a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr +++ b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr @@ -4,7 +4,7 @@ error[E0583]: file not found for module `řųśť` LL | mod řųśť; | ^^^^^^^^^ | - = help: to create the module `řųśť`, create file "$DIR/řųśť.rs" + = help: to create the module `řųśť`, create file "$DIR/řųśť.rs" or "$DIR/řųśť/mod.rs" error[E0754]: trying to load file for module `řųśť` with non-ascii identifier name --> $DIR/mod_file_nonascii_forbidden.rs:1:5 |
