about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-12-20rustc_codegen_llvm: move should_use_new_llvm_pass_manager function to llvm_utilAxel Cohen-18/+19
2021-12-13Fix conditions for using legacy or new pm pluginsAxel Cohen-2/+6
2021-12-13Use the existing llvm-plugins option for both legacy and new pm registrationAxel Cohen-24/+25
2021-12-13Add a codegen option to allow loading LLVM pass pluginsAxel Cohen-1/+30
2021-12-13Auto merge of #91569 - erikdesjardins:vt-align, r=nikicbors-7/+56
Attach range metadata to alignment loads from vtables ...because alignment is always nonzero[0]. This helps eliminate redundant runtime alignment checks, when a DST is a field of a struct whose remaining fields have alignment 1. Fixes #91438. --- [0]: The [reference](https://doc.rust-lang.org/reference/type-layout.html) says that alignment must be at least 1. And in practice, the alignment field for all vtables is generated here: https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_middle/src/ty/vtable.rs#L68-L90 and is nonzero because [`Align::bytes()`](https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_target/src/abi/mod.rs#L547-L549) is always nonzero.
2021-12-13Auto merge of #91841 - matthiaskrgr:rollup-zlhsg5a, r=matthiaskrgrbors-59/+110
Rollup of 5 pull requests Successful merges: - #91086 (Implement `TryFrom<&'_ mut [T]>` for `[T; N]`) - #91091 (Stabilize `ControlFlow::{is_break, is_continue}`) - #91749 (BTree: improve public descriptions and comments) - #91819 (rustbot: Add autolabeling for `T-compiler`) - #91824 (Make `(*mut T)::write_bytes` `const`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-13Rollup merge of #91824 - woppopo:const_ptr_write_bytes, r=oli-obkMatthias Krüger-1/+17
Make `(*mut T)::write_bytes` `const` Tracking issue: #86302
2021-12-13Rollup merge of #91819 - rust-lang:compiler-autolabel, r=jackh726Matthias Krüger-0/+9
rustbot: Add autolabeling for `T-compiler` This commit adds autolabeling for the `T-compiler` label, for PRs that modify rustc's source code or tests (currently only `src/test/ui`). This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-13Rollup merge of #91749 - ssomers:btree_comments, r=Mark-SimulacrumMatthias Krüger-55/+58
BTree: improve public descriptions and comments BTreeSet has always used the term "value" next to and meaning the same thing as "elements" (in the mathematical sense but also used for key-value pairs in BTreeMap), while in the BTreeMap sense these "values" are known as "keys" and definitely not "values". Today I had enough of that. r? `@Mark-Simulacrum`
2021-12-13Rollup merge of #91091 - ecstatic-morse:control-flow-enum-is, r=m-ou-seMatthias Krüger-2/+2
Stabilize `ControlFlow::{is_break, is_continue}` The type itself was stabilized in 1.55, but using it is not ergonomic without these helper functions. Stabilize them. r? rust-lang/libs-api
2021-12-13Rollup merge of #91086 - rhysd:issue-91085, r=m-ou-seMatthias Krüger-1/+24
Implement `TryFrom<&'_ mut [T]>` for `[T; N]` Fixes #91085.
2021-12-12Auto merge of #91549 - fee1-dead:const_env, r=spastorinobors-458/+622
Eliminate ConstnessAnd again Closes #91489. Closes #89432. Reverts #91491. Reverts #89450. r? `@spastorino`
2021-12-12rustbot: Add autolabeling for `T-compiler`Noah Lev-0/+9
This commit adds autolabeling for the `T-compiler` label, for PRs that modify rustc's source code or tests (currently only `src/test/ui`). This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-12Auto merge of #90716 - euclio:libloading, r=cjgillotbors-313/+91
replace dynamic library module with libloading This PR deletes the `rustc_metadata::dynamic_lib` module in favor of the popular and better tested [`libloading` crate](https://github.com/nagisa/rust_libloading/). We don't benefit from `libloading`'s symbol lifetimes since we end up leaking the loaded library in all cases, but the call-sites look much nicer by improving error handling and abstracting away some transmutes. We also can remove `rustc_metadata`'s direct dependencies on `libc` and `winapi`. This PR also adds an exception for `libloading` (and its license) to tidy, so this will need sign-off from the compiler team.
2021-12-12Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnrbors-380/+101
Stabilise `feature(const_generics_defaults)` `feature(const_generics_defaults)` is complete implementation wise and has a pretty extensive test suite so I think is ready for stabilisation. needs stabilisation report and maybe an RFC :sweat_smile: r? `@lcnr` cc `@rust-lang/project-const-generics`
2021-12-12clippy owoEllen-12/+11
2021-12-12Auto merge of #90423 - Aaron1011:deduplicate-projection, r=jackh726bors-0/+6
Deduplicate projection sub-obligations
2021-12-12Auto merge of #91825 - matthiaskrgr:rollup-e4s8lwp, r=matthiaskrgrbors-41/+121
Rollup of 6 pull requests Successful merges: - #91746 (Btree: assert more API compatibility) - #91748 (rustdoc: Add regression test for Iterator as notable trait on &mut T) - #91811 (bootstrap: Change unwrap() to expect() for WIX path) - #91814 (doc: fix typo in comments) - #91815 (better span for unexpected normalization failure in CTFE engine) - #91817 (rustbot: Add autolabeling for `T-rustdoc`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-12Rollup merge of #91817 - rust-lang:rustdoc-autolabel, r=Mark-SimulacrumMatthias Krüger-0/+23
rustbot: Add autolabeling for `T-rustdoc` This commit adds autolabeling for the `T-rustdoc` label, for PRs that modify rustdoc's source code, tests, or internal tooling. This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-12Rollup merge of #91815 - RalfJung:span, r=oli-obkMatthias Krüger-2/+2
better span for unexpected normalization failure in CTFE engine No reason to use `DUMMY_SP` here.
2021-12-12Rollup merge of #91814 - japm48:spelling-fix, r=RalfJungMatthias Krüger-32/+32
doc: fix typo in comments `dereferencable -> dereferenceable` Fixes #91802.
2021-12-12Rollup merge of #91811 - itzurabhi:boostrap-dist-wix-unwrap-issue, ↵Matthias Krüger-1/+3
r=Mark-Simulacrum bootstrap: Change unwrap() to expect() for WIX path On Windows, `x.py dist` command panics without proper error message if `WIX` environment variable is not set. This patch changes `Option::unwrap()` to `Option::expect()`.
2021-12-12Rollup merge of #91748 - ↵Matthias Krüger-0/+23
notriddle:notriddle/doc-notable_trait-mut_t_is_not_an_iterator, r=Mark-Simulacrum rustdoc: Add regression test for Iterator as notable trait on &mut T Closes #80737
2021-12-12Rollup merge of #91746 - ssomers:btree_tests, r=Mark-SimulacrumMatthias Krüger-6/+38
Btree: assert more API compatibility Introducing a member such as `BTreeSet::min()` would silently break compatibility if no code calls the existing `BTreeSet::min(set)`. `BTreeSet` is the only btree class silently bringing in stable members, apart from many occurrences of `#[derive(Debug)]` on iterators. r? `@Mark-Simulacrum`
2021-12-12Make `(*mut T)::write_bytes` `const`woppopo-1/+17
2021-12-12Remove function from rebaseDeadbeef-28/+0
2021-12-12Small performance tweaksDeadbeef-9/+9
2021-12-12Remap more env constness for queriesDeadbeef-18/+40
2021-12-12Remap predicate/env constness before queryingDeadbeef-4/+24
2021-12-12Query modifierDeadbeef-0/+72
2021-12-12Add trailing newlineDeadbeef-1/+1
2021-12-12Revert "Auto merge of #89450 - usbalbin:const_try_revert, r=oli-obk"Deadbeef-15/+54
This reverts commit a8387aef8c378a771686878062e544af4d5e2245, reversing changes made to 6e1211081239be62a5d0bb3bbcb29a9f14621c81.
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-424/+400
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-12add regression test for #91489SNCPlay42-0/+40
2021-12-12Fix #91489Deadbeef-1/+24
2021-12-12Auto merge of #89404 - Kobzol:hash-stable-sort, r=Mark-Simulacrumbors-1/+2
Slightly optimize hash map stable hashing I was profiling some of the `rustc-perf` benchmarks locally and noticed that quite some time is spent inside the stable hash of hashmaps. I tried to use a `SmallVec` instead of a `Vec` there, which helped very slightly. Then I tried to remove the sorting, which was a bottleneck, and replaced it with insertion into a binary heap. Locally, it yielded nice improvements in instruction counts and RSS in several benchmarks for incremental builds. The implementation could probably be much nicer and possibly extended to other stable hashes, but first I wanted to test the perf impact properly. Can I ask someone to do a perf run? Thank you!
2021-12-12Auto merge of #91813 - matthiaskrgr:rollup-nryyeyj, r=matthiaskrgrbors-92/+289
Rollup of 8 pull requests Successful merges: - #90081 (Make `intrinsics::write_bytes` const) - #91643 (asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by the current target) - #91737 (Make certain panicky stdlib functions behave better under panic_immediate_abort) - #91750 (rustdoc: Add regression test for Iterator as notable trait on &T) - #91764 (Do not ICE when suggesting elided lifetimes on non-existent spans.) - #91780 (Remove hir::Node::hir_id.) - #91797 (Fix zero-sized reference to deallocated memory) - #91806 (Make `Unique`s methods `const`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-11rustbot: Add autolabeling for `T-rustdoc`Noah Lev-0/+23
This commit adds autolabeling for the `T-rustdoc` label, for PRs that modify rustdoc's source code, tests, or internal tooling. This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-11better span for unexpected normalization failure in CTFE engineRalf Jung-2/+2
2021-12-12doc: fix typo in commentsjapm48-32/+32
dereferencable -> dereferenceable
2021-12-11Rollup merge of #91806 - woppopo:const_unique, r=dtolnayMatthias Krüger-3/+4
Make `Unique`s methods `const` Tracking issue: None
2021-12-11Rollup merge of #91797 - the8472:fix-invalid-deref, r=Mark-SimulacrumMatthias Krüger-4/+6
Fix zero-sized reference to deallocated memory fixes #91772 r? `@camelid`
2021-12-11Rollup merge of #91780 - cjgillot:localize, r=Mark-SimulacrumMatthias Krüger-28/+0
Remove hir::Node::hir_id. Small cleanup.
2021-12-11Rollup merge of #91764 - cjgillot:elide-anyway, r=jackh726Matthias Krüger-21/+78
Do not ICE when suggesting elided lifetimes on non-existent spans. Fixes https://github.com/rust-lang/rust/issues/91763 r? `@jackh726`
2021-12-11Rollup merge of #91750 - ↵Matthias Krüger-0/+21
notriddle:notriddle/doc-notable_trait-mut_t_is_not_ref_t, r=Mark-Simulacrum rustdoc: Add regression test for Iterator as notable trait on &T Closes #78160 This regression test is different from the one in #91748, because while neither of these function should have Iterator marked as a notable trait, the reasons are different. * In this PR, it returns `&T where T: Iterator`. The `mut` is what's missing. * In #91748, it returns `&mut T`. The trait bounds are what's missing.
2021-12-11Rollup merge of #91737 - Manishearth:panic-immediate-stdlib, r=joshtriplettMatthias Krüger-6/+25
Make certain panicky stdlib functions behave better under panic_immediate_abort The stdlib has a `panic_immediate_abort` feature that turns panics into immediate aborts, without any formatting/display logic. This feature was [introduced](https://github.com/rust-lang/rust/pull/55011) primarily for codesize-constrained situations. Unfortunately, this win doesn't quite propagate to `Result::expect()` and `Result::unwrap()`, while the formatting machinery is reduced, `expect()` and `unwrap()` both call `unwrap_failed("msg", &err)` which has a signature of `fn unwrap_failed(msg: &str, error: &dyn fmt::Debug)` and is `#[inline(never)]`. This means that `unwrap_failed` will unconditionally construct a `dyn Debug` trait object even though the object is never used in the function. Constructing a trait object (even if you never call a method on it!) forces rust to include the vtable and any dependencies. This means that in `panic_immediate_abort` mode, calling expect/unwrap on a Result will pull in a whole bunch of formatting code for the error type even if it's completely unused. This PR swaps out the function with one that won't require a trait object such that it won't force the inclusion of vtables in the code. It also gates off `#[inline(never)]` in a bunch of other places where allowing the inlining of an abort may be useful (this kind of thing is already done elsewhere in the stdlib). I don't know how to write a test for this; we don't really seem to have any tests for `panic_immediate_abort` anyway so perhaps it's fine as is.
2021-12-11Rollup merge of #91643 - Amanieu:r9x18, r=joshtriplettMatthias Krüger-28/+83
asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by the current target This supersedes https://github.com/rust-lang/rust/pull/88879. cc `@Skirmisher` r? `@joshtriplett`
2021-12-11Rollup merge of #90081 - woppopo:const_write_bytes, r=oli-obkMatthias Krüger-2/+72
Make `intrinsics::write_bytes` const This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`. Tracking issue: #86302
2021-12-12bootstrap: Change `unwrap()` to `expect()` for `WIX` pathAbhishek Sudhakaran-1/+3
On Windows, `x.py dist` command panics without proper error message if 'WIX' environment variable is not set. This patch changes `Option::unwrap()` to `Option::expect()`.
2021-12-11Auto merge of #91769 - estebank:type-trait-bound-span-2, r=oli-obkbors-257/+503
Tweak assoc type obligation spans * Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors r? `@oli-obk` This is a(n uncontroversial) subset of #85799.