Commit Graph

271243 Commits

Author SHA1 Message Date
Ulrich Weigand
3ae8036f66
Update src/doc/rustc/src/platform-support/s390x-unknown-linux-gnu.md
Co-authored-by: Josh Stone <cuviper@gmail.com>
2024-11-18 21:31:39 +01:00
Ralf Jung
c6974344a5 interpret: do not ICE when a promoted fails with OOM 2024-11-18 20:48:03 +01:00
maxcabrajac
f6340f13bb Add MutVisitor::visit_fn_ret_ty 2024-11-18 15:49:09 -03:00
rustbot
3adbc16385 Update books 2024-11-18 10:47:40 -08:00
Eric Huss
1b0e78738b Add reference annotations for diagnostic attributes
This adds reference annotations for `diagnostic::on_unimplmented` and
the `diagnostic` namespace in general.
2024-11-18 10:45:26 -08:00
Ulrich Weigand
8f95079cfc Document s390x-unknown-linux targets
This adds documentation for the following existing targets:
  s390x-unknown-linux-gnu (Tier 2 with host tools)
  s390x-unknown-linux-musl (Tier 3)

I volunteer as maintainer for these targets going forward.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2024-11-18 19:44:25 +01:00
maxcabrajac
e65deb5ee1 Add Visitor::visit_qself 2024-11-18 15:43:35 -03:00
maxcabrajac
09c268417f Add Visitor::visit_fn_decl 2024-11-18 15:40:34 -03:00
Michael Howell
3fbcc1f4b9 rustdoc-search: use smart binary search in bitmaps
Addresses a comment from [jsha's benchmarking], where the `contains`
function showed up in the profiler. This commit pulls it from about
5% of the runtime to about 0.5%.

[jsha's benchmarking]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/search.20profiling/near/481868761
2024-11-18 11:38:25 -07:00
bors
03ee484519 Auto merge of #133179 - GuillaumeGomez:rollup-ro5rtts, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #133156 (typo in config.example.toml)
 - #133157 (stability: remove skip_stability_check_due_to_privacy)
 - #133163 (remove pointless cold_path impl in interpreter)
 - #133169 (Update autolabels for T-compiler and T-bootstrap)
 - #133171 (Add the missing quotation mark in comment)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-18 17:58:35 +00:00
Urgau
79c8e64162 Update xshell and xshell-macros to v0.2.7 2024-11-18 18:52:27 +01:00
Urgau
58664de837 Bump stdarch to the latest master 2024-11-18 18:52:27 +01:00
Urgau
e8bd643450 Update anstream to 0.6.18 to fix a check-cfg issue 2024-11-18 18:52:27 +01:00
Urgau
cc48194baf Report unexpected_cfgs lint in external macros 2024-11-18 18:52:27 +01:00
Ralf Jung
31f5c3ba69 const_panic: inline in bootstrap builds to avoid f16/f128 crashes 2024-11-18 18:17:02 +01:00
Guillaume Gomez
8b0f8cb73c Add regression test for jump to def links on items with generics 2024-11-18 18:11:50 +01:00
Guillaume Gomez
786b7477f6 Fix items with generics not having their jump to def link generated 2024-11-18 17:58:57 +01:00
Guillaume Gomez
62d0235a4a
Rollup merge of #133171 - binchengqu:master, r=jieyouxu
Add the missing quotation mark in comment
2024-11-18 17:17:44 +01:00
Guillaume Gomez
36180d9c71
Rollup merge of #133169 - jieyouxu:update-triagebot-labels, r=WaffleLapkin
Update autolabels for T-compiler and T-bootstrap

- Tag more test suite changes with `T-compiler`.
- Tag `src/build_helper` with `T-bootstrap`.
2024-11-18 17:17:44 +01:00
Guillaume Gomez
4baf540fce
Rollup merge of #133163 - RalfJung:cold, r=saethlin
remove pointless cold_path impl in interpreter

This has a fallback impl so the interpreter impl is not needed.

r? ``@saethlin``
2024-11-18 17:17:43 +01:00
Guillaume Gomez
86ba13ba2f
Rollup merge of #133157 - RalfJung:skip_stability_check_due_to_privacy, r=compiler-errors
stability: remove skip_stability_check_due_to_privacy

This was added in https://github.com/rust-lang/rust/pull/38689 to deal with https://github.com/rust-lang/rust/issues/38412. However, even after removing the check, the relevant tests still pass. Let's see if CI finds any other tests that rely on this. If not, it seems like logic elsewhere in the compiler changed so this is not required any more.
2024-11-18 17:17:42 +01:00
Guillaume Gomez
1a0bc61314
Rollup merge of #133156 - tshepang:patch-5, r=jieyouxu
typo in config.example.toml
2024-11-18 17:17:41 +01:00
Guillaume Gomez
8ea02578cd Fix typo 2024-11-18 17:00:44 +01:00
MarcoIeni
37ea2028be
ci: use free runner in dist-i686-msvc 2024-11-18 16:12:40 +01:00
bors
c602e9aeaa Auto merge of #133160 - jhpratt:rollup-wzj9q15, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - #132934 (Overhaul the `-l` option parser (for linking to native libs))
 - #133142 (rename rustc_const_stable_intrinsic -> rustc_intrinsic_const_stable_indirect)
 - #133145 (Document alternatives to `static mut`)
 - #133158 (Subtree update of `rust-analyzer`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-18 12:46:07 +00:00
binchengqu
a307c5499e Add the missing quotation mark in comment
Signed-off-by: binchengqu <bincheng@before.tech>
2024-11-18 20:18:22 +08:00
Jieyou Xu
75661c535f Tag src/build_helper with T-bootstrap 2024-11-18 20:07:03 +08:00
Jieyou Xu
1569414574 Tag more test suite changes with T-compiler 2024-11-18 20:03:57 +08:00
lcnr
2e087d2eaa review 2024-11-18 10:50:14 +01:00
lcnr
9cba14b95b use TypingEnv when no infcx is available
the behavior of the type system not only depends on the current
assumptions, but also the currentnphase of the compiler. This is
mostly necessary as we need to decide whether and how to reveal
opaque types. We track this via the `TypingMode`.
2024-11-18 10:38:56 +01:00
Ralf Jung
dff98a8a14 remove pointless cold_path impl in interpreter 2024-11-18 08:41:28 +01:00
Jacob Pratt
194c76ef0a
Rollup merge of #133158 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-11-18 02:24:36 -05:00
Jacob Pratt
19c145d816
Rollup merge of #133145 - kornelski:static-mutex, r=traviscross
Document alternatives to `static mut`

In #133143 I've noticed alternatives to `static mut` aren't documented anywhere.
2024-11-18 02:24:36 -05:00
Jacob Pratt
72a8d536ef
Rollup merge of #133142 - RalfJung:naming-is-hard, r=compiler-errors
rename rustc_const_stable_intrinsic -> rustc_intrinsic_const_stable_indirect

In https://github.com/rust-lang/rust/pull/120370 this name caused confusion as the author thought the intrinsic was stable. So let's try a different name...

If we can land this before the beta cutoff we can avoid needing `cfg(bootstrap)` for this. ;)
Cc `@compiler-errors` `@saethlin`
2024-11-18 02:24:35 -05:00
Jacob Pratt
21654a2f44
Rollup merge of #132934 - Zalathar:native-libs, r=jieyouxu
Overhaul the `-l` option parser (for linking to native libs)

The current parser for `-l` options has accumulated over time, making it hard to follow. This PR tries to clean it up in several ways.

Key changes:
- This code now gets its own submodule, to slightly reduce clutter in `rustc_session::config`.
- Cleaner division between iterating over multiple `-l` options, and processing each individual one.
- Separate “split” step that breaks up the value string into `[KIND[:MODIFIERS]=]NAME[:NEW_NAME]`, but leaves parsing/validating those parts to later steps.
  - This step also gets its own (disposable) unit test, to make sure it works as expected.
- A context struct reduces the burden of parameter passing, and makes it easier to write error messages that adapt to nightly/stable compilers.
- Fewer calls to `nightly_options` helper functions, because at this point we can get the same information from `UnstableOptions` and `UnstableFeatures` (which are downstream of earlier calls to those helper functions).

There should be no overall change in compiler behaviour.
2024-11-18 02:24:35 -05:00
bors
e83c45a98b Auto merge of #128219 - connortsui20:rwlock-downgrade, r=tgross35
Rwlock downgrade

Tracking Issue: #128203

This PR adds a `downgrade` method for `RwLock` / `RwLockWriteGuard` on all currently supported platforms.

Outstanding questions:
- [x] ~~Does the `futex.rs` change affect performance at all? It doesn't seem like it will but we can't be certain until we bench it...~~
- [x] ~~Should the SOLID platform implementation [be ported over](https://github.com/rust-lang/rust/pull/128219#discussion_r1693470090) to the `queue.rs` implementation to allow it to support downgrades?~~
2024-11-18 07:24:12 +00:00
Ralf Jung
b07ed6ab16 stability: remove skip_stability_check_due_to_privacy 2024-11-18 08:07:46 +01:00
Ralf Jung
9d4b1b2db4 rename rustc_const_stable_intrinsic -> rustc_intrinsic_const_stable_indirect 2024-11-18 07:47:44 +01:00
Nicholas Nethercote
2765432d32 Improve {BTreeMap,HashMap}::get_key_value docs.
They are unusual methods. The docs don't really describe the cases when
they might be useful (as opposed to just `get`), and the examples don't
demonstrate the interesting cases at all.

This commit improves the docs and the examples.
2024-11-18 16:53:12 +11:00
Tshepang Mbambo
bedecf94ce
typo in config.example.toml 2024-11-18 07:45:33 +02:00
Zalathar
78edefea9d Overhaul the -l option parser (for linking to native libs) 2024-11-18 15:55:12 +11:00
Zalathar
478db489b3 Move -l option parsing into its own submodule
No functional change (yet).
2024-11-18 15:55:12 +11:00
Zalathar
2902bca654 Add some UI tests for -l modifier parsing 2024-11-18 15:55:12 +11:00
bors
bf6adec108 Auto merge of #133152 - jhpratt:rollup-wkqs5ud, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - #132795 (Check `use<..>` in RPITIT for refinement)
 - #132944 (add parentheses when unboxing suggestion needed)
 - #132993 (Make rustc consider itself a stable compiler when `RUSTC_BOOTSTRAP=-1`)
 - #133130 (`suggest_borrow_generic_arg`: instantiate clauses properly)
 - #133133 (rustdoc-search: add standalone trailing `::` test)
 - #133143 (Diagnostics for let mut in item context)
 - #133147 (Fixup some test directives)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-18 04:17:11 +00:00
Jacob Pratt
f6374b4b71
Rollup merge of #133147 - ChrisDenton:fixup, r=compiler-errors
Fixup some test directives

- A random comment had somehow been turned into an `//`@`` directive.
- More dubiously I also removed leading spaces from directives in 3 UI tests for consistency. These are the only rustc tests that use that formatting.

r? `@jieyouxu`
2024-11-17 22:30:51 -05:00
Jacob Pratt
6c4a7b6ff3
Rollup merge of #133143 - kornelski:let-mut-global, r=compiler-errors
Diagnostics for let mut in item context

The diagnostics for `let` at the top level did not account for `let mut`, which [made the error unclear](https://users.rust-lang.org/t/create-a-vector-of-constants-outside-main/121251/1).

I've made the diagnostic always display a link to valid items. I've added dedicated help for `let mut` case that suggests using a `Mutex` (to steer novice users away from the `static mut` trap). Unfortunately, neither the Rust book, nor libstd docs have dedicated section listing all other types for interior-mutable `static`s.
2024-11-17 22:30:51 -05:00
Jacob Pratt
8600e579d5
Rollup merge of #133133 - notriddle:notriddle/trailing-test, r=GuillaumeGomez
rustdoc-search: add standalone trailing `::` test

Follow up for #132569

r? `@GuillaumeGomez`
2024-11-17 22:30:50 -05:00
Jacob Pratt
fc4f71db68
Rollup merge of #133130 - dianne:fix-133118, r=compiler-errors
`suggest_borrow_generic_arg`: instantiate clauses properly

This simplifies and fixes the way `suggest_borrow_generic_arg` instantiates callees' predicates when testing them to see if a moved argument can instead be borrowed. Previously, it would ICE if the moved argument's type included a region variable, since it was getting passed to a call of `EarlyBinder::instantiate`. This makes the instantiation much more straightforward, which also fixes the ICE.

Fixes #133118

This also modifies `tests/ui/moves/moved-value-on-as-ref-arg.rs` to have more useful bounds on the tests for suggestions to borrow `Borrow` and `BorrowMut` arguments. With its old tautological `T: BorrowMut<T>` bound, this fix would make it suggest a shared borrow for that argument.
2024-11-17 22:30:49 -05:00
Jacob Pratt
c68fef9fc9
Rollup merge of #132993 - jieyouxu:i_am_very_stable, r=chenyukang
Make rustc consider itself a stable compiler when `RUSTC_BOOTSTRAP=-1`

Addresses https://github.com/rust-lang/rust/issues/123404 to allow test writers to specify `//@ rustc-env:RUSTC_BOOTSTRAP=-1` to have a given rustc consider itself a stable rustc. This is only intended for testing usages.

I did not use `RUSTC_BOOTSTRAP=0` because that can be confusing, i.e. one might think that means "not bootstrapping", but "forcing a given rustc to consider itself a stable compiler" is a different use case.

I also added a specific test to check `RUSTC_BOOTSTRAP`'s various values and how that interacts with rustc's stability story w.r.t. features and cli flags.

Noticed when trying to write a test for enabling ICE file dumping on stable.

Dunno if this needs a compiler FCP or MCP, but I can file an MCP or ask someone to start an FCP if needed. Note that `RUSTC_BOOTSTRAP` is a perma-unstable env var and has no stability guarantees (heh) whatsoever. This does not affect bootstrapping because bootstrap never sets `RUSTC_BOOTSTRAP=-1`. If someone does set that when bootstrapping, it is considered PEBKAC.

Accompanying dev-guide PR: https://github.com/rust-lang/rustc-dev-guide/pull/2136

cc `@estebank` and `@rust-lang/wg-diagnostics` for FYI
2024-11-17 22:30:49 -05:00
Jacob Pratt
c874121487
Rollup merge of #132944 - linyihai:needing-parenthases-issue-132924, r=chenyukang
add parentheses when unboxing suggestion needed

This PR tried to `add parentheses when unboxing suggestion needed`

Fixes #132924
2024-11-17 22:30:48 -05:00