Commit Graph

305445 Commits

Author SHA1 Message Date
Pierre Tardy 1e668e089d fix panic when rustc tries to reduce intermediate filenames length with multi byte chars
The issue cannot be reproduced with the former testcase of creating external crates because
rust refuses to use "external crate 28_找出字符串中第一个匹配项的下标"
because it is not a valid indentifier (starts with number, and contain non ascii chars)

But still using 28_找出字符串中第一个匹配项的下标.rs as a filename is accepted by previous rustc releases
So we consider it valid, and add an integration test for it to catch any regression on other code related to non ascii filenames.

(cherry picked from commit c6acffeb78)
2025-10-24 14:58:36 -07:00
Josh Stone 912aba6874 Revert "feat: implement hash_map! macro"
This reverts commit 066023e47c.

(cherry picked from commit c01682ebf6)
2025-10-24 10:13:04 -07:00
Josh Stone 4bc789b5b1 Add a regression test for rust-lang/rust#147971
(cherry picked from commit a81ed52f58)
2025-10-24 10:13:04 -07:00
Rémy Rakic 1dda76181e add crashes tests for overlapping spans
(cherry picked from commit dd83c57674)
2025-10-24 10:12:51 -07:00
Rémy Rakic c956a76bd6 Revert "Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=petrochenkov"
This reverts commit 99317ef14d, reversing
changes made to 9cd272dc85.

(cherry picked from commit a2b48332ba)
2025-10-24 10:12:51 -07:00
ltdk 21ffe30cd5 Add regression test for inference failures
(cherry picked from commit 4a4f3b0e8e)
2025-10-24 10:12:43 -07:00
ltdk 566809897f Revert inference failure from Deref/Borrow constification
(cherry picked from commit ebd5bea84f)
2025-10-24 10:12:43 -07:00
ltdk b6d30faa79 Revert inference failure from AsRef constification
(cherry picked from commit cb7fb35ad1)
2025-10-24 10:12:37 -07:00
bors 1f25197887 Auto merge of #147791 - cuviper:beta-next, r=cuviper
[beta] backports

- Change int-to-ptr transmute lowering back to inttoptr rust-lang/rust#147541
- rewrite outlives placeholder constraints to outlives static when handling opaque types rust-lang/rust#147566
- GVN: Invalidate derefs at loop headers rust-lang/rust#147607

r? cuviper
2025-10-17 00:04:22 +00:00
dianqk 408e09e77c GVN: Invalidate derefs at loop headers
(cherry picked from commit 2048b9c027)
2025-10-16 14:17:45 -07:00
dianqk 5b36a0a7b2 Add miscompiled test cases
(cherry picked from commit 64c023bad8)
2025-10-16 14:16:46 -07:00
Boxy Uwu 00c06488ad in opaque type handling lift region vars to static if they outlive placeholders
(cherry picked from commit 30bedc74d4)
2025-10-16 14:16:24 -07:00
Ben Kimock 6b4f96d492 Change int-to-ptr transmute lowering back to inttoptr
(cherry picked from commit 029579d177)
2025-10-16 14:12:06 -07:00
bors df8b2e497d Auto merge of #147056 - dianne:fcw-super-let-init-borrow-shortening, r=jackh726
[beta-1.91] Warn on future errors from temporary lifetimes shortening in Rust 1.92

Pursuant to [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports/topic/.23145838.3A.20beta-nominated/near/540530631), this implements a future-compatibility warning lint `macro_extended_temporary_scopes` for errors in Rust 1.92 caused by rust-lang/rust#145838:

```
warning: temporary lifetime shortening in Rust 1.92
  --> $DIR/macro-extended-temporary-scopes.rs:54:14
   |
LL |             &struct_temp().field
   |              ^^^^^^^^^^^^^ this expression creates a temporary value...
...
LL |         } else {
   |         - ...which will be dropped at the end of this block in Rust 1.92
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see <https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#macro-extended-temporary-scopes>
   = note: consider using a `let` binding to create a longer lived value
```

Implementation-wise, this reuses the existing temporary scoping FCW machinery introduced for the `tail_expr_drop_order` edition lint: this adds `BackwardIncompatibleDropHint` statements to the MIR at the end of the shortened scopes for affected temporaries; these are then checked in borrowck to warn if the temporary is used after the future drop hint. There are trade-offs here: on one hand, I believe this gives some assurance over ad-hoc pattern-recognition that there are no false positives[^1]. On the other hand, this fails to lint on future dangling raw pointers and it complicates the potential addition of explanatory diagnostics or suggestions[^2]. I'm hopeful that the limitation around dangling pointers won't be relevant in real code, though; the only real instance we've seen of breakage so far is future errors in formatting macro invocations, which this should be able to catch.

Release logistics notes:
- This PR targets the beta branch directly, since the breakage it's a FCW for is landing in the next Rust version.
- rust-lang/rust#146098 undoes the breakage this is a FCW for. If that behavior is merged and stabilizes in Rust 1.92, this PR should be reverted (or shouldn't be merged) in order to avoid spurious warnings.

cc `@traviscross`

`@rustbot` label +T-lang

[^1]: In particular, more syntactic approaches are complicated by having to avoid warning on promoted constants; they'd either be full of holes, they'd need a lot of extra logic, or they'd need to hack more MIR-to-HIR mapping into `PromoteTemps`.
[^2]: It's definitely possible to add more context and a suggestion, but the ways I've thought of to do so are either too hacky or too complex to feel appropriate for a last-minute direct-to-beta lint.
2025-10-15 01:35:47 +00:00
dianne 164620feda warn on shortening super let binding lifetimes 2025-10-13 22:45:25 -07:00
dianne 9f7ad5ee77 add a test for shortening super let binding lifetimes 2025-10-13 22:45:09 -07:00
dianne 6c2246d9b3 warn on future errors from temporary lifetimes shortening in Rust 1.92 2025-10-13 22:45:09 -07:00
bors d69b1bb497 Auto merge of #147569 - weihanglo:update-beta-cargo, r=weihanglo
[beta-1.91] Update cargo submodule

2 commits in 785a383cf715417fcd68c4a98a4523c2d082bb0f..ea2d97820c16195b0ca3fadb4319fe512c199a43
2025-10-04 19:17:20 -0500 to 2025-10-10 15:19:24 -0400
- [beta-1.91] fix: use `host-tuple` for host target subsitution (rust-lang/cargo#16032)
- [beta-1.91] fix(timings): compute codegen start time to draw dep lines (rust-lang/cargo#16057)

r? ghost
2025-10-14 01:08:28 +00:00
bors cbf84ed0ca Auto merge of #147571 - cuviper:beta-next, r=cuviper
[beta] backports

- Don't normalize higher-ranked assumptions if they're not used rust-lang/rust#147299
- Fix target list of `link_section` rust-lang/rust#147418
- bootstrap: add `Builder::rustc_cmd` that includes the lib path rust-lang/rust#147419
- Update LLVM to 21.1.2 rust-lang/rust#146953
- Remove the temporary directory when a check ends -- part of rust-lang/rust#147518

r? cuviper
2025-10-11 22:45:30 +00:00
dianqk 5bef4363ab Remove the temporary directory when a check ends
(cherry picked from commit a3482d97c6)
2025-10-11 09:41:17 -07:00
dianqk 3f2437c4a4 Update LLVM to 21.1.2
(cherry picked from commit 95ddfa102a)
2025-10-10 13:40:18 -07:00
Weihang Lo 73481bf395 [beta-1.91] Update cargo submodule 2025-10-10 15:51:34 -04:00
Josh Stone 3222bef156 bootstrap: add Builder::rustc_cmd that includes the lib path
When building with `rust.rpath = false`, every `rustc` invocation needs
to include the library path as well. I particularly ran into this in
`generate_target_spec_json_schema` when testing 1.91-beta in Fedora,
where we do disable rpath for our system builds. The new helper function
will hopefully encourage the right thing going forward.

(cherry picked from commit 03cdcb5cd5)
2025-10-10 09:56:39 -07:00
Jonathan Brouwer 555abc18d7 Add regression test for link_section targets
(cherry picked from commit 1589c6c12d)
2025-10-10 09:30:05 -07:00
Jonathan Brouwer 15843ffde1 Fix target list of link_section
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
(cherry picked from commit 4787834eda)
2025-10-10 09:23:48 -07:00
Michael Goulet 91163a9e1e Don't normalize higher-ranked assumptions if they're not used
(cherry picked from commit e3f104608c)
2025-10-10 09:20:53 -07:00
bors 21cd82aa63 Auto merge of #147284 - cuviper:beta-next, r=cuviper
[beta] backports

- remove incorrect fast path rust-lang/rust#146919
- Fix infinite recursion in Path::eq with String rust-lang/rust#146958
- Make #[link="dl"] an FCW rather than an error rust-lang/rust#147262

r? cuviper
2025-10-08 03:09:11 +00:00
Jonathan Brouwer 0d2b92cd1e Make #[link="dl"] a warning rather than an error
(cherry picked from commit 1c85a1dc2e)
2025-10-07 15:41:15 -07:00
Jonathan Brouwer d4278373a9 Add failing regression test for #[link="dl"]
(cherry picked from commit 5c95f8bea6)
2025-10-07 15:41:15 -07:00
Josh Stone 61380c48dd Update cargo submodule from branch rust-1.91.0 2025-10-07 15:41:15 -07:00
Iris Shi 6271db5ab5 Fix infinite recursion in Path::eq with String
(cherry picked from commit 5a4e536036)
2025-10-07 15:41:15 -07:00
lcnr 34182f6e7d add test
(cherry picked from commit 7a0adc0878)
2025-10-02 16:20:09 -07:00
lcnr dad01bc9a8 remove test for no_core
(cherry picked from commit 83532f8544)
2025-10-02 16:20:09 -07:00
lcnr b6643862e8 yeet fastpath
(cherry picked from commit 4fcafc9daa)
2025-10-02 16:20:09 -07:00
bors aa7859c0de Auto merge of #147030 - nikic:revert-alloc-zeroed, r=wesleywiser
Revert "Auto merge of #144086 - clubby789:alloc-zeroed, r=nikic"

This reverts commit 040a98af70, reversing changes made to e8a792daf5.

This reverts https://github.com/rust-lang/rust/pull/144086 on beta due to https://github.com/rust-lang/rust/issues/145995. On master the issue will be fixed by https://github.com/rust-lang/rust/pull/146766.
2025-09-27 12:39:02 +00:00
dianne f1fbf1f6ae add positive and negative tests for temporary scope shortening FCW 2025-09-26 01:39:40 -07:00
Nikita Popov 186d91daf7 Revert "Auto merge of #144086 - clubby789:alloc-zeroed, r=nikic"
This reverts commit 040a98af70, reversing
changes made to e8a792daf5.
2025-09-25 16:36:51 +02:00
bors bb624dcb4c Auto merge of #146815 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] bump to released stable compiler

https://forge.rust-lang.org/release/process.html#beta-stage0-update-friday

r? `@Mark-Simulacrum`
2025-09-20 19:51:19 +00:00
Mark Rousskov af93ed5a79 Bump to released stable compiler on beta branch 2025-09-20 13:13:53 -04:00
bors b34cfaf51a Auto merge of #146687 - lambdageek:revert-rc-for-beta, r=jieyouxu
[beta] Revert "compiler: Add Windows resources to rustc-main and rustc_driver"

This reverts rust-lang/rust#146018 due to rust-lang/rust#146693
2025-09-19 09:02:13 +00:00
Aleksey Kliger 6347e7f7e0 Revert "compiler: Add Windows resources to rustc-main and rustc_driver"
This reverts commit 095fa86a3b.
2025-09-17 16:33:41 -04:00
bors 1bffa23001 Auto merge of #146545 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] Initial cut for 1.91 beta

https://forge.rust-lang.org/release/process.html#beta-pr

Also backports:

- Only run Cranelift dist test on nightly rust-lang/rust#146582

r? `@Mark-Simulacrum`
2025-09-15 15:35:56 +00:00
Jakub Beránek 8499d50da0 Only run Cranelift dist test on nightly 2025-09-15 08:36:53 -04:00
Mark Rousskov 9c650eade6 Set channel to beta 2025-09-14 14:43:32 -04:00
Mark Rousskov 03265b459f Update CURRENT_RUSTC_VERSION post-bump 2025-09-14 14:43:32 -04:00
bors a015919e54 Auto merge of #146526 - jhpratt:rollup-afb1dgo, r=jhpratt
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#113095 (Document `become` keyword)
 - rust-lang/rust#146159 (Some hygiene doc improvements)
 - rust-lang/rust#146171 (tidy: check that error messages don't start with a capitalized letter)
 - rust-lang/rust#146419 (Update the arm-* and aarch64-* platform docs.)
 - rust-lang/rust#146473 (Revert "Constify SystemTime methods")
 - rust-lang/rust#146506 (Fix small typo in check-cfg.md)
 - rust-lang/rust#146517 (fix Condvar::wait_timeout docs)
 - rust-lang/rust#146521 (document `core::ffi::VaArgSafe`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-13 23:02:12 +00:00
Jacob Pratt da1c27df16 Rollup merge of #146521 - folkertdev:document-va-arg-safe, r=workingjubilee
document `core::ffi::VaArgSafe`

tracking issue: https://github.com/rust-lang/rust/issues/44930

A modification of https://github.com/rust-lang/rust/pull/146454, keeping just the documentation changes, but not unsealing the trait.

Although conceptually we'd want to unseal the trait, there are many edge cases to supporting arbitrary types. We'd need to exhaustively test that all targets/calling conventions support all types that rust might generate (or generate proper error messages for unsupported cases). At present, many of the `va_arg` implementations assume that the argument is a scalar, and has an alignment of at most 8. That is totally  sufficient for an MVP (accepting all of the "standard" C types), but clearly does not cover all rust types.

This PR also adds some various other tests for edge cases of c-variadic:

- the `#[inline]` attribute in its various forms. At present, LLVM is unable to inline c-variadic functions, but the attribute should still be accepted. `#[rustc_force_inline]` already rejects c-variadic functions.
- naked functions should accept and work with a C variable argument list. In the future we'd like to allow more ABIs with naked functions (basically, any ABI for which we accept defining foreign c-variadic functions), but for now only  `"C"` and `"C-unwind` are supported
- guaranteed tail calls: c-variadic functions cannot be tail-called. That was already rejected, but there was not test for it.

r? `@workingjubilee`
2025-09-13 18:55:20 -04:00
Jacob Pratt 08db93806b Rollup merge of #146517 - RalfJung:wait-timeout, r=joboet
fix Condvar::wait_timeout docs

[Context](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Condvar.20wait_timeout.20sleep.20duration.20decremented/with/539279839)
r? `@joboet`
2025-09-13 18:55:19 -04:00
Jacob Pratt 392d2fad16 Rollup merge of #146506 - mikysett:patch-1, r=Urgau
Fix small typo in check-cfg.md
2025-09-13 18:55:18 -04:00
Jacob Pratt 5d56e52409 Rollup merge of #146473 - RalfJung:system-time-deconst, r=workingjubilee
Revert "Constify SystemTime methods"

This reverts https://github.com/rust-lang/rust/pull/144519. The const-hacks introduces bugs, and they make the code harder to maintain. Let's wait until we can constify these functions without changing their implementation.

Fixes https://github.com/rust-lang/rust/issues/146228.
Closes https://github.com/rust-lang/rust/issues/144517 (since the feature is gone).
r? `@tgross35`
Cc `@clarfonthey`
2025-09-13 18:55:18 -04:00