Commit Graph

251290 Commits

Author SHA1 Message Date
Oli Scherer
e522d2906d Stop sorting DefIds in the compiler 2024-03-27 14:02:17 +00:00
Oli Scherer
5676326c72 Sort somem diagnostics by DefPathStr instead of DefId 2024-03-27 14:02:16 +00:00
Oli Scherer
6be79cb103 Sort a diagnostic by DefPathStr instead of DefId 2024-03-27 14:02:16 +00:00
Oli Scherer
57f68c3555 Sort method suggestions by DefPath instead of DefId 2024-03-27 14:02:16 +00:00
Oli Scherer
727807293b Don't sort DefIds in suggestions 2024-03-27 14:02:16 +00:00
Oli Scherer
150a5e5f92 Do not sort DefIds in diagnostics 2024-03-27 14:02:16 +00:00
Oli Scherer
28363ea4eb Remove Partial/Ord from EarlyParamRegion 2024-03-27 14:02:16 +00:00
Oli Scherer
1d662c9eee Remove Partial/Ord from AdtDef 2024-03-27 14:02:16 +00:00
Oli Scherer
459ea32a27 Remove Partial/Ord from BoundRegion 2024-03-27 14:02:16 +00:00
Oli Scherer
e87d10846e Remove Ord from BoundTy 2024-03-27 14:02:16 +00:00
Oli Scherer
dd9fe01d06 Remove Ord from Binder 2024-03-27 14:02:16 +00:00
Oli Scherer
dc95bd69f2 Remove Ord from Ty, Const, and Region 2024-03-27 14:02:16 +00:00
Oli Scherer
939df293d8 Sort diagnostics by rendered trait ref instead of its def ids 2024-03-27 14:02:16 +00:00
Oli Scherer
5ae546e108 Use FxIndexMap instead of BTreeMap to avoid sorting DefIds 2024-03-27 14:02:15 +00:00
Oli Scherer
ae24fef028 Use TraitRef::to_string sorting in favor of TraitRef::ord, as the latter compares DefIds which we need to avoid 2024-03-27 14:02:15 +00:00
Oli Scherer
2707ac9606 Remove unnecessary Partial/Ord derive 2024-03-27 14:02:15 +00:00
Michael Woerister
7e4bc4a373 Remove and disallow HashStable impl of HashMap. 2024-03-27 14:57:01 +01:00
Jules Bertholet
e0da13f25f
Implement mut ref/mut ref mut 2024-03-27 09:53:23 -04:00
bjorn3
41246b2cf6 Remove fixed todos 2024-03-27 13:35:32 +00:00
bjorn3
a64387bb6b Emit DW_AT_external if applicable 2024-03-27 13:28:40 +00:00
DianQK
47ed73a7b5
Eliminate UbCheck for non-standard libraries 2024-03-27 21:02:40 +08:00
bjorn3
98eaaeda11 Match unit names with cg_llvm 2024-03-27 12:57:24 +00:00
Bryanskiy
0cd9708de6 Delegation: fix ICE on wrong instantiation 2024-03-27 15:51:48 +03:00
bjorn3
e48d7d242f Emit namespace debuginfo 2024-03-27 12:43:47 +00:00
Oli Scherer
86e750f0f7 Inline primary_body_of into its sole call site 2024-03-27 11:16:41 +00:00
Oli Scherer
7786ee3c92 Remove a call-site to primary_body_of as it is only interested in the body id 2024-03-27 11:13:34 +00:00
Oli Scherer
d0eb9c86f1 move type inference for missing types on constants into its own method 2024-03-27 11:12:21 +00:00
bjorn3
c76c269aa4 Reduce debuginfo divergence between cg_llvm and cg_clif 2024-03-27 11:04:35 +00:00
Oli Scherer
804c047657 Load missing type of impl associated constant from trait definition 2024-03-27 11:02:53 +00:00
bjorn3
09ec683ae7 Emit DW_AT_frame_base debuginfo attribute 2024-03-27 10:57:13 +00:00
John Kåre Alsaker
9936a399df Add a CurrentGcx type to let the deadlock handler access TyCtxt 2024-03-27 11:44:32 +01:00
bors
10a7aa14fe Auto merge of #123128 - GuillaumeGomez:rollup-3l3zu6s, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #121843 (Implement `-L KIND=`@RUSTC_BUILTIN/...`)`
 - #122860 (coverage: Re-enable `UnreachablePropagation` for coverage builds)
 - #123021 (Make `TyCtxt::coroutine_layout` take coroutine's kind parameter)
 - #123024 (CFI: Enable KCFI testing of run-pass tests)
 - #123083 (lib: fix some unnecessary_cast clippy lint)
 - #123116 (rustdoc: Swap fields and variant documentations)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-27 09:32:38 +00:00
Guillaume Gomez
c0945f0c9e
Rollup merge of #123116 - chloekek:rustdoc-variant-swap-fields-doc, r=GuillaumeGomez
rustdoc: Swap fields and variant documentations

Previously, the documentation for a variant appeared after the documentation for each of its fields. This was inconsistent with structs and unions, and made little sense on its own; fields are subordinate to variants and should therefore appear later in the documentation.

Before:

![Screenshot of rendered documentation before this patch.](https://github.com/rust-lang/rust/assets/50083900/4c98258e-bdf7-4507-9cf1-fe601407ff11)

After:

![Screenshot of rendered documentation after this patch.](https://github.com/rust-lang/rust/assets/50083900/bd223f92-9b06-4b5a-820e-7a8501bdc0e2)
2024-03-27 10:13:44 +01:00
Guillaume Gomez
64a9360d3f
Rollup merge of #123083 - klensy:clippy-me, r=workingjubilee
lib: fix some unnecessary_cast clippy lint

Fixes few instances of `unnecessary_cast` clippy lint
2024-03-27 10:13:44 +01:00
Guillaume Gomez
dc4236d43b
Rollup merge of #123024 - maurer:kcfi-testing, r=workingjubilee
CFI: Enable KCFI testing of run-pass tests

This enables KCFI-based testing for all the CFI run-pass tests in the suite today. We can add the test header on top of in-flight CFI tests once they land. This is becoming more important as we get closer to leveraging CFI's multiple type attachment feature, as that is where the implementations will have a divergence.

It also enables KCFI as a sanitizer for x86_64 and aarch64 Linux to make this possible. The sanitizer should likely be available for all aarch64, x86_64, and riscv targets, but that isn't critical for initial testing.
2024-03-27 10:13:43 +01:00
Guillaume Gomez
bffeb052d1
Rollup merge of #123021 - compiler-errors:coroutine-layout-lol, r=oli-obk
Make `TyCtxt::coroutine_layout` take coroutine's kind parameter

For coroutines that come from coroutine-closures (i.e. async closures), we may have two kinds of bodies stored in the coroutine; one that takes the closure's captures by reference, and one that takes the captures by move.

These currently have identical layouts, but if we do any optimization for these layouts that are related to the upvars, then they will diverge -- e.g. https://github.com/rust-lang/rust/pull/120168#discussion_r1536943728.

This PR relaxes the assertion I added in #121122, and instead make the `TyCtxt::coroutine_layout` method take the `coroutine_kind_ty` argument from the coroutine, which will allow us to differentiate these by-move and by-ref bodies.
2024-03-27 10:13:43 +01:00
Guillaume Gomez
8a7f285cbc
Rollup merge of #122860 - Zalathar:unused, r=cjgillot
coverage: Re-enable `UnreachablePropagation` for coverage builds

This is a sequence of 3 related changes:
- Clean up the existing code that scans for unused functions
- Detect functions that were instrumented for coverage, but have had all their coverage statements removed by later MIR transforms (e.g. `UnreachablePropagation`)
- Re-enable `UnreachablePropagation` in coverage builds

Because we now detect functions that have lost their coverage statements, and treat them as unused, we don't need to worry about `UnreachablePropagation` removing all of those statements. This is demonstrated by `tests/coverage/unreachable.rs`.

Fixes #116171.
2024-03-27 10:13:42 +01:00
Guillaume Gomez
2973f04076
Rollup merge of #121843 - ferrocene:builtin-path, r=petrochenkov
Implement `-L KIND=@RUSTC_BUILTIN/...`

Implements https://github.com/rust-lang/compiler-team/issues/659
2024-03-27 10:13:42 +01:00
bors
0dcc1309d0 Auto merge of #116016 - jhpratt:kill-rustc-serialize, r=ehuss
Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition

cc rust-lang/libs-team#272

Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional).

This does not implement the proposed change for `rustfix`, which I will be looking into shortly.

With regard to the items in the preludes being stable, this should not be an issue because #15702 has been resolved.

r? libs-api
2024-03-27 07:30:36 +00:00
bors
37f97982ca Auto merge of #123121 - matthiaskrgr:rollup-e4glcv3, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #122439 (match lowering: build the `Place` instead of keeping a `PlaceBuilder` around)
 - #122880 (Unix: Support more platforms with `preadv` and `pwritev`)
 - #123038 (std library thread.rs: fix NetBSD code for ILP32 CPUs.)
 - #123084 (`UnixStream`: override `read_buf`)
 - #123102 (RustWrapper: update call for llvm/llvm-project@44d037cc258dcf179d2c48…)
 - #123107 (Implement `Vec::pop_if`)
 - #123118 (Update `RwLock` deadlock example to not use shadowing)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-27 05:22:51 +00:00
Matthias Krüger
bce525323d
Rollup merge of #123118 - tgross35:rwlock-docs, r=workingjubilee
Update `RwLock` deadlock example to not use shadowing

Tweak variable names in the deadlock example to remove any potential confusion that the behavior is somehow shadowing-related.
2024-03-27 05:21:18 +01:00
Matthias Krüger
19a40ec5bf
Rollup merge of #123107 - avandesa:vec_pop_if, r=joboet
Implement `Vec::pop_if`

This PR adds `Vec::pop_if` to the public API, behind the `vec_pop_if` feature.

```rust
impl<T> Vec<T> {
    pub fn pop_if<F>(&mut self, f: F) -> Option<T>
        where F: FnOnce(&mut T) -> bool;
}
```

Tracking issue: #122741

## Open questions

- [ ] Should the first unit test be split up?
- [ ] I don't see any guidance on ordering of methods in impl blocks, should I move the method elsewhere?
2024-03-27 05:21:18 +01:00
Matthias Krüger
fc51dbd379
Rollup merge of #123102 - durin42:llvm-19-pass-ptr, r=workingjubilee
RustWrapper: update call for llvm/llvm-project@44d037cc258dcf179d2c48…

…c93996bb406ecd0fae

Easy change.

`@rustbot` label: +llvm-main
2024-03-27 05:21:17 +01:00
Matthias Krüger
910e23bbbb
Rollup merge of #123084 - a1phyr:unixstream_read_buf, r=workingjubilee
`UnixStream`: override `read_buf`

Split from #122441

r? ``@workingjubilee``
2024-03-27 05:21:17 +01:00
Matthias Krüger
d589021b4b
Rollup merge of #123038 - he32:netbsd-ilp32-fix, r=workingjubilee
std library thread.rs: fix NetBSD code for ILP32 CPUs.
2024-03-27 05:21:16 +01:00
Matthias Krüger
4bdf1711c6
Rollup merge of #122880 - a1phyr:preadv_more_platform, r=workingjubilee
Unix: Support more platforms with `preadv` and `pwritev`

- `aix`, `dragonfly` and `openbsd` with direct call
- `watchos` with weak linkage

cc #89517
2024-03-27 05:21:15 +01:00
Matthias Krüger
a2122dc1e3
Rollup merge of #122439 - Nadrieril:store-built-place, r=compiler-errors
match lowering: build the `Place` instead of keeping a `PlaceBuilder` around

Outside of `MatchPair::new` we don't construct new places, so we don't need to keep a `PlaceBuilder` around.

A bit annoyingly we have to store an `Option<Place>` even though it's never `None` after simplification, but the alternative would be to re-entangle `MatchPair` construction and simplification and I'd rather not do that.
2024-03-27 05:21:15 +01:00
Alexis (Poliorcetics) Bourget
8f9a58c73d
fix: check for client support of relative glob patterns before using them 2024-03-27 03:21:34 +01:00
Trevor Gross
0cd57725f9 Update RwLock deadlock example to not use shadowing
Tweak variable names in the deadlock example to remove any potential
confusion that the behavior is somehow shadowing-related.
2024-03-26 21:40:31 -04:00
bors
435b525514 Auto merge of #122958 - jieyouxu:port-backtrace-dylib-dep, r=workingjubilee
Port backtrace dylib-dep test to a ui test

Original test: [dylib-dep](6fa4b85b99/crates/dylib-dep)
Part of #122899.
2024-03-27 01:08:47 +00:00