CTFE: support assert_zero_valid and assert_uninit_valid
This ensures the implementation of all three type-based assert_ intrinsics remains consistent in Miri.
`assert_inhabited` recently got stabilized in https://github.com/rust-lang/rust/pull/90896 (meaning stable `const fn` can call it), so do the same with these other intrinsics.
Cc ```@rust-lang/wg-const-eval```
tests: Ignore `test/debuginfo/rc_arc.rs` on windows-gnu
The tests checks some pretty-printer output, but pretty-printers are not embedded on windows-gnu.
Regressed in https://github.com/rust-lang/rust/pull/85448.
Refactor EmitterWriter::emit_suggestion_default
Makes progress towards https://github.com/rust-lang/rust/issues/89979
Split into 2 commits:
* the first commit is purely a refactor and I verified that `./x.py test src/test/ui --stage 1` and `./x.py test src/test/rustdoc-ui --stage 1` continue to pass on this commit.
* ~~the second commit removes the empty trailing line from diff style suggestions.~~ - I discovered an issue with this so its just the refactor now.
r? diagnostics
Update cargo
6 commits in 7f08ace4f1305de7f3b1b0e2f765911957226bd4..294967c53f0c70d598fc54ca189313c86c576ea7
2021-11-24 17:54:39 +0000 to 2021-11-29 19:04:22 +0000
- Fix some tests with output collisions. (rust-lang/cargo#10137)
- Description of the targets that can be applied (rust-lang/cargo#10109)
- Improve unused patch message when source URLs mismatched (rust-lang/cargo#10130)
- Add a note about doctest xcompile. (rust-lang/cargo#10132)
- book: add edit links to specific pages (rust-lang/cargo#10124)
- Add crate type flag to rustc command (rust-lang/cargo#10093)
Eliminate bunch of copies of error codepath from Utf8LossyChunksIter
Using a macro to stamp out 7 identical copies of the nontrivial slicing logic to exit this loop didn't seem like a necessary use of a macro. The early return case can be handled by `break` without practically any changes to the logic inside the loop.
All this code is from early 2014 (#12062—nearly 8 years ago; pre-1.0) so it's possible there were compiler limitations that forced the macro way at the time.
Confirmed that `x.py bench library/alloc --stage 0 --test-args from_utf8_lossy` is unaffected on my machine.
Take a LocalDefId in expect_*item.
Items and item-likes are always HIR owners.
When trying to find such nodes, there is no ambiguity, the `LocalDefId` and the `HirId::owner` always match.
In such cases, `local_def_id_to_hir_id` does not carry any meaningful information, so we can just skip calling it altogether.
Accumulate all values of `-C remark` option
When `-C remark=...` option is specified multiple times,
accumulate all values instead of using only the last one.
r? `@nikic`
Add demonstration test for #91161
Since cross-crate things are hard to demonstrate in playground, here's a test showing that something currently works that shouldn't.
cc https://github.com/rust-lang/rust/issues/91161 that tracks fixing the problem (and updating this test)
Emit LLVM optimization remarks when enabled with `-Cremark`
The default diagnostic handler considers all remarks to be disabled by
default unless configured otherwise through LLVM internal flags:
`-pass-remarks`, `-pass-remarks-missed`, and `-pass-remarks-analysis`.
This behaviour makes `-Cremark` ineffective on its own.
Fix this by configuring a custom diagnostic handler that enables
optimization remarks based on the value of `-Cremark` option. With
`-Cremark=all` enabling all remarks.
Fixes#90924.
r? `@nikic`
Fix ICE when lowering `trait A where for<'a> Self: 'a`
Fixes#88586.
r? `@jackh726`
Jack, this fix is much smaller in scope than what I think you were proposing in the issue. Let me know if you had a vision for a larger refactor here.
cc `@JohnTitor`
Perform Sync check on static items in wf-check instead of during const checks
r? `@RalfJung`
This check is solely happening on the signature of the static item and not on its body, therefor it belongs into wf-checking instead of const checking.