rustdoc: use "short form" doc(cfg) printing even when combined with other conditionals
Fixes https://github.com/rust-lang/rust/issues/49334
The original "short form" printing was introduced when `target_feature` was added to the `doc(cfg)` handling. However, it didn't properly propagate the "short form" indicator if the cfg was a combination of multiple conditionals, so the linked issue happened. This changes the handling to use a bool in the original `Html` wrapper, rather than a separate wrapper struct that defers to the original one.
CheckLoopVisitor: also visit closure arguments
This turns the ICE #50581 in this code:
```rust
fn main() {
|_: [u8; break]| ();
}
```
from
```
'assertion failed: self.tcx.sess.err_count() > 0', librustc_typeck/check/mod.rs
```
to
```
librustc_mir/hair/cx/expr.rs:543: invalid loop id for break: not inside loop scope
```
which is an ICE as well but at a later stage during compilation and most importantly
fixes of bug #50576 will fix this as well.
As this "only" moves an ICE to a later stage, I didn't add any tests.
Now I have manually verified the default impls of the visitor trait to check whether we have missed any other opportunity to visit more stuff and coudln't find anything (except the missing `break` visit I've fixed in #50829 but that one was already r+'d so I didn't want to push more commits).
Filter global bounds from ParamEnv again.
This PR adds back the filtering of global bounds from ParamEnv as a temporary solution for #50825.
<details>
Long term, the fix seems like it should be changing the priority in `candidate_should_be_dropped_in_favor_of` so that (global) where clauses aren't considered as highly.
a722296b6e/src/librustc/traits/select.rs (L2017-L2022)
</details>
r? @nikomatsakis
rustc: Fix joint-ness of stringified token-streams
This commit fixes `StringReader`'s parsing of tokens which have been stringified
through procedural macros. Whether or not a token tree is joint is defined by
span information, but when working with procedural macros these spans are often
dummy and/or overridden which means that they end up considering all operators
joint if they can!
The fix here is to track the raw source span as opposed to the overridden span.
With this information we can more accurately classify `Punct` structs as either
joint or not.
Closes#50700
Escape combining characters in char::Debug
Although combining characters are technically printable, they make little sense to print on their own with `Debug`: it'd be better to escape them like non-printable characters.
This is a breaking change, but I imagine the fact `escape_debug` is rare and almost certainly primarily used for debugging that this is an acceptable change.
Resolves#41922.
r? @alexcrichton
cc @clarcharr
Fix issue #50811 (`NaN > NaN` was true).
Fix#50811
Make sure the float comparison output is consistent with the expected behavior when NaN is involved.
----
Note: This PR is a **BREAKING CHANGE**. If you have used `>` or `>=` to compare floats, and make the result as the length of a fixed array type, like:
```rust
use std::f64::NAN;
let x: [u8; (NAN > NAN) as usize] = [1];
```
then the code will no longer compile. Previously, all float comparison involving NaN will just return "Greater", i.e. `NAN > NAN` would wrongly return `true` during const evaluation. If you need to retain the old behavior (why), you may replace `a > b` with `a != a || b != b || a > b`.
stabilize opt-level={s,z}
closes#35784closes#47651
### Rationale
Since the lastest LLVM upgrade rustc / LLVM does more agressive loop unrolling. This results in increased binary size of embedded / no_std programs: a hundreds of bytes increase, or about a 7x increase, in the case of the smallest Cortex-M binary cf. #49260.
As we are shooting for embedded Rust on stable it would be great to also provide a way to optimize for size (which is pretty important for embedded applications that target resource constrained devices) on stable.
Also this has been baking in nightly for a long time.
r? @alexcrichton which team has to sign off this?