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
- improve diagnostics of field uniqueness check and representation check
- simplify the implementation of field uniqueness check
- remove some useless codes and improvement neatness
[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`
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
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
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.
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
- 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.
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.
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.
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`
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>
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
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.
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.
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`