about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-06 15:19:39 +0000
committerbors <bors@rust-lang.org>2021-05-06 15:19:39 +0000
commitd44f647ffcff0e1ff2c0f45b6a0ce9796d80f1ca (patch)
tree11e72654b4a65b93a5c4249357b092a0c4293f26 /src
parent109248a4eb99bc83684c94ca4ef36f2fadc17e2a (diff)
parentccc820e1f8eb8d8d142bd93d578bb5c7d9bb6775 (diff)
downloadrust-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')
-rw-r--r--src/doc/unstable-book/src/language-features/native-link-modifiers-as-needed.md18
-rw-r--r--src/doc/unstable-book/src/language-features/native-link-modifiers-bundle.md19
-rw-r--r--src/doc/unstable-book/src/language-features/native-link-modifiers-verbatim.md20
-rw-r--r--src/doc/unstable-book/src/language-features/native-link-modifiers-whole-archive.md18
-rw-r--r--src/doc/unstable-book/src/language-features/native-link-modifiers.md11
-rw-r--r--src/librustdoc/clean/types.rs7
-rw-r--r--src/librustdoc/clean/utils.rs11
-rw-r--r--src/librustdoc/core.rs9
-rw-r--r--src/librustdoc/lib.rs7
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs9
-rw-r--r--src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr1
-rw-r--r--src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr11
-rw-r--r--src/test/ui/error-codes/E0583.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers.rs5
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_verbatim.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-native_link_modifiers_whole_archive.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-static-nobundle.rs3
-rw-r--r--src/test/ui/feature-gates/feature-gate-static-nobundle.stderr8
-rw-r--r--src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr2
-rw-r--r--src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr2
-rw-r--r--src/test/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr2
-rw-r--r--src/test/ui/native-library-link-flags/empty-kind-1.rs6
-rw-r--r--src/test/ui/native-library-link-flags/empty-kind-1.stderr2
-rw-r--r--src/test/ui/native-library-link-flags/empty-kind-2.rs6
-rw-r--r--src/test/ui/native-library-link-flags/empty-kind-2.stderr2
-rw-r--r--src/test/ui/parser/mod_file_not_exist.stderr2
-rw-r--r--src/test/ui/parser/mod_file_not_exist_windows.stderr2
-rw-r--r--src/test/ui/parser/unsafe-mod.stderr2
-rw-r--r--src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr2
m---------src/tools/rust-analyzer36
38 files changed, 241 insertions, 78 deletions
diff --git a/src/doc/unstable-book/src/language-features/native-link-modifiers-as-needed.md b/src/doc/unstable-book/src/language-features/native-link-modifiers-as-needed.md
new file mode 100644
index 00000000000..1757673612c
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/native-link-modifiers-as-needed.md
@@ -0,0 +1,18 @@
+# `native_link_modifiers_as_needed`
+
+The tracking issue for this feature is: [#81490]
+
+[#81490]: https://github.com/rust-lang/rust/issues/81490
+
+------------------------
+
+The `native_link_modifiers_as_needed` feature allows you to use the `as-needed` modifier.
+
+`as-needed` is only compatible with the `dynamic` and `framework` linking kinds. Using any other kind will result in a compiler error.
+
+`+as-needed` means that the library will be actually linked only if it satisfies some undefined symbols at the point at which it is specified on the command line, making it similar to static libraries in this regard.
+
+This modifier translates to `--as-needed` for ld-like linkers, and to `-dead_strip_dylibs` / `-needed_library` / `-needed_framework` for ld64.
+The modifier does nothing for linkers that don't support it (e.g. `link.exe`).
+
+The default for this modifier is unclear, some targets currently specify it as `+as-needed`, some do not. We may want to try making `+as-needed` a default for all targets.
diff --git a/src/doc/unstable-book/src/language-features/native-link-modifiers-bundle.md b/src/doc/unstable-book/src/language-features/native-link-modifiers-bundle.md
new file mode 100644
index 00000000000..ac192cff13a
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/native-link-modifiers-bundle.md
@@ -0,0 +1,19 @@
+# `native_link_modifiers_bundle`
+
+The tracking issue for this feature is: [#81490]
+
+[#81490]: https://github.com/rust-lang/rust/issues/81490
+
+------------------------
+
+The `native_link_modifiers_bundle` feature allows you to use the `bundle` modifier.
+
+Only compatible with the `static` linking kind. Using any other kind will result in a compiler error.
+
+`+bundle` means objects from the static library are bundled into the produced crate (a rlib, for example) and are used from this crate later during linking of the final binary.
+
+`-bundle` means the static library is included into the produced rlib "by name" and object files from it are included only during linking of the final binary, the file search by that name is also performed during final linking.
+
+This modifier is supposed to supersede the `static-nobundle` linking kind defined by [RFC 1717](https://github.com/rust-lang/rfcs/pull/1717).
+
+The default for this modifier is currently `+bundle`, but it could be changed later on some future edition boundary.
diff --git a/src/doc/unstable-book/src/language-features/native-link-modifiers-verbatim.md b/src/doc/unstable-book/src/language-features/native-link-modifiers-verbatim.md
new file mode 100644
index 00000000000..02bd87e5095
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/native-link-modifiers-verbatim.md
@@ -0,0 +1,20 @@
+# `native_link_modifiers_verbatim`
+
+The tracking issue for this feature is: [#81490]
+
+[#81490]: https://github.com/rust-lang/rust/issues/81490
+
+------------------------
+
+The `native_link_modifiers_verbatim` feature allows you to use the `verbatim` modifier.
+
+`+verbatim` means that rustc itself won't add any target-specified library prefixes or suffixes (like `lib` or `.a`) to the library name, and will try its best to ask for the same thing from the linker.
+
+For `ld`-like linkers rustc will use the `-l:filename` syntax (note the colon) when passing the library, so the linker won't add any prefixes or suffixes as well.
+See [`-l namespec`](https://sourceware.org/binutils/docs/ld/Options.html) in ld documentation for more details.
+For linkers not supporting any verbatim modifiers (e.g. `link.exe` or `ld64`) the library name will be passed as is.
+
+The default for this modifier is `-verbatim`.
+
+This RFC changes the behavior of `raw-dylib` linking kind specified by [RFC 2627](https://github.com/rust-lang/rfcs/pull/2627). The `.dll` suffix (or other target-specified suffixes for other targets) is now added automatically.
+If your DLL doesn't have the `.dll` suffix, it can be specified with `+verbatim`.
diff --git a/src/doc/unstable-book/src/language-features/native-link-modifiers-whole-archive.md b/src/doc/unstable-book/src/language-features/native-link-modifiers-whole-archive.md
new file mode 100644
index 00000000000..4961e88cad1
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/native-link-modifiers-whole-archive.md
@@ -0,0 +1,18 @@
+# `native_link_modifiers_whole_archive`
+
+The tracking issue for this feature is: [#81490]
+
+[#81490]: https://github.com/rust-lang/rust/issues/81490
+
+------------------------
+
+The `native_link_modifiers_whole_archive` feature allows you to use the `whole-archive` modifier.
+
+Only compatible with the `static` linking kind. Using any other kind will result in a compiler error.
+
+`+whole-archive` means that the static library is linked as a whole archive without throwing any object files away.
+
+This modifier translates to `--whole-archive` for `ld`-like linkers, to `/WHOLEARCHIVE` for `link.exe`, and to `-force_load` for `ld64`.
+The modifier does nothing for linkers that don't support it.
+
+The default for this modifier is `-whole-archive`.
diff --git a/src/doc/unstable-book/src/language-features/native-link-modifiers.md b/src/doc/unstable-book/src/language-features/native-link-modifiers.md
new file mode 100644
index 00000000000..fc8b5754621
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/native-link-modifiers.md
@@ -0,0 +1,11 @@
+# `native_link_modifiers`
+
+The tracking issue for this feature is: [#81490]
+
+[#81490]: https://github.com/rust-lang/rust/issues/81490
+
+------------------------
+
+The `native_link_modifiers` feature allows you to use the `modifiers` syntax with the `#[link(..)]` attribute.
+
+Modifiers are specified as a comma-delimited string with each modifier prefixed with either a `+` or `-` to indicate that the modifier is enabled or disabled, respectively. The last boolean value specified for a given modifier wins.
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 350742e8f28..47dae63f1fd 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -517,10 +517,9 @@ impl Item {
                                 Some(ExternalLocation::Remote(ref s)) => {
                                     format!("{}/std/", s.trim_end_matches('/'))
                                 }
-                                Some(ExternalLocation::Unknown) | None => format!(
-                                    "https://doc.rust-lang.org/{}/std/",
-                                    crate::doc_rust_lang_org_channel(),
-                                ),
+                                Some(ExternalLocation::Unknown) | None => {
+                                    "https://doc.rust-lang.org/nightly/std/".to_string()
+                                }
                             };
                             // This is a primitive so the url is done "by hand".
                             let tail = fragment.find('#').unwrap_or_else(|| fragment.len());
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index 7235217e290..51a011cf197 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -542,14 +542,3 @@ crate fn has_doc_flag(attrs: ty::Attributes<'_>, flag: Symbol) -> bool {
             && attr.meta_item_list().map_or(false, |l| rustc_attr::list_contains_name(&l, flag))
     })
 }
-
-/// Return a channel suitable for using in a `doc.rust-lang.org/{channel}` format string.
-crate fn doc_rust_lang_org_channel() -> &'static str {
-    match env!("CFG_RELEASE_CHANNEL") {
-        "stable" => env!("CFG_RELEASE_NUM"),
-        "beta" => "beta",
-        "nightly" | "dev" => "nightly",
-        // custom build of rustdoc maybe? link to the stable docs just in case
-        _ => "",
-    }
-}
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index b0d163763b4..7b0c0b66996 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -406,18 +406,15 @@ crate fn run_global_ctxt(
     let mut krate = tcx.sess.time("clean_crate", || clean::krate(&mut ctxt));
 
     if krate.module.doc_value().map(|d| d.is_empty()).unwrap_or(true) {
-        let help = format!(
-            "The following guide may be of use:\n\
-            https://doc.rust-lang.org/{}/rustdoc/how-to-write-documentation.html",
-            crate::doc_rust_lang_org_channel(),
-        );
+        let help = "The following guide may be of use:\n\
+                https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation.html";
         tcx.struct_lint_node(
             crate::lint::MISSING_CRATE_LEVEL_DOCS,
             DocContext::as_local_hir_id(tcx, krate.module.def_id).unwrap(),
             |lint| {
                 let mut diag =
                     lint.build("no documentation found for this crate's top-level module");
-                diag.help(&help);
+                diag.help(help);
                 diag.emit();
             },
         );
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 2a25b595625..169ef015fa8 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -82,8 +82,6 @@ use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGro
 use rustc_session::getopts;
 use rustc_session::{early_error, early_warn};
 
-use crate::clean::utils::doc_rust_lang_org_channel;
-
 /// A macro to create a FxHashMap.
 ///
 /// Example:
@@ -606,10 +604,7 @@ fn usage(argv0: &str) {
     }
     println!("{}", options.usage(&format!("{} [options] <input>", argv0)));
     println!("    @path               Read newline separated options from `path`\n");
-    println!(
-        "More information available at https://doc.rust-lang.org/{}/rustdoc/what-is-rustdoc.html",
-        doc_rust_lang_org_channel()
-    );
+    println!("More information available at https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html")
 }
 
 /// A result type used by several functions under `main()`.
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index c5fb54e52c7..25b6c187f3b 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -2017,14 +2017,7 @@ fn disambiguator_error(
     msg: &str,
 ) {
     diag_info.link_range = disambiguator_range;
-    report_diagnostic(cx.tcx, BROKEN_INTRA_DOC_LINKS, msg, &diag_info, |diag, _sp| {
-        let msg = format!(
-            "see https://doc.rust-lang.org/{}/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators \
-             for more info about disambiguators",
-            crate::doc_rust_lang_org_channel(),
-        );
-        diag.note(&msg);
-    });
+    report_diagnostic(cx.tcx, BROKEN_INTRA_DOC_LINKS, msg, &diag_info, |_diag, _sp| {});
 }
 
 /// Report an ambiguity error, where there were multiple possible resolutions.
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
diff --git a/src/tools/rust-analyzer b/src/tools/rust-analyzer
-Subproject 617535393bb5ccc7adf0bac8a3b9a9c306454e7
+Subproject eb741e895f1a73420a401f2495c711afe37d9d1