Commit Graph

278856 Commits

Author SHA1 Message Date
Pavel Grigorenko
c06ed545df Implement AtomicT::update & AtomicT::try_update 2025-01-22 23:22:21 +03:00
bors
dee7d0e730 Auto merge of #134478 - compiler-errors:attr-span, r=oli-obk
Properly record metavar spans for other expansions other than TT

This properly records metavar spans for nonterminals other than tokentree. This means that we operations like `span.to(other_span)` work correctly for macros. As you can see, other diagnostics involving metavars have improved as a result.

Fixes #132908
Alternative to #133270

cc `@ehuss`
cc `@petrochenkov`
2025-01-22 14:46:41 +00:00
bors
b2728d5426 Auto merge of #135674 - scottmcm:assume-better, r=estebank
Update our range `assume`s to the format that LLVM prefers

I found out in https://github.com/llvm/llvm-project/issues/123278#issuecomment-2597440158 that the way I started emitting the `assume`s in #109993 was suboptimal, and as seen in that LLVM issue the way we're doing it -- with two `assume`s sometimes -- can at times lead to CVP/SCCP not realize what's happening because one of them turns into a `ne` instead of conveying a range.

So this updates how it's emitted from
```
assume( x >= LOW );
assume( x <= HIGH );
```
or
```
// (for ranges that wrap the range)
assume( (x <= LOW) | (x >= HIGH) );
```
to
```
assume( (x - LOW) <= (HIGH - LOW) );
```
so that we don't need multiple `icmp`s nor multiple `assume`s for a single value, and both wrappping and non-wrapping ranges emit the same shape.

(And we don't bother emitting the subtraction if `LOW` is zero, since that's trivial for us to check too.)
2025-01-22 04:18:30 +00:00
bors
c234b839d1 Auto merge of #135848 - matthiaskrgr:rollup-sftciqm, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #132232 (CI: build FreeBSD artifacts on FreeBSD 13.4)
 - #135706 (Move `supertrait_def_ids` into the elaborate module like all other fns)
 - #135750 (Add an example of using `carrying_mul_add` to write wider multiplication)
 - #135793 (Ignore `mermaid.min.js`)
 - #135810 (Add Kobzol on vacation)
 - #135821 (fix OsString::from_encoded_bytes_unchecked description)
 - #135824 (tests: delete `cat-and-grep-sanity-check`)
 - #135833 (Add fixme and test for issue #135289)

Failed merges:

 - #135816 (Use `structurally_normalize` instead of manual `normalizes-to` goals in alias relate errors)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-22 01:13:23 +00:00
Matthias Krüger
a7408c458b
Rollup merge of #135833 - lqd:add-ice-test, r=compiler-errors
Add fixme and test for issue #135289

This PR:
- adds a test minimizing issue #135289 for PR #135310
- adds a fixme about the suboptimal fix for the ICE

I've verified the test indeed ICEs with 3f2f695d68 reverted.

r? `@estebank`
2025-01-21 23:30:23 +01:00
Matthias Krüger
60cb6c4044
Rollup merge of #135824 - jieyouxu:delete-bintools-check, r=Noratrieb
tests: delete `cat-and-grep-sanity-check`

Part of #121876.

All remaining `Makefile`s have open PRs that do not rely on platform `cat` or `grep` or the `cat-and-grep` script.
2025-01-21 23:30:22 +01:00
Matthias Krüger
50c89b6c21
Rollup merge of #135821 - hkBst:patch-11, r=ibraheemdev
fix OsString::from_encoded_bytes_unchecked description

fixes #133010
2025-01-21 23:30:21 +01:00
Matthias Krüger
2ba3ece3a1
Rollup merge of #135810 - Kobzol:kobzol-parental-leave, r=Kobzol
Add Kobzol on vacation

I will be mostly reviewing diaper contents in the upcoming weeks, so I'm (proactively, for now) removing myself from the auto review rotation. Feel free to CC me (explicit `r?` won't work) explicitly though, I will be around.

r? `````@ghost`````
2025-01-21 23:30:20 +01:00
Matthias Krüger
79f128183f
Rollup merge of #135793 - jyn514:gitignore, r=jieyouxu
Ignore `mermaid.min.js`

It is very long and tends to match a lot of search queries. It's not useful to show with ripgrep.

Note that this does not actually untrack the file; changes can still be committed (although I suspect it may not have been intentional to commit originally?). This just changes how it interacts with tools that use `.gitignore` as a default filter.

r? rustc-dev-guide
2025-01-21 23:30:20 +01:00
Matthias Krüger
317769f152
Rollup merge of #135750 - scottmcm:cma-example, r=cuviper
Add an example of using `carrying_mul_add` to write wider multiplication

Just the basic quadratic version that you wouldn't actually use for really-big integers, but it's nice and short so is useful as for a demonstration of why you might find `carrying_mul_add` useful :)

cc #85532 ``````@clarfonthey``````
2025-01-21 23:30:19 +01:00
Matthias Krüger
4af3ff8cd1
Rollup merge of #135706 - compiler-errors:elaborate, r=lcnr
Move `supertrait_def_ids` into the elaborate module like all other fns

It's strange that this is the only elaborate-like fn on tcx.

r? lcnr
2025-01-21 23:30:18 +01:00
Matthias Krüger
ea594c692b
Rollup merge of #132232 - asomers:fbsd-13.4, r=Mark-Simulacrum
CI: build FreeBSD artifacts on FreeBSD 13.4

13.2 is EoL, and 13.3 will be EoL too in about 2 months.  Plus, both suffer from a bug in LLVM's libunwind.  It causes a segfault inside of std::backtrace::Backtrace::capture().

Fixes #132185

cc ``````@ehuss`````` .  before you can do the trybuild, you'll also have to download new FreeBSD 13.4 base.txz images and place them in https://ci-mirrors.rust-lang.org/rustc , then update this PR with the correct file names.

try-job: dist-x86_64-freebsd
try-job: dist-various-2
2025-01-21 23:30:17 +01:00
bors
a24bdc60ce Auto merge of #135487 - klensy:windows-0.59, r=Mark-Simulacrum
bump compiler and tools to windows 0.59, bootstrap to 0.57

This bumps compiler and tools to windows 0.59 (temporary dupes version, as `sysinfo` still depend on <= 0.57).
Bootstrap bumps only to 0.57 (the same sysinfo dep).

This additionally resolves my comment https://github.com/rust-lang/rust/pull/130874#issuecomment-2393562071

Will work on it in follow up pr: There still some sus imports for `rustc_driver.dll` like ws2_32 or RoOriginateErrorW, but i will look at them later.
2025-01-21 22:29:46 +00:00
bors
ed43cbcb88 Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
remove support for the (unstable) #[start] attribute

As explained by `@Noratrieb:`
`#[start]` should be deleted. It's nothing but an accidentally leaked implementation detail that's a not very useful mix between "portable" entrypoint logic and bad abstraction.

I think the way the stable user-facing entrypoint should work (and works today on stable) is pretty simple:
- `std`-using cross-platform programs should use `fn main()`. the compiler, together with `std`, will then ensure that code ends up at `main` (by having a platform-specific entrypoint that gets directed through `lang_start` in `std` to `main` - but that's just an implementation detail)
- `no_std` platform-specific programs should use `#![no_main]` and define their own platform-specific entrypoint symbol with `#[no_mangle]`, like `main`, `_start`, `WinMain` or `my_embedded_platform_wants_to_start_here`. most of them only support a single platform anyways, and need cfg for the different platform's ways of passing arguments or other things *anyways*

`#[start]` is in a super weird position of being neither of those two. It tries to pretend that it's cross-platform, but its signature is  a total lie. Those arguments are just stubbed out to zero on ~~Windows~~ wasm, for example. It also only handles the platform-specific entrypoints for a few platforms that are supported by `std`, like Windows or Unix-likes. `my_embedded_platform_wants_to_start_here` can't use it, and neither could a libc-less Linux program.
So we have an attribute that only works in some cases anyways, that has a signature that's a total lie (and a signature that, as I might want to add, has changed recently, and that I definitely would not be comfortable giving *any* stability guarantees on), and where there's a pretty easy way to get things working without it in the first place.

Note that this feature has **not** been RFCed in the first place.

*This comment was posted [in May](https://github.com/rust-lang/rust/issues/29633#issuecomment-2088596042) and so far nobody spoke up in that issue with a usecase that would require keeping the attribute.*

Closes https://github.com/rust-lang/rust/issues/29633

try-job: x86_64-gnu-nopt
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: test-various
2025-01-21 19:46:20 +00:00
Michael Goulet
45929a8f46 Move supertrait_def_ids into the elaborate module like all other fns 2025-01-21 17:36:57 +00:00
Rémy Rakic
9bad0daef6 add fixme in typoed const pattern lint 2025-01-21 16:18:34 +00:00
Rémy Rakic
d9165b2ed6 add test for issue 135289 2025-01-21 16:18:27 +00:00
Ralf Jung
56c90dc31e remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
klensy
6c5f084c77 tidy 2025-01-21 16:48:44 +03:00
klensy
5619398f40 bump bootsrap windows to 0.57 2025-01-21 16:48:44 +03:00
klensy
84ce2e129a bumpt compiler and tools to windows 0.59 2025-01-21 16:48:44 +03:00
许杰友 Jieyou Xu (Joe)
c45e97c549 tests: delete cat-and-grep-sanity-check
All remaining `Makefile`s have open PRs that do not rely on platform
`cat` or `grep`.
2025-01-21 21:37:14 +08:00
Marijn Schouten
fdc80af5c5
fix OsString::from_encoded_bytes_unchecked description 2025-01-21 14:36:18 +01:00
bors
cd805f09ff Auto merge of #133830 - compiler-errors:span-key, r=lcnr
Rework dyn trait lowering to stop being so intertwined with trait alias expansion

This PR reworks the trait object lowering code to stop handling trait aliases so funky, and removes the `TraitAliasExpander` in favor of a much simpler design. This refactoring is important for making the code that I'm writing in https://github.com/rust-lang/rust/pull/133397 understandable and easy to maintain, so the diagnostics regressions are IMO inevitable.

In the old trait object lowering code, we used to be a bit sloppy with the lists of traits in their unexpanded and expanded forms. This PR largely rewrites this logic to expand the trait aliases *once* and handle them more responsibly throughout afterwards.

Please review this with whitespace disabled.

r? lcnr
2025-01-21 12:33:33 +00:00
bors
a7a6c64a65 Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin
codegen: store ScalarPair via memset when one side is undef and the other side can be memset

Basically since `undef` can be any byte, it can also be the byte(s) that are in the non-undef parts of a value. So we can just treat the `undef` at not being there and only look at the initialized bytes and memset over them

fixes #104290

based on https://github.com/rust-lang/rust/pull/135258
2025-01-21 09:45:24 +00:00
Jakub Beránek
51af4d6d22
Add Kobzol on vacation 2025-01-21 10:23:14 +01:00
Oli Scherer
8f5f5e56a8 Add more tests 2025-01-21 08:27:30 +00:00
Oli Scherer
dfa4c01b2e Treat undef bytes as equal to any other byte 2025-01-21 08:27:21 +00:00
Oli Scherer
964c58a7d9 Ensure we always get a constant, even without mir opts 2025-01-21 08:25:59 +00:00
Oli Scherer
8876cf7181 Also generate undef scalars and scalar pairs 2025-01-21 08:22:15 +00:00
bors
ebbe63891f Auto merge of #135632 - marcoieni:split-x86_64-msvc-2025, r=Kobzol
CI: split x86_64-msvc job using windows 2025

try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: dist-x86_64-msvc
2025-01-21 06:58:11 +00:00
bors
b605c65b6e Auto merge of #135224 - wyfo:tls-panic-outline, r=cuviper
Outline panicking code for `LocalKey::with`

See https://github.com/rust-lang/rust/pull/115491 for prior related modifications.

https://godbolt.org/z/MTsz87jGj shows a reduction of the code size for TLS accesses.
2025-01-21 02:23:15 +00:00
bors
a42d5ecf34 Auto merge of #134286 - Urgau:unreach_pub-std, r=ibraheemdev
Enable `unreachable_pub` lint in core

This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) as warn in `core`, `rtstartup` and `panic_unwind`.

The motivation is similar to the compiler [MCP: Enable deny(unreachable_pub) on `rustc_*` crates](https://github.com/rust-lang/compiler-team/issues/773#issue-2467219005) :

> "Where is this thing used?" is a question I ask all the time when reading unfamiliar code. Because of this, I generally find it annoying when things are marked with a more permissive visibility than necessary. "This thing marked pub, which other crates is it used in? Oh, it's not used in any other crates."

Another motivation is to help to lint by utilizing it in-tree and seeing it's limitation in more complex scenarios.

The diff was mostly generated with `./x.py fix --stage 1 library/core/ -- --broken-code`, as well as manual edits for code in macros, generated code and other targets.

r? libs
2025-01-20 23:34:04 +00:00
jyn
9d88b82b99 Ignore mermaid.min.js
It is very long and tends to match a lot of search queries. It's not useful to show with ripgrep.

Note that this does not actually untrack the file; changes can still be committed (although I suspect it may not have been intentional to commit originally?). This just changes how it interacts with tools that use `.gitignore` as a default filter.
2025-01-20 16:08:08 -05:00
bors
f3d1d47fd8 Auto merge of #135789 - matthiaskrgr:rollup-4cvw8s4, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133695 (Reexport likely/unlikely in std::hint)
 - #135330 (Respect --sysroot for rustc -vV and -Cpasses=list)
 - #135333 (Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase)
 - #135741 (Recognise new IPv6 documentation range from IETF RFC 9637)
 - #135770 (Update contributing docs for submodule/subtree changes)
 - #135775 (Subtree update of `rust-analyzer`)
 - #135776 (Subtree sync for rustc_codegen_cranelift)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-20 20:41:33 +00:00
Matthias Krüger
67b609a919
Rollup merge of #135776 - bjorn3:sync_cg_clif-2025-01-20, r=bjorn3
Subtree sync for rustc_codegen_cranelift

Nothing too exciting this time, but this includes a fix for a linker hang on Windows: https://github.com/rust-lang/rustc_codegen_cranelift/pull/1554

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2025-01-20 20:58:38 +01:00
Matthias Krüger
b0eadb1a37
Rollup merge of #135775 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? ``@ghost``
2025-01-20 20:58:37 +01:00
Matthias Krüger
ab69a954d6
Rollup merge of #135770 - jieyouxu:subtree-submodule-contributing, r=Kobzol
Update contributing docs for submodule/subtree changes

Noticed in https://github.com/rust-lang/rust/pull/135337#issuecomment-2602434736.

r? ``@Kobzol`` (or anyone really)
2025-01-20 20:58:37 +01:00
Matthias Krüger
8a7db695a6
Rollup merge of #135741 - bardiharborow:std/net/rfc9637, r=Amanieu
Recognise new IPv6 documentation range from IETF RFC 9637

This PR adds the `3fff::/20` range defined by [IETF RFC 9637](https://datatracker.ietf.org/doc/rfc9637/) to those ranges which `Ipv6Addr::is_documentation` recognises as a documentation IP.

See also: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
Unstable tracking issue: #27709
2025-01-20 20:58:36 +01:00
Matthias Krüger
0d5b8138bb
Rollup merge of #135333 - vayunbiyani:test-environment, r=RalfJung
Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase

Part of #132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro

- Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro.
- Skipped `.md` files and test files to avoid unnecessary changes.
2025-01-20 20:58:35 +01:00
Matthias Krüger
c8c5fa4893
Rollup merge of #135330 - bjorn3:respect_sysroot_in_version_printing, r=lqd
Respect --sysroot for rustc -vV and -Cpasses=list

This is necessary when the specified codegen backend is in a custom sysroot.

Fixes https://github.com/rust-lang/rust/issues/135165
2025-01-20 20:58:35 +01:00
Matthias Krüger
bbec1510bb
Rollup merge of #133695 - x17jiri:hint_likely, r=Amanieu
Reexport likely/unlikely in std::hint

Since `likely`/`unlikely` should be working now, we could reexport them in `std::hint`. I'm not sure if this is already approved or if it requires approval

Tracking issue: #26179
2025-01-20 20:58:34 +01:00
Urgau
15f345b815 core: #[allow(unreachable_pub)] on unreachable pub use 2025-01-20 18:35:32 +01:00
Urgau
8e61502484 core: add #![warn(unreachable_pub)] 2025-01-20 18:35:32 +01:00
Urgau
0f30662147 rtstartup: add #![warn(unreachable_pub)] 2025-01-20 18:35:32 +01:00
Urgau
477ef65121 panic_unwind: add #![warn(unreachable_pub)] 2025-01-20 18:35:32 +01:00
bors
9f4d9dc102 Auto merge of #135769 - jieyouxu:rollup-3h384pz, r=jieyouxu
Rollup of 5 pull requests

Successful merges:

 - #135433 (Add Profile Override for Non-Git Sources)
 - #135626 (doc: Point to methods on `Command` as alternatives to `set/remove_var`)
 - #135658 (Do not include GCC source code in source tarballs)
 - #135676 (rustc_resolve: use structured fields in traces)
 - #135762 (Correct counting to four in cell module docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-20 17:07:30 +00:00
bjorn3
056a9cebe9 Respect --target in get_backend_from_raw_matches 2025-01-20 15:47:26 +00:00
bjorn3
d740a3f06a Merge commit '728bc27f32c05ac8a9b5eb33fd101e479072984f' into sync_cg_clif-2025-01-20 2025-01-20 15:30:04 +00:00
Jiri Bobek
cb2efaf5bc 1. Removed 'rustc_nounwind' 2. Rewording of comments 2025-01-20 16:16:46 +01:00