Skip to content

[pull] master from rust-lang:master #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Oct 27, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

RalfJung and others added 24 commits May 10, 2025 21:47
The `mir_drops_elaborated_and_const_checked` query result has been
stolen already and cannot be borrowed again. Use the `optimized_mir`
query result instead.
Fix download of GCC from CI on non-nightly channels

Fixes the download failure on beta (#140897 (comment)).

r? `@onur-ozkan`
The `mir_drops_elaborated_and_const_checked` query result has been
stolen already and cannot be borrowed again. Use the `optimized_mir`
query result instead.

changelog: [`missing_const_for_fn`]: fix ICE with some compilation
options

Fixes rust-lang/rust-clippy#14774

r? @Jarcho
…m,traviscross,tgross35

Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
…m,traviscross,tgross35

Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
…r=petrochenkov

Prefer to suggest stable candidates rather than unstable ones

Fixes #140240

The logic is to replace unstable suggestions if we meet a new stable one, and do nothing if any other situation. In old logic, we just use the first candidate we meet as the suggestion for the same items.

E.g., `std::range::legacy::Range` vs `std::ops::Range`, `legacy` in the former is unstable, we prefer to suggest use the latter.
Make t letter looks like lowercase rather than uppercase

randomly noticed that, took opportunity to fix :D
it was looks like "RusT" now fixed to "Rust"
r? `@jieyouxu`
before
<img src="https://github.com/user-attachments/assets/1ff19891-2e7b-4633-897d-2b2635aff9c6" width="65%" />
now
<img src="https://github.com/user-attachments/assets/d577a2af-6755-411b-8050-2556f0f12e75" width="65%" />
…-errors

Two expand-related cleanups

Minor improvements I found while looking at this code. Best reviewed one commit at a time.

r? `@BoxyUwU`
…BurntSushi

Split duration_constructors to get non-controversial constructors out

This implements #140881
Update deps of bootstrap for Cygwin

This PR just runs
```
cargo update fd-lock xattr libc errno
```
It reduces dependency on `rustix 0.38.40` and updates `libc` & `errno`. Now it compiles successfully on Cygwin:)
test intrinsic fallback bodies with Miri

`@Urgau` noted in #140792 that fallback bodies our backends don't use are untested... which is correct, and it is a problem. So this adds a testing-only flag to Miri to force the use of fallback bodies, and adds a run of the Miri test suite with that flag to CI. This should not take much more than a minute so I hope it's fine? Let's see how long it actually takes.

While at it, I made that test run also enable MIR optimizations. Miri's CI has a run with that, and it has caught mir-opt bugs in the past -- this way we'd see the CI failure earlier.

r? `@scottmcm`
Rollup of 7 pull requests

Successful merges:

 - #140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - #140795 (Prefer to suggest stable candidates rather than unstable ones)
 - #140865 (Make t letter looks like lowercase rather than uppercase)
 - #140878 (Two expand-related cleanups)
 - #140882 (Split duration_constructors to get non-controversial constructors out)
 - #140886 (Update deps of bootstrap for Cygwin)
 - #140903 (test intrinsic fallback bodies with Miri)

r? `@ghost`
`@rustbot` modify labels: rollup
This module comment describes why it's OK for LLVM bindings to declare a
parameter type of `*const c_uchar` for pointer/length strings, even though the
corresponding parameter on the C/C++ side uses `const char *`.

Adding a searchable term to each such parameter should make it easier for
future maintainers to understand why `*const c_uchar` is being used instead of
`*const c_char`.
This LLVM-C binding replaces the existing `LLVMRustInlineAsm` function.
This patch also changes the Rust-side declaration to take `*const c_uchar`
instead of `*const c_char`, to avoid the need for `AsCCharPtr`.
This avoids the need for an explicit `as_c_char_ptr` conversion.
…=Amanieu

Partially stabilize LoongArch target features

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by #44839.

Specifically, this PR stabilizes the following target features:

* f
* d
* frecipe
* lasx
* lbt
* lsx
* lvz

Docs PR: rust-lang/reference#1707

r? `@Amanieu`
…ations, r=davidtwco

Add T-compiler backports Zulip notifications

This patch make it so, that the triagebot willl send notifications to the Zulip channel [#t-compiler/backports](https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports) when a label `{stable-beta}-nominated` is added to beta or stable backport pull request. Requirement to trigger this notification is that the pull request be labeled `T-compiler`.

Note: Zulip notifications can send notifications also on other events (`message_on_close` and `message_on_reopen`) but I omitted them for now, I am not yet sure we need them.

r? `@davidtwco`
Warn when `#[export_name]` is used with generic functions

Fixes #140742
matthiaskrgr and others added 30 commits May 17, 2025 10:33
ci: split the dist-ohos job

try-job: `dist-ohos-*`
Remove some unnecessary erases

Some nits I pulled out of #140814.
Lowercase git url for rust-lang/enzyme.git

On Fuchsia, we have an internal Gerrit mirrors of the rust repositories to avoid excess load on the public github servers. Since rust uses submodules, we need to then use git's `url.<base>.insteadOf` to point our checkouts at our mirrors.

We'd prefer to be able to point all repositories under `https://github.com/rust-lang` to
`https://rust.googlesource.com/rust-lang`, but unfortunately it seems that when Rust mirrored Enzyme, the repository name was lower cased to `https://github.com/rust-lang/enzyme`, but kept the name capitalized in the .gitmodules file. This didn't cause a problem for Github, which seems to handle repository names in a case insensitive way, Gerrit is case sensitive, so we can't use a glob rule. Instead we have to setup `insteadOf` rules for each repository.

This renames the URL to match the case of the repository name, which should avoid the issue.
…-errors

HIR: explain in comment why `ExprKind::If` "then" is an `Expr`

One could be tempted to replace the "then" `hir::Expr` with kind `hir::ExprKind::Block` by a `hir::Block`. Explain why this would not be a good idea.

I've been there.

r? ``@compiler-errors``
Do not emit help when shorthand from macro when suggest `?` or `expect`

Fixes #140659

I didn't fully minimize the original bug, but I found a similar test case, and they have perhaps the same root cause. For the bug mentioned in #140659 , I also tested it locally and passed it.

Jieyou has worked on this part before, maybe r? `@jieyouxu`
Rollup of 8 pull requests

Successful merges:

 - #140208 (Make well-formedness predicates no longer coinductive)
 - #140957 (Add `#[must_use]` to Array::map)
 - #141031 (Async drop fix for dropee from another crate (#140858))
 - #141036 (ci: split the dist-ohos job)
 - #141051 (Remove some unnecessary erases)
 - #141056 (Lowercase git url for rust-lang/enzyme.git)
 - #141059 (HIR: explain in comment why `ExprKind::If` "then" is an `Expr`)
 - #141070 (Do not emit help when shorthand from macro when suggest `?` or `expect`)

r? `@ghost`
`@rustbot` modify labels: rollup
MIR borrowck taints its output if an obligation fails. This could then cause
`check_coroutine_obligations` to silence its error, causing us to not emit
and actual error and ICE.
Miri subtree update

r? `@ghost`
Implement Display for ``rustc_target::callconv::Conv``

Follow up of #133103 (comment)
…scottmcm

Add as_ascii_unchecked() methods to char, u8, and str

This PR adds the `as_ascii_unchecked()` method to `char`, `u8`, and `str`, allowing users to convert these types to `ascii::Char`s (see #110998) in an `unsafe` context without first checking for validity. This method was already available for `[u8]`, so this PR makes the API more consistent across other types.
deduplicate abort implementations

Currently, the code for process aborts is duplicated across `panic_abort` and `std`. This PR uses `#[rustc_std_internal_symbol]` to make the `std` implementation available to `panic_abort` via the linker, thereby deduplicating the code.
checktools.sh: fix bashism

Follow-up to #140903. Turns out `tests/{pass,panic}` only properly expands in bash, not in dash. :/

r? `@WaffleLapkin`
turn lld warning on old gccs into info log

As discussed in #140964 and IRL, this PR switches the spammy warning shown unconditionally when an old gcc doesn't support `-fuse-ld=lld` and we retry linking without it, to an info debug log so we don't lose it.

r? `@Mark-Simulacrum`

Fixes #140964
Enable rust-analyzer to go from query definition to the corresponding provider field

r? `@compiler-errors`
Only select true errors in `impossible_predicates`

See description in test.

Fixes #141119

r? lcnr
…compiler-errors

check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning

MIR borrowck taints its output if an obligation fails. This could then cause `check_coroutine_obligations` to silence its error, causing us to not emit and actual error and ICE.

Fixes the ICE in rust-lang/trait-system-refactor-initiative#199. It is unfortunately still a regression.

r? compiler-errors
Make some `match`es slightly more ergonomic in `librustdoc`

Bunch of small cleanups I found while working on other stuff, mostly getting rid of superfluous `*`s and `ref [mut]`s in `match`es,
makes the code less sigil/keyword-heavy, and slightly improves readability IMHO.
Also flattens a few nested `match`es.
Rollup of 9 pull requests

Successful merges:

 - #135808 (Implement Display for ``rustc_target::callconv::Conv``)
 - #137432 (Add as_ascii_unchecked() methods to char, u8, and str)
 - #139103 (deduplicate abort implementations)
 - #140917 (checktools.sh: fix bashism)
 - #141035 (turn lld warning on old gccs into info log)
 - #141118 (Enable rust-analyzer to go from query definition to the corresponding provider field)
 - #141121 (Only select true errors in `impossible_predicates`)
 - #141125 (check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning)
 - #141131 (Make some `match`es slightly more ergonomic in `librustdoc`)

r? `@ghost`
`@rustbot` modify labels: rollup
Initial implementation of `core_float_math`

Since [1], `compiler-builtins` makes a certain set of math symbols
weakly available on all platforms. This means we can begin exposing some
of the related functions in `core`, so begin this process here.

It is not possible to provide inherent methods in both `core` and `std`
while giving them different stability gates, so standalone functions are
added instead. This provides a way to experiment with the functionality
while unstable; once it is time to stabilize, they can be converted to
inherent.

For `f16` and `f128`, everything is unstable so we can move the inherent
methods.

The following are included to start:

* floor
* ceil
* round
* round_ties_even
* trunc
* fract
* mul_add
* div_euclid
* rem_euclid
* powi
* sqrt
* abs_sub
* cbrt

These mirror the set of functions that we have in `compiler-builtins`
since [1], with the exception of `powi` that has been there longer.

Details for each of the changes is in the commit messages.

Tracking issue: #137578

[1]: rust-lang/compiler-builtins#763

try-job: aarch64-gnu
tru-job: armhf-gnu
try-job: i686-msvc-1
try-job: test-various
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
Merge mir query analysis invocations

r? `@ghost`

same thing as #140854 just a different set of queries

Doing this in general has some bad cache coherence issues because the query caches are laid out in Vec<QueryResult> lists per query where each index refers to a DefId in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
move expensive layout sanity check to debug assertions

It is [hard to fix](#141006 (comment)) the slowness in the uninhabitedness computation for very big types but we can fix the very specific case of them being called during the layout sanity checks, as described in #140944.

So this PR moves this uninhabitedness check to the other expensive layout sanity checks that are ran under `debug_assertions`.

It makes building the `lemmy_api_routes` crate's self-profile `layout_of` query go from

```
+--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| Item                                                   | Self time | % of total time | Time     | Item count | Incremental result hashing time |
+--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| layout_of                                              | 63.02s    | 41.895          | 244.26s  | 123703     | 50.30ms                         |
+--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
```

on master (2m17s total), to

```
| layout_of                                              | 330.21ms  | 0.372           | 26.90s   | 123703     | 53.19ms                         |
```

with this PR (1m15s total).

(Note that the [perf run results](#141039 (comment)) below look a bit better than [an earlier run](https://perf.rust-lang.org/compare.html?start=4eca99a18eab3d4e28ed1ce3ee620d442955a470&end=c4a00993f8ee02c7565e7be652608817ea2fb97d&stat=instructions:u) I did in another PR. There may be some positive noise there, or post-merge results could differ a bit)

Since we discussed this today, r? `@compiler-errors` — and cc `@lcnr` and `@RalfJung.`
Update to LLVM 20.1.5

`@rustbot` label A-LLVM T-compiler
Fast path for `register_region_obligation`

If a type has no params, infer, placeholder, or non-`'static` free regions, then we can skip registering outlives obligations since the type has no components which affect lifetime checking in an interesting way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.