Calculate Vec capacities in librustc
Calculate the required capacity of a few vectors in rustc based on the number of elements they are populated with.
Fix docker/run.sh script when run locally
Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is
being run locally and has previously executed.
rustc: Fix two custom attributes with custom derive
This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.
The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.
Closes#52525
rustc: Remove a workaround in ThinLTO fixed upstream
This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!
[1]: https://bugs.llvm.org/show_bug.cgi?id=35736
fix unsafety: don't call ptr_rotate for ZST
`rotate::ptr_rotate` has a comment saying
```
/// # Safety
///
/// The specified range must be valid for reading and writing.
/// The type `T` must have non-zero size.
```
So we better make sure we don't call it on ZST...
Cc @scottmcm (author of https://github.com/rust-lang/rust/pull/41670)
stabilize lint handling in rustdoc
When https://github.com/rust-lang/rust/pull/51732 added CLI flags to manipulate lints in rustdoc, they were added as unstable flags. This made sense as they were new additions, but since they mirrored the flags that rustc has, it's worth considering them to not need an unstable period.
Stabilizing them also provides the opportunity for a critical fix: allowing Cargo to pass `--cap-lints allow` when documenting dependencies, the same as when it compiles them.
r? @rust-lang/rustdoc
Const propagate casts
fixes#49760
So... This fixes the original issue about the missing warnings.
But our test suite contains fun things like
```rust
fn foo() {}
assert_eq!(foo as i16, foo as usize as i16);
```
Which, will result in
> a raw memory access tried to access part of a pointer value as raw bytes
on both sides of the assertion. Because well... that's exactly what's going on! We're ripping out 16 bits of a pointer.
Categorize queries for later self-profiling
Change the define_queries! macro per feedback on #51657.
Big thanks to @mark-i-m for the help getting the macro changes correct!
I'm pulling this commit out of the other PR because it's hard to keep up-to-date as queries are added or changed.
r? @nikomatsakis