Commit Graph

250368 Commits

Author SHA1 Message Date
Matthias Krüger
bd2d70dd0a add test for ice #119275 "no entry found for key" in predicates_of.rs
fixes #119275
2024-03-22 08:45:03 +01:00
Matthias Krüger
b0e10083f3 add test for ice #113017 no entry found for key in generics_of.rs
Fixes #113017
2024-03-22 08:38:26 +01:00
Matthias Krüger
d7e166d408 add test for ice "type mismatching when copying!"
Fixes #112824
2024-03-22 08:31:01 +01:00
Matthias Krüger
2b5740371c add test for https://github.com/rust-lang/rust/issues/112823
Fixes #112823
2024-03-22 08:27:14 +01:00
Matthias Krüger
4d9ce7a1a2 add test for ice #121472
Fixes #121472
2024-03-22 08:19:44 +01:00
Matthias Krüger
1bcbed19d1 add test for #110696
Fixes #110696
2024-03-22 08:13:54 +01:00
bors
7762adccb2 Auto merge of #122456 - maurer:cfi-nonpassed, r=workingjubilee
CFI: Skip non-passed arguments

Rust will occasionally rely on fn((), X) -> Y being compatible with fn(X) -> Y, since () is a non-passed argument. Relax CFI by choosing not to encode non-passed arguments.

This PR was split off from #121962 as part of fixing the larger vtable compatibility issues.

r? `@workingjubilee`
2024-03-22 06:09:40 +00:00
León Orell Valerian Liehr
5e73a8b2f1
Notify fmease on changes to HIR ty lowering 2024-03-22 06:32:51 +01:00
León Orell Valerian Liehr
72472c831c
Arrange methods on HirTyLowerer more logically
This makes it easier to read the trait definition for newcomers:
Sorted from least “complex” to most “complex” followed by trivial “plumbing”
and grouped by area.

* Move `allow_infer` above all `*_infer` methods
  * It's the least complex method of those
  * Allows the `*_infer` to be placed right next to each other
* Move `probe_ty_param_bounds` further down right next to `lower_assoc_ty` and `probe_adt`
  * It's more complex than the `infer` methods, it should come “later”
  * Now all required lowering functions are grouped together
* Move the “plumbing” function `set_tainted_by_errors` further down
  below any actual lowering methods.
* Provided method should come last
2024-03-22 06:32:51 +01:00
León Orell Valerian Liehr
6d5a93949a
Rename module astconv to hir_ty_lowering
Split from the main renaming commit to make git generate a proper diff for ease of reviewing.
2024-03-22 06:32:49 +01:00
León Orell Valerian Liehr
b79335dbed
Update local variables and tracing calls
Most of the tracing calls didn't fully leverage the power of `tracing`.
For example, several of them used to hard-code method names / tracing spans
as well as variable names. Use `#[instrument]` and `?var` / `%var` (etc.) instead.

In my opinion, this is the proper way to migrate them from the old
AstConv nomenclature to the new HIR ty lowering one.
2024-03-22 06:32:23 +01:00
León Orell Valerian Liehr
82c2c8deb1
Update (doc) comments
Several (doc) comments were super outdated or didn't provide enough context.

Some doc comments shoved everything in a single paragraph without respecting
the fact that the first paragraph should be a single sentence because rustdoc
treats these as item descriptions / synopses on module pages.
2024-03-22 06:31:51 +01:00
León Orell Valerian Liehr
05d48b936f
Rename AstConv to HIR ty lowering
This includes updating astconv-related items and a few local variables.
2024-03-22 06:31:40 +01:00
bors
cdb683f6e4 Auto merge of #122024 - clubby789:remove-spec-option-pe, r=jhpratt
Remove SpecOptionPartialEq

With the recent LLVM bump, the specialization for Option::partial_eq on types with niches is no longer necessary. I kept the manual implementation as it still gives us better codegen than the derive (will look at this seperately).

Also implemented PartialOrd/Ord by hand as it _somewhat_ improves codegen for #49892: https://godbolt.org/z/vx5Y6oW4Y
2024-03-22 04:06:25 +00:00
bors
b57a10c39d Auto merge of #122854 - matthiaskrgr:rollup-9nnuo0z, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #121881 (std::net: adding acceptfilter feature for netbsd/freebsd.)
 - #122817 (Doc Guarantee: BTree(Set|Map):  `IntoIter` Iterate in Sorted by key Order)
 - #122826 (Add tests for shortcomings of associated type bounds)
 - #122829 (Implement `FusedIterator` for `gen` block)
 - #122831 (make failure logs less verbose)
 - #122837 (add test for #122549)
 - #122838 (Avoid noop rewrite of issues.txt)
 - #122841 (add 2 more tests for issues fixed by #122749)
 - #122843 (Add a never type option to make diverging blocks `()`)
 - #122844 (add test for ice "cannot relate region: LUB(ReErased, ReError)")
 - #122845 (Clippy subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-22 01:49:16 +00:00
Jubilee Young
861e47000f Fix Itanium mangling usizes
Arrays, surprisingly, are not sized to u64 on all platforms.
2024-03-21 17:35:20 -07:00
Matthias Krüger
99e5618d2a
Rollup merge of #122845 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update

r? ``@Manishearth``
2024-03-22 01:07:34 +01:00
Matthias Krüger
e647543cda
Rollup merge of #122844 - matthiaskrgr:just_one_more_test_mom, r=compiler-errors
add test for ice "cannot relate region: LUB(ReErased, ReError)"

Fixes #109178
2024-03-22 01:07:34 +01:00
Matthias Krüger
b469a6dd9b
Rollup merge of #122843 - WaffleLapkin:semicolon-vs-the-never, r=compiler-errors
Add a never type option to make diverging blocks `()`

More experiments for ~~the blood god~~ T-lang!

Usage example:
```rust
 #![allow(internal_features)]
 #![feature(never_type, rustc_attrs)]
 #![rustc_never_type_options(diverging_block_default = "unit")]

fn main() {
    let _: u8 = { //~ error: expected `u8`, found `()`
        return;
    };
}
```

r? compiler-errors

I'm not sure how I feel about parsing the attribute every time we create `FnCtxt`. There must be a better way to do this, right?
2024-03-22 01:07:33 +01:00
Matthias Krüger
ce63d7ae43
Rollup merge of #122841 - matthiaskrgr:moretests, r=wesleywiser
add 2 more tests for issues fixed by #122749

 Fixes #121807
 Fixes #122098
2024-03-22 01:07:33 +01:00
Matthias Krüger
d9e90ef467
Rollup merge of #122838 - workingjubilee:less-catholic-blessings-to-prevent-incremental-protests, r=matthiaskrgr
Avoid noop rewrite of issues.txt

Fixes #122834

r? ```@matthiaskrgr```
2024-03-22 01:07:32 +01:00
Matthias Krüger
c48c35f23c
Rollup merge of #122837 - matthiaskrgr:fix_122549, r=petrochenkov
add test for #122549

Fixes #122549
2024-03-22 01:07:32 +01:00
Matthias Krüger
05ae329524
Rollup merge of #122831 - onur-ozkan:less-verbose-fail-logs, r=clubby789
make failure logs less verbose

Resolves #122706

Logs without verbose flag:

![image](https://github.com/rust-lang/rust/assets/39852038/f2fc2d35-0954-44b0-bedc-045afedaabe8)

Logs with verbose flag:

![image](https://github.com/rust-lang/rust/assets/39852038/b9308655-ad31-4527-a1be-5a62a78ac469)

I decided to exclude command from the log since it's already included in verbose mode.

cc ```@Nilstrieb```
2024-03-22 01:07:31 +01:00
Matthias Krüger
1757cb5871
Rollup merge of #122829 - ShoyuVanilla:gen-block-impl-fused-iter, r=compiler-errors
Implement `FusedIterator` for `gen` block

cc #117078
2024-03-22 01:07:31 +01:00
Matthias Krüger
08ac38b661
Rollup merge of #122826 - compiler-errors:associated-type-bound-tests, r=lcnr
Add tests for shortcomings of associated type bounds

Adds the test in https://github.com/rust-lang/rust/pull/122791#issuecomment-2011433015

Turns out that #121123 is what breaks `tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.rs` (passes on nightly), but given that associated type bounds haven't landed anywhere yet, I'm happy with breaking it.

This is unrelated to #122791, which just needed that original commit e6b64c6194 stacked on top of it so that it wouldn't have tests failing.

r? lcnr
2024-03-22 01:07:31 +01:00
Matthias Krüger
fa99ebc7cf
Rollup merge of #122817 - ultrabear:ultrabear_btreedoc, r=Nilstrieb
Doc Guarantee: BTree(Set|Map):  `IntoIter` Iterate in Sorted by key Order

This Doc-only PR adds text to the IntoIterator implementation and IntoIter type for both BTreeMap and BTreeSet that states that the returned items will be in sorted-by-key order, this is a guarantee that is made by the iter() and iter_mut() methods of BTreeMap/Set and BTreeMap respectively, but not on into_iter methods or types.

I don't know how the IntoIter iteration would not be sorted by key, and I would like to rely on that behavior for my prefix_array crate.

The text appended to IntoIter documentation is based on each types respective iter() method documentation, as is the text used in the IntoIterator documentation; they are slightly inconsistent between Set/Map, but they are consistent within their own types documentation.
2024-03-22 01:07:30 +01:00
Matthias Krüger
f0feebb270
Rollup merge of #121881 - devnexen:bsd_acceptfilter, r=Amanieu
std::net: adding acceptfilter feature for netbsd/freebsd.

similar to linux's ext deferaccept, to filter incoming connections before accept.
2024-03-22 01:07:30 +01:00
Matthew Maurer
f2f0d255df CFI: Skip non-passed arguments
Rust will occasionally rely on fn((), X) -> Y being compatible with
fn(X) -> Y, since () is a non-passed argument. Relax CFI by choosing not
to encode non-passed arguments.
2024-03-21 22:26:26 +00:00
Maybe Waffle
93297bfb05 Add a never type option to make diverging blocks ()
```rust
 #![allow(internal_features)]
 #![feature(never_type, rustc_attrs)]
 #![rustc_never_type_options(diverging_block_default = "unit")]

fn main() {
    let _: u8 = { //~ error: expected `u8`, found `()`
        return;
    };
}
```
2024-03-21 22:09:25 +00:00
Zachary S
1b95760e41 Not insta-stable 2024-03-21 17:01:41 -05:00
Jubilee Young
542533865a Suggest using RUST_MIN_STACK if rustc overflowed 2024-03-21 14:49:02 -07:00
Jubilee Young
60891cab33 Use less hacky STACK_SIZE 2024-03-21 14:47:26 -07:00
Philipp Krones
8e53d53356
Update Cargo.lock 2024-03-21 22:20:59 +01:00
Philipp Krones
5a82d16560
Merge commit '9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3' into clippy-subtree-update 2024-03-21 22:20:40 +01:00
bors
0ad927c0c0 Auto merge of #122785 - the8472:const-select-specialized-impl, r=Amanieu
select Vec::from_iter impls in a const block to optimize compile times

Ignoring whitespace diffs should make this easier to review.

This relies on the trick from #122301
Split out from #120682
2024-03-21 21:19:19 +00:00
bors
9d6f41691e Auto merge of #12527 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2024-03-21 21:11:00 +00:00
Philipp Krones
e1d15b5b87
Bump Clippy version -> 0.1.79 2024-03-21 22:06:41 +01:00
Philipp Krones
bb86654769
Bump nightly version -> 2024-03-21 2024-03-21 22:05:51 +01:00
Philipp Krones
7d42d736c5
Merge remote-tracking branch 'upstream/master' into rustup 2024-03-21 22:05:29 +01:00
Matthias Krüger
847311e36f add test for ice "cannot relate region: LUB(ReErased, ReError)"
Fixes #109178
2024-03-21 22:02:32 +01:00
Matthias Krüger
bdafec33d5 add test for #121807
Fixes #121807
2024-03-21 21:27:37 +01:00
Jubilee Young
c00920c5da Avoid noop rewrite of issues.txt
This can trigger incremental rebuilds since incr doesn't realize nothing changed.
2024-03-21 13:02:40 -07:00
Matthias Krüger
35a78459aa add test for https://github.com/rust-lang/rust/issues/122098 ICE: index out of bounds, snapshot_vec.rs
Fixes #122098
2024-03-21 20:57:54 +01:00
Maybe Waffle
6f2c6efe01 Change syntax of the never type attribute thingy
Previous:
  ```rust
  #![rustc_never_type_mode = "fallback_to_unit|..."]
  ```

New:
  ```rust
  #![rustc_never_type_options(fallback = "unit|...")]
  ```
This allows adding other options for other never-related experiments.
2024-03-21 19:47:46 +00:00
Matthias Krüger
daa65539ce add test for #122549
Fixes #122549
2024-03-21 20:36:13 +01:00
bors
443f459f98 Auto merge of #12523 - Rua:typo-fix, r=dswij
Fix documentation typo "appects" > "affects"

changelog: none

This fixes a typo in the `iter_filter_is_some` and `iter_filter_is_ok` lint documentation.
2024-03-21 19:26:17 +00:00
bors
f61f45f233 Auto merge of #3393 - eduardosm:x86-pause-without-sse2, r=RalfJung
Allow `llvm.x86.sse2.pause` instrinsic to be called without SSE2

The instrinsic is compiled to a `pause` instruction, which behaves like a no-op when SSE2 is not available.

https://www.felixcloutier.com/x86/pause.html
2024-03-21 18:37:34 +00:00
bors
a0569fa8f9 Auto merge of #122830 - matthiaskrgr:rollup-uk2by3f, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #122402 (Make `#[diagnostic::on_unimplemented]` format string parsing more robust)
 - #122644 (pattern analysis: add a custom test harness)
 - #122733 (Strip placeholders from hidden types before remapping generic parameter)
 - #122752 (Interpolated cleanups)
 - #122771 (add some comments to hir::ModuleItems)
 - #122793 (Implement macro-based deref!() syntax for deref patterns)
 - #122810 (Remove `target_override`)
 - #122827 (Remove unnecessary braces from `bug`/`span_bug`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-21 17:53:57 +00:00
Rua
238cd36671 Fix documentation typo "appects" > "affects" 2024-03-21 18:22:23 +01:00
Eduardo Sánchez Muñoz
89bc81f0df Allow llvm.x86.sse2.pause instrinsic to be called without SSE2
The instrinsic is compiled to a `pause` instruction, which behaves like a no-op when SSE2 is not available.

https://www.felixcloutier.com/x86/pause.html
2024-03-21 18:20:54 +01:00