| Age | Commit message (Collapse) | Author | Lines |
|
use by ref TokenTree iterator to avoid a few clones
Just a handful of swaps from the by-value cursor to by-ref cursor so as to avoid some unnecessary clones.
I've been doing some analysis on internal cleanup opportunities within rustfmt and as part of that yak-shave I found myself perusing broader token stream and tree usage (which we use within rustfmt). As reflected in some inline comments on the cursor structs (not part of this diff), there's probably many other such cases throughout the code, but figured I'd start small with these while I had the time. May take a look at the other sites in the future
|
|
Don't ICE in layout computation for placeholder types
We use `layout_of` for the built-in `PointerLike` trait to check if a type can be coerced to a `dyn*`.
Since the new solver canonicalizes parameter types to placeholders, that code needs to be able to treat placeholders like params, and for the most part it does, **except** for a call to `is_trivially_sized`. This PR fixes that.
|
|
Update cargo
2 commits in 26b73d15a68fb94579f6d3590585ec0e9d81d3d5..13413c64ff88dd6c2824e9eb9374fc5f10895d28
2023-05-09 20:28:03 +0000 to 2023-05-10 13:46:18 +0000
* Update libc to 0.2.144 (rust-lang/cargo#12098)
* changelog: add entries of some behavior changes (rust-lang/cargo#12119)
r? ``````@weihanglo``````
|
|
Verify copies of mutable pointers in 2 stages in ReferencePropagation
Fixes #111422
In the first stage, we mark the copies as reborrows, to be checked later.
In the second stage, we walk the reborrow chains to verify that all stages are fully replacable.
The replacement itself mirrors the check, and iterates through the reborrow chain.
r? ``````@RalfJung``````
cc ``````@JakobDegen``````
|
|
bump windows crate 0.46 -> 0.48
This drops duped version of crate(0.46), reduces `rustc_driver.dll` ~800kb and reduces exported functions number from 26k to 22k.
Also while here, added `tidy-alphabetical` sorting to lists in tidy allowed lists.
|
|
Fix instrument-coverage tests by using Python to sort instantiation groups
#110942 was intended to fix a set of `-Cinstrument-coverage` tests, but it ended up silently *breaking* those tests on Linux, for annoying reasons detailed at #111171.
Dealing with `diff --ignore-matching-lines` across multiple platforms has been such a hassle that I've instead written a simple Python script that can detect instantiation groups in the output of `llvm-cov show`, and sort them in a predictable order so that they can be used as snapshots for an ordinary invocation of `diff`.
This approach should be much less error-prone, because it can't accidentally ignore the wrong lines, and any unforeseen problems will tend to result in a Python exception or a failing diff.
|
|
|
|
Sync portable-simd to 2023 May 10
Take 2.
r? `@ghost`
|
|
|
|
|
|
Simplify the implementation of iterators over slices of ZSTs
Currently, slice iterators over ZSTs store `end = start.wrapping_byte_add(len)`.
That's slightly convenient for `is_empty`, but kinda annoying for pretty much everything else -- see bugs like #42789, for example.
This PR instead changes it to just `end = ptr::invalid(len)` instead.
That's easier to think about (IMHO, at least) as well as easier to represent.
`next` is still to big to get inlined into the mir-opt/pre-codegen/ tests, but if I bump the inline threshold to force it to show the whole thing, this implementation is also less MIR:
```
> git diff --numstat
241 370 tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.mir
255 329 tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.mir
184 216 tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.mir
182 254 tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.mir
```
(That's ≈70 lines less for `Iter::next`, for example.)
r? `@ghost`
~~Built atop #111282, so draft until that lands.~~
|
|
It isn't clear to me why these error patterns do not trigger,
but I am not going to waste time analyzing bugs in compiletest.
|
|
API changes resulted in subtle MIR and impl differences
|
|
Sync up to rust-lang/portable-simd@852762563aa890286eda2f668b8af30f8aa84216
|
|
update Miri
r? `@ghost`
|
|
Shrink `SelectionError` a lot
`SelectionError` used to be 80 bytes (on 64 bit). That's quite big. Especially because the selection cache contained `Result<_, SelectionError>. The Ok type is only 32 bytes, so the 80 bytes significantly inflate the size of the cache.
Most variants of the `SelectionError` seem to be hard errors, only `Unimplemented` shows up in practice (for cranelift-codegen, it occupies 23.4% of all cache entries). We can just box away the biggest variant, `OutputTypeParameterMismatch`, to get the size down to 16 bytes, well within the size of the Ok type inside the cache.
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #108705 (Prevent ICE with broken borrow in closure)
- #111292 (Fix mishandled `--check-cfg` arguments order)
- #111382 (Isolate coverage FFI type layouts from their underlying LLVM C++ types)
- #111385 (vec-shrink-panik: update expectations to work on LLVM 17)
- #111389 (Add esp-idf platform-support page)
- #111432 (Use visit_assign to detect SSA locals.)
- #111448 (Use proper impl self type for alias impl in rustdoc)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use proper impl self type for alias impl in rustdoc
We don't want to use `type_of(type_alias)`, we want to use `type_of(impl)` -- this will give us the self type of the impl *properly substituted* in the case that it's an alias.
Fixes #111420
|
|
Use visit_assign to detect SSA locals.
I screwed up the logic in 3c43b61b870add2daddbd8e480477e5a8aa409c2.
Fixes https://github.com/rust-lang/rust/issues/111426
|
|
Add esp-idf platform-support page
As mentioned in https://github.com/rust-lang/rust/pull/111369#issuecomment-1539881848, the initial PR for esp-idf didn't include a platform support document which is required for the merge of https://github.com/rust-lang/rust/pull/111369.
|
|
vec-shrink-panik: update expectations to work on LLVM 17
For some reason, the called function is `cleanup` on LLVM 17 instead of `filter`.
r? `@Amanieu`
|
|
Isolate coverage FFI type layouts from their underlying LLVM C++ types
I noticed that several of the types used to send coverage information through FFI are not properly isolated from the layout of their corresponding C++ types in the LLVM API.
This PR adds more explicitly-defined FFI struct/enum types in `CoverageMappingWrapper.cpp`, so that Rust source files in `rustc_codegen_ssa` and `rustc_codegen_llvm` aren't directly exposed to LLVM C++ types.
|
|
Fix mishandled `--check-cfg` arguments order
This PR fixes a bug in `--check-cfg` where the order of `--check-cfg=names(a)` and `--check-cfg=values(a,…)` would trip the compiler.
Fixes https://github.com/rust-lang/rust/issues/111291
cc `@taiki-e` `@petrochenkov`
|
|
Prevent ICE with broken borrow in closure
r? `@Nilstrieb`
Fixes #108683
This solution isn't ideal, I'm hoping to find a way to continue compilation without ICEing.
|
|
|
|
Optimize dataflow-const-prop place-tracking infra
Optimization opportunities found while investigating https://github.com/rust-lang/rust/pull/110719
Computing places breadth-first ensures that we create short projections before deep projections, since the former are more likely to be propagated.
The most relevant is the pre-computation of flooded places. Callgrind showed `flood_*` methods and especially `preorder_preinvoke` were especially hot. This PR attempts to pre-compute the set of `ValueIndex` that `preorder_invoke` would visit.
Using this information, we make some `PlaceIndex` inaccessible when they contain no `ValueIndex`, allowing to skip computations for those places.
cc `@jachris` as original author
|
|
Currently, slice iterators over ZSTs store `end = start.wrapping_byte_add(len)`.
That's slightly convenient for `is_empty`, but kinda annoying for pretty much everything else -- see bugs like 42789, for example.
This PR instead changes it to just `end = ptr::invalid(len)` instead.
That's easier to think about (IMHO, at least) as well as easier to represent.
|
|
|
|
|
|
|
|
Include the current Crate name in the measureme output name
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/measureme.20flamegraph.20panics/near/356367013
cc `@andjo403`
Currently, attempting to use `MIRIFLAGS=-Zmiri-measureme=miri cargo miri test` on a crate with multiple test targets (which is very common) will produce a corrupted measureme output file, because the various interpreter processes will stomp each other's output.
This change does not entirely prevent this, but the various test targets seem to always have different crate names, so if nothing else this will make the broken measureme files much harder to encounter by accident, while also making it clear what they are all for.
|
|
|
|
|
|
|
|
- disable the AVX512 variant for now (flaky)
- tell Clippy to knock it off
|
|
|
|
- Fix LANES over-replace
- Bring in traits
- Use less inference-heavy types
|
|
For some reason, the called function is `cleanup` on LLVM 17 instead of
`filter`.
r? @Amanieu
|
|
Don't force include Windows goop when documenting
Why do we need to include all the windows bits on non-windows platforms? Let's try not doing that.
Possible alternative to #111394, if it works.
|
|
Rustup
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #110673 (Make alias bounds sound in the new solver (take 2))
- #110747 (Encode types in SMIR)
- #111095 (Correctly handle associated items of a trait inside a `#[doc(hidden)]` item)
- #111381 (Keep encoding attributes for closures)
- #111408 (Fix incorrect implication of transmuting slices)
- #111410 (Switch to `EarlyBinder` for `thir_abstract_const` query)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
Thorough merge after GC: fix of #2863
Context: #2863.
`perf report`s of `MIRIFLAGS=-Zmiri-tree-borrows cargo +miri miri test test_invalid_name_lengths` in crate `http`:
### Pre
```
91.06% rustc miri [.] miri::borrow_tracker::tree_borrows::tree::Tree::keep_only_needed
2.99% rustc miri [.] miri::borrow_tracker::tree_borrows::tree::TreeVisitor::traverse_parents_this
0.91% rustc miri [.] miri::borrow_tracker::tree_borrows::tree::Tree::perform_access
0.62% rustc miri [.] miri::range_map::RangeMap<T>::iter_mut
0.17% rustc libc.so.6 [.] realloc
0.14% rustc miri [.] miri::concurrency::thread::EvalContextExt::run_threads
0.13% rustc miri [.] rustc_const_eval::interpret::operand::<impl rustc_const_eval::interpret::eva
0.13% rustc miri [.] hashbrown::raw::RawTable<T,A>::remove_entry
0.10% rustc miri [.] miri::intptrcast::GlobalStateInner::alloc_base_addr
0.08% rustc librustc_driver-c82c1dc22c817a10.so [.] <rustc_middle::mir::Body>::source_info
```
Interrupted after 3min 30s.
### Post
```
20.75% rustc miri [.] miri::borrow_tracker::tree_borrows::tree::TreeVisitor::traverse_parents_this
18.50% rustc miri [.] miri::borrow_tracker::tree_borrows::tree::Tree::keep_only_needed
6.49% rustc miri [.] miri::borrow_tracker::tree_borrows::tree::Tree::perform_access
4.25% rustc miri [.] miri::range_map::RangeMap<T>::iter_mut
1.91% rustc libc.so.6 [.] realloc
1.79% rustc miri [.] miri::concurrency::thread::EvalContextExt::run_threads
1.40% rustc miri [.] rustc_const_eval::interpret::operand::<impl rustc_const_eval::interpret::eva
1.40% rustc miri [.] miri::range_map::RangeMap<T>::merge_adjacent_thorough
1.34% rustc miri [.] miri::intptrcast::GlobalStateInner::alloc_base_addr
0.90% rustc librustc_driver-c82c1dc22c817a10.so [.] <rustc_middle::ty::context::CtxtInterners>::intern_ty
```
Terminates after 1min 13s.
No significant changes to `./miri bench` in either direction: on small benches not enough garbage accumulates for this to be relevant.
|
|
Switch to `EarlyBinder` for `thir_abstract_const` query
Part of the work to finish https://github.com/rust-lang/rust/issues/105779.
This PR adds `EarlyBinder` to the return type of the `thir_abstract_const` query and removes `bound_abstract_const`.
r? `@compiler-errors`
|