Fix -Wpessimizing-move warnings in rustllvm/PassWrapper
These are producing warnings when building rustc (`warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]`).
Fix From<LocalWaker>
This is a follow-up to https://github.com/rust-lang/rust/pull/52640
Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)
r? @cramertj
[NLL] Don't make "fake" match variables mutable
These variables can't be mutated by the user, but since they have names the unused-mut lint thinks that it should check them.
Update clippy to latest master
r? @oli-obk
There is a regression in the version in current nightly that falsely lints `println!` and `writeln!` that use named arguments, thinking all rhs values for the argument expressions are literals even when they are not. This update includes the fix for that.
Document From trait implementations for OsStr, OsString, CString, and CStr
As part of issue #51430 (cc @skade).
The allocation and copy claims should be double-checked.
r? @steveklabnik
rustc: Disallow machine applicability in foreign macros
Recent changes to lints disallowed lints from being emitted against code located
in foreign macros, except for future-incompatible lints. For a future
incompatible lint, however, the automatic suggestions may not be applicable!
This commit updates this code path to force all applicability suggestions made
to foreign macros to never be `MachineApplicable`. This should avoid rustfix
actually attempting fixing these suggestions, causing non-compiling code to be
produced.
Closesrust-lang/cargo#5799
It is not required for LLVM to have SPARC target support, so it is
necessary to only run this test when LLVM does support SPARC. Sadly, it
isn’t possible to specify exactly this constraint. Instead, we specify
that this test should run on SPARC host only (it surely is sane
assumption to make that compiler running on a SPARC can generate
SPARC, right?)
Since you cannot specify multiple `only-*` to have it run on both 32-bit
and 64-bit SPARC we pick 64-bit SPARC, because it is exactly what is
being tested by this test.
Fixes#52881
Previously linker diagnostic were being hidden when two modules were linked
together but failed to link. This commit fixes the situation by ensuring that we
have a diagnostic handler installed and also adds support for handling linker
diagnostics.
Parsing the code block's LangString (```foo) previously checked itself
to see if we were on nightly; that isn't the right place to do so. Move
that check slightly outwards to better abstract LangString.
(This is also an optimization as we avoid the costly environment
variable load of RUSTC_BOOTSTRAP).
* Arguably this change is sometimes injecting noise into the output
(namely in the cases where the suggested rewrite is inline with the
suggestion and we end up highlighting the original source code).
I would not be opposed to something more aggressive/dynamic, like
revising the suggestion code to automatically print the original
source when necessary (e.g. when the error does not have a span
that includes the span of the suggestion).
* Also, as another note on this change: The doc comment for `Diagnostic::span_suggestion`
says:
/// The message
///
/// * should not end in any punctuation (a `:` is added automatically)
/// * should not be a question
/// * should not contain any parts like "the following", "as shown"
but the `:` is *not* added when the emitted line appears
out-of-line relative to the suggestion. I find that to be an
unfortunate UI experience.
----
As a drive-by fix, also changed code to combine multiple suggestions
for a pattern into a single multipart suggestion (which vastly
improves user experience IMO).
----
Includes the updates to expected NLL diagnostics.