When encountering `_` type placeholder in fn arguments and return type,
suggest using generic type parameters.
Expand what counts as an inferable return type to slice, array and
tuples of `_`.
Work around a resolve bug in const prop
r? @wesleywiser @anp
This isn't exposed right now, but further changes to rustc may start causing bugs without this.
This extends the existing logic which skips validating every integer or
floating point number type to also skip validating empty structs because
they are also trivially valid.
Fixes#67539
Refactor expression parsing thoroughly
Based on https://github.com/rust-lang/rust/pull/66994 together with which this has refactored basically the entirety of `expr.rs`.
r? @estebank
Teach `compiletest` to ignore platform triples
The UI tests are written assuming `--remap-path-prefix` is *not used* (`remap-debuginfo` in `config.toml`). The consequence is that the error messages may include paths and snippets into the standard library. When `remap-debuginfo` is enabled, these messages change in format and structure because `rustc` will not show paths and snippets into the standard library.
This normally isn't a problem for the "main" platforms (linux/macos/windows), because the CI infrastructure is set up so that the tests run without `remap-debuginfo`, but the `dist` artifacts are built separately with `remap-debuginfo` enabled. However, some of the lower-tier platforms perform both tests and distribution in a single step with `remap-debuginfo` enabled. This also affects developers and distributors who use `remap-debuginfo`.
To sidestep this problem, we add a way to ignore tests in specific platform triples, and update the overly broad `ignore-x86` rule in affected tests.
Address #46948, #54546, #53081.
doc comments: Less attribute mimicking
Make sure doc comments are not converted into intermediate meta-items, or not mixed with `doc(inline)` or something like that.
Follow-up to https://github.com/rust-lang/rust/pull/65750.
During MIR interpretation it may happen that a place containing
uninitialized bytes is copied. This would read the current
representation of these bytes and write it to the destination even
though they must, by definition, not matter to the execution.
This elides that representation change when no bytes are defined in such
a copy, saving some cpu cycles. In such a case, the memory of the target
allocation is not touched at all which also means that sometimes no
physical page backing the memory allocation of the representation needs
to be provided by the OS at all, reducing memory pressure on the system.
prune ill-conceived BTreeMap iter_mut assertion and test its mutability
Proposal to deal with #67438 (and I'm more sure now that this is the right thing to do).
Passes testing with miri.
Document safety of Path casting
I would personally feel more comfortable making the relevant (internal anyway) types repr(transparent) and then documenting that we can make these casts because of that, but I believe this is a more minimal PR, so posting it first.
Resolves#45910.