Simplify the signature of par_for_each_in
Given `T: IntoIterator`/`IntoParallelIterator`, `T::Item` is
unambiguous, so we don't need the explicit trait casting.
resolve: `lifetimes.rs` -> `late/lifetimes.rs`
Lifetime resolution should ideally be merged into the late resolution pass, at least for named lifetimes.
Let's move it closer to it for a start.
Backport only: avoid ICE on bad placeholder type
#69148 has a proper fix, but it is too big to backport.
This change avoids the ICE by actually emitting an appropriate error. The
output will be duplicated in some cases, but that's better than the
avoidable ICE.
r? @Centril
The hash tests were written before the assert_ne macro was added to the standard library. The assert_ne macro provides better output in case of a failure.
This reverts commit d78b22f35e.
Those changes were incompatible with incremental compilation since the
effect `check_mod_attrs` has with respect to marking the attributes as
used is neither persisted nor recomputed.
Generalized article_and_description
r? @matthewjasper
The logic of finding the right word and article to print seems to be repeated elsewhere... this is an experimental method to unify this logic...
Rollup of 5 pull requests
Successful merges:
- #68712 (Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference)
- #69209 (Miscellaneous cleanup to formatting)
- #69381 (Allow getting `no_std` from the config file)
- #69434 (rustc_metadata: Use binary search from standard library)
- #69447 (Minor refactoring of statement parsing)
Failed merges:
r? @ghost
Allow getting `no_std` from the config file
Currently, it is only set correctly in the sanity checking implicit
default fallback code. Having a config file at all will for force
`no_std = false`.
Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference
Usually, references to the interior are only created by the `Deref` and
`DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell`
already has to cope with leaks of such guards which, when it occurs,
effectively makes it impossible to ever acquire a mutable guard or any
guard for `Ref` and `RefMut` respectively. It is already safe to use
this to create a reference to the inner of the ref cell that lives as
long as the reference to the `RefCell` itself, e.g.
```rust
fn leak(r: &RefCell<usize>) -> Option<&usize> {
let guard = r.try_borrow().ok()?;
let leaked = Box::leak(Box::new(guard));
Some(&*leaked)
}
```
The newly added methods allow the same reference conversion without an
indirection over a leaked allocation. It's placed on the `Ref`/`RefMut` to
compose with both borrow and try_borrow directly.
Audit liballoc for leaks in `Drop` impls when user destructor panics
Inspired by https://github.com/rust-lang/rust/pull/67243 and https://github.com/rust-lang/rust/pull/67235, this audits and hopefully fixes the remaining `Drop` impls in liballoc for resource leaks in the presence of panics in destructors called by the affected `Drop` impl.
This does not touch `Hash{Map,Set}` since they live in hashbrown. They have similar issues though.
r? @KodrAus
Mark attributes consumed by `check_mod_attrs` as normal
Take advantage of the fact that `check_mod_attrs` marks attributes as
used and change their type to normal, so that any remaining uses will be
warned about by the unused attribute lint.
Deduplicate identifier printing a bit
https://github.com/rust-lang/rust/pull/67010 introduced a couple more subtly different ways to print an identifier.
This PR attempts to restore the order.
The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required.
r? @Mark-Simulacrum
Add primitive module to libcore
This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.
Fixes#44865
Cherry-pick the LLVM fix for #69225
An additional reproducer was provided in #69225 -- the new testcase here -- which still crashes even after #69241 reverted #67174. Now this pull request updates LLVM with the cherry-picked reversion of its own. This is also going to stable in #69444.
I have not tried to reapply #67174 yet -- cc @kraai @shahn
Update Clippy from 8fbb23f to fc5d0ccFixes#69419
```
Fix false positive in `missing_const_for_fn`
Rustup to rust-lang/rust#69366
Add new lint [`wildcard imports`]. Add suggestion to [`enum_glob_use`]
Add new lint `lossy_float_literal` to detect lossy whole number float literals
```
Rollup of 6 pull requests
Successful merges:
- #69220 (Add documentation for the `-Zself-profile` flag)
- #69391 (Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping`)
- #69427 (Cleanup e0368 e0369)
- #69433 (don't explicitly compare against true or false)
- #69435 (Replace uses of Cell::get + Cell::set with Cell::replace.)
- #69437 (no more codegen for miri_start_panic)
Failed merges:
r? @ghost