| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
Make `(*mut T)::write_bytes` `const`
Tracking issue: #86302
|
|
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.
|
|
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`
|
|
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
|
|
Implement `TryFrom<&'_ mut [T]>` for `[T; N]`
Fixes #91085.
|
|
Eliminate ConstnessAnd again
Closes #91489.
Closes #89432.
Reverts #91491.
Reverts #89450.
r? `@spastorino`
|
|
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.
|
|
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.
|
|
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`
|
|
|
|
Deduplicate projection sub-obligations
|
|
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
|
|
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.
|
|
better span for unexpected normalization failure in CTFE engine
No reason to use `DUMMY_SP` here.
|
|
doc: fix typo in comments
`dereferencable -> dereferenceable`
Fixes #91802.
|
|
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()`.
|
|
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
|
|
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`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit a8387aef8c378a771686878062e544af4d5e2245, reversing
changes made to 6e1211081239be62a5d0bb3bbcb29a9f14621c81.
|
|
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing
changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
|
|
|
|
|
|
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!
|
|
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
|
|
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.
|
|
|
|
dereferencable -> dereferenceable
|
|
Make `Unique`s methods `const`
Tracking issue: None
|
|
Fix zero-sized reference to deallocated memory
fixes #91772
r? `@camelid`
|
|
Remove hir::Node::hir_id.
Small cleanup.
|
|
Do not ICE when suggesting elided lifetimes on non-existent spans.
Fixes https://github.com/rust-lang/rust/issues/91763
r? `@jackh726`
|
|
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.
|
|
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.
|
|
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`
|
|
Make `intrinsics::write_bytes` const
This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.
Tracking issue: #86302
|
|
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()`.
|
|
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.
|