Commit graph

246055 commits

Author SHA1 Message Date
bors
de4d615e6b Auto merge of #120834 - oli-obk:only_local_coherence, r=lcnr
A trait's local impls are trivially coherent if there are no impls.

This avoids creating a dependency edge on the hir or the specialization graph

This may resolve part of the performance issue of https://github.com/rust-lang/rust/pull/120558
2024-02-12 05:05:57 +00:00
Michael Goulet
fc7693d63b Clean inlined type alias with correct param-env 2024-02-12 04:51:49 +00:00
Frank King
0dbd6e9572 Improve some codes according to the reviews
- improve diagnostics of field uniqueness check and representation check
- simplify the implementation of field uniqueness check
- remove some useless codes and improvement neatness
2024-02-12 12:47:32 +08:00
Frank King
2b04ca94bb Add #[derive(Clone, Copy)] to anonymous adts
Fix the `AssertBoundIsClone` error for anonymous adts.
2024-02-12 12:47:32 +08:00
Frank King
822d6dc5fd Fix compile error in rustdoc. 2024-02-12 12:47:31 +08:00
Frank King
7660d6bf2c Check representation of unnamed fields 2024-02-12 12:47:31 +08:00
Frank King
7d012e8f19 Add rustfmt test from #117942 2024-02-12 12:47:30 +08:00
Frank King
0c0df4efe0 Lowering field access for anonymous adts 2024-02-12 12:47:30 +08:00
Frank King
36d7e7fd3f check uniqueness of nested fields 2024-02-12 12:47:29 +08:00
Frank King
879a1e5713 Lower anonymous structs or unions to HIR 2024-02-12 12:47:23 +08:00
OdenShirataki
4ac90e286b Fix suggestion span for ?Sized
when param type has default
and type in trait is generic.
2024-02-12 11:33:11 +09:00
yukang
2bcbc16caf remove a bunch of dead parameters in fn 2024-02-12 09:51:35 +08:00
bors
084ce5bdb5 Auto merge of #120951 - matthiaskrgr:rollup-0nnm7dv, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #110483 (Create try_new function for ThinBox)
 - #120740 (Make cmath.rs a single file)
 - #120872 (hir: Refactor getters for HIR parents)
 - #120880 (add note on comparing vtables / function pointers)
 - #120885 (interpret/visitor: ensure we only see normalized types)
 - #120888 (assert_unsafe_precondition cleanup)
 - #120897 (Encode `coroutine_for_closure` for foreign crates)
 - #120937 ([docs] Update armv6k-nintendo-3ds platform docs for outdated info)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-12 00:34:22 +00:00
Matthias Krüger
9bd630af97
Rollup merge of #120937 - ian-h-chamberlain:docs/update-3ds-links-and-info, r=JohnTitor
[docs] Update armv6k-nintendo-3ds platform docs for outdated info

Mostly just fixing links and references to renamed crates, but also updating a bit of outdated info as well.

CC `@Meziu` `@AzureMarker`
2024-02-11 23:19:11 +01:00
Matthias Krüger
aeafbbeded
Rollup merge of #120897 - compiler-errors:foreign-async-closure, r=oli-obk
Encode `coroutine_for_closure` for foreign crates

Async closures (and "coroutine closures" in general) need to have their child coroutine encoded. This PR does that.

r? oli-obk
2024-02-11 23:19:10 +01:00
Matthias Krüger
d71154f80f
Rollup merge of #120888 - saethlin:unsafe-precondition-cleanup, r=RalfJung
assert_unsafe_precondition cleanup

I moved the polymorphic `is_nonoverlapping` into the `Cell` function that uses it and renamed `intrinsics::is_nonoverlapping_mono` to just `intrinsics::is_nonoverlapping`.

We now also have some docs for `intrinsics::debug_assertions`.

r? RalfJung
2024-02-11 23:19:10 +01:00
Matthias Krüger
90b4e4116f
Rollup merge of #120885 - RalfJung:normal-visitor, r=compiler-errors
interpret/visitor: ensure we only see normalized types

[Prior discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Normalization.20after.20field.20projection)
r? `@compiler-errors`
2024-02-11 23:19:09 +01:00
Matthias Krüger
3d7d709925
Rollup merge of #120880 - RalfJung:vtable-fnptr-partialeq, r=cuviper
add note on comparing vtables / function pointers

Fixes https://github.com/rust-lang/rust/issues/99388
Fixes https://github.com/rust-lang/rust/issues/117047
2024-02-11 23:19:09 +01:00
Matthias Krüger
4c154a1a48
Rollup merge of #120872 - petrochenkov:opthirpar, r=cjgillot
hir: Refactor getters for HIR parents

See individual commits.

I ended up removing on of the FIXMEs from https://github.com/rust-lang/rust/pull/120206 instead of addressing it.
2024-02-11 23:19:08 +01:00
Matthias Krüger
f64bc316f6
Rollup merge of #120740 - ChrisDenton:cmaths, r=Mark-Simulacrum
Make cmath.rs a single file

It makes sense to have this all in one file. There's essentially only one target that has missing symbols and that's easy enough to handle inline.

Note that the Windows definitions used to use `c_float` and `c_double` whereas the other platforms all used `f32` and `f64`. They've now been made consistent. However, `c_float` and `c_double` have the expected definitions on all Windows platforms we support.
2024-02-11 23:19:08 +01:00
Matthias Krüger
251a09e151
Rollup merge of #110483 - tleibert:thin-box-try-new, r=dtolnay
Create try_new function for ThinBox

The `allocator_api` feature has proven very useful in my work in the FreeBSD kernel. I've found a few places where a `ThinBox` #92791 would be useful, but it must be able to be fallibly allocated for it to be used in the kernel.

This PR proposes a change to add such a constructor for ThinBox.

ACP: https://github.com/rust-lang/libs-team/issues/213
2024-02-11 23:19:07 +01:00
Nicholas Nethercote
b7b6ebca0c Fix inconsistencies in the diagnostic API methods.
- Remove low-value comments about functionality that is obvious.

- Add missing `track_caller` attributes -- every method should have one.

- Adjust `rustc_lint_diagnostic` attributes. Every method involving a
  `impl Into<DiagnosticMessage>` or `impl Into<SubdiangnosticMessage>`
  argument should have one, except for those producing bugs, which
  aren't user-facing.
2024-02-12 09:16:48 +11:00
Nicholas Nethercote
c35983a748 Reorder the diagnostic API methods.
The current order is almost perfectly random. This commit puts them into
a predictable order in their own impl block, going from the highest
level (`Block`) to the lowest (`Expect`). Within each level this is the
order:

- struct_err, err
- struct_span_err, span_err
- create_err, emit_err

The first one in each pair creates a diagnostic, the second one creates
*and* emits a diagnostic. Not every method is present for every level.

The diff is messy, but other than moving methods around, the only thing
it does is create the new `impl DiagCtxt` block with its own comment.
2024-02-12 09:16:45 +11:00
bors
520b0b20aa Auto merge of #120619 - compiler-errors:param, r=lcnr
Assert that params with the same *index* have the same *name*

Found this bug when trying to build libcore with the new solver, since it will canonicalize two params with the same index into *different* placeholders if those params differ by name.
2024-02-11 22:13:52 +00:00
Michael Goulet
87816378ab Fix async closures in CTFE 2024-02-11 22:09:52 +00:00
Michael Goulet
cb024ba6e3 is_closure_like 2024-02-11 22:09:52 +00:00
Ralf Jung
aaa6d3bec2 add comparison warning to RawWakerVTable as well 2024-02-11 23:06:09 +01:00
ripytide
f34d9da7db
fix intra-doc links 2024-02-11 20:26:05 +00:00
bors
1a648b397d Auto merge of #120803 - onur-ozkan:fix-compilation-cache, r=Mark-Simulacrum
always run `configure_linker` except for mir-opt tests

`configure_linker` now runs consistently unless it's for mir-opt tests. Previously `!= "check"` condition was causing dirt in the cargo cache between runs of `x anything-but-not-check` and `x check`.

 Fixes #120768

 cc `@saethlin`
2024-02-11 19:58:12 +00:00
David Tolnay
ea6944a065
Address ThinBox::try_new PR review 2024-02-11 11:28:01 -08:00
Michael Goulet
9789e88cfe Check that the ABI of the instance we are inlining is correct 2024-02-11 19:17:42 +00:00
Michael Goulet
38df5bdcf1 Ignore own item bounds in parent alias types in for_each_item_bound 2024-02-11 18:23:05 +00:00
Ayush Singh
af428db01f
Implement sys/thread for UEFI
Since UEFI has no concept of threads, most of this module can be
ignored. However, implementing parts that make sense.

- Implement sleep
- Implement available_parallelism

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-11 23:48:53 +05:30
Jakub Beránek
4a2939bcd2
Gate PR CI on clippy correctness lints 2024-02-11 19:04:43 +01:00
bors
a166af7729 Auto merge of #120903 - matthiaskrgr:rollup-tmsuzth, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #119213 (simd intrinsics: add simd_shuffle_generic and other missing intrinsics)
 - #120272 (Suppress suggestions in derive macro)
 - #120773 (large_assignments: Allow moves into functions)
 - #120874 (Take empty `where` bounds into account when suggesting predicates)
 - #120882 (interpret/write_discriminant: when encoding niched variant, ensure the stored value matches)
 - #120883 (interpret: rename ReadExternStatic → ExternStatic)
 - #120890 (Adapt `llvm-has-rust-patches` validation to take `llvm-config` into account.)
 - #120895 (don't skip coercions for types with errors)
 - #120896 (Print kind of coroutine closure)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-11 17:43:51 +00:00
Ben Kimock
f0de10039c Cleanup around the new assert_unsafe_precondition
Make the polymorphic is_nonoverlapping private

Fix assert_unsafe_precondition doc typos

Add docs for intrinsics::debug_assertions
2024-02-11 12:35:44 -05:00
ripytide
f415339052
fix incorrect doctest 2024-02-11 16:18:40 +00:00
Ian Chamberlain
07afd0fd51
Update links to rust3ds and outdated info 2024-02-11 11:07:02 -05:00
ripytide
792fa24595
improve btree_cursors functions documentation 2024-02-11 15:51:07 +00:00
bors
980cf089f4 Auto merge of #120920 - matthiaskrgr:rollup-jsryr8e, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #117740 (Add some links and minor explanatory comments to `std::fmt`)
 - #118307 (Remove an unneeded helper from the tuple library code)
 - #119242 (Suggest less bug-prone construction of Duration in docs)
 - #119449 (Fix `clippy::correctness` in the library)
 - #120307 (core: add Duration constructors)
 - #120459 (Document various I/O descriptor/handle conversions)
 - #120729 (Update mdbook to 0.4.37)
 - #120763 (Suggest pattern tests when modifying exhaustiveness)
 - #120906 (Remove myself from some review rotations)
 - #120916 (Subtree update of ` rust-analyzer`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-11 15:28:17 +00:00
Ralf Jung
e13de311d5 make Primary/Secondary importance consistent between CellBorrow and MutBorrow 2024-02-11 15:12:10 +01:00
Ralf Jung
d5de9a6105 check_consts: fix some duplicate errors by not calling check_static unnecessarily 2024-02-11 15:12:10 +01:00
bors
899c895ba4 Auto merge of #120914 - ehuss:downgrade-xcode, r=Mark-Simulacrum
Downgrade xcode

This is a temporary fix for the CI issues that have been plaguing the macOS builders. GitHub updated the default Xcode to 15 in the [2024-02-04](https://github.com/actions/runner-images/releases/tag/macos-13%2F20240204.1) update. This caused two issues to start appearing in CI:

* cmake fails to verify that clang can build a simple test program.
* An `invalid r_symbolnum` linking error when trying to build one of cranelift's tests.

I believe I have a solution for the first problem, but not the second. In the meantime, to help with the CI problems, this PR should temporarily resolve the issue until we have a solution.
2024-02-11 13:13:02 +00:00
joboet
04282db5b3
add doc-comment to unlock_queue 2024-02-11 13:59:00 +01:00
Chris Denton
89abbb0b40
Add ChrisDenton to review queue 2024-02-11 09:13:12 -03:00
Caio
1fa75af173 Add test 2024-02-11 08:02:32 -03:00
David Carlier
114b0c799d std: enabling new netbsd (10) calls.
Introducing a new config for this purpose as NetBSD 9 or 8 will be still around
for a good while. For now, we re finally enabling sys::unix::rand::getrandom.
2024-02-11 08:48:02 +00:00
Matthias Krüger
3ac087229a
Rollup merge of #120916 - lnicola:sync-from-ra, r=lnicola
Subtree update of ` rust-analyzer`

r? `@ghost`
2024-02-11 08:25:44 +01:00
Matthias Krüger
db79df7c1a
Rollup merge of #120906 - joshtriplett:triage-my-bandwidth, r=Mark-Simulacrum
Remove myself from some review rotations

Severe lack of bandwidth. I want to make sure I have enough time for other Rust
work.
2024-02-11 08:25:44 +01:00
Matthias Krüger
040ecbfb9f
Rollup merge of #120763 - Nadrieril:suggest-patterns, r=Mark-Simulacrum
Suggest pattern tests when modifying exhaustiveness

The vast majority of exhaustiveness tests are in `tests/ui/pattern`, this is what I've been using for years. This PR is me telling `x suggest` about that.

cc `@Ezrashaw`
2024-02-11 08:25:44 +01:00