Commit Graph

303456 Commits

Author SHA1 Message Date
Scott McMurray eee28138b8 Use as_array in PartialEq for arrays 2025-08-03 12:47:11 -07:00
Waffle Lapkin c539890ae6 forbid tail calling intrinsics 2025-08-03 21:21:39 +02:00
Kivooeo 3aeeae6d44 remove rust_ prefixes 2025-08-03 23:25:36 +05:00
Kivooeo 74e85a218b removed gate 2025-08-03 22:56:02 +05:00
Antoni Boucher 681651350f Only use bitcast in Builder::ret for non-native integers 2025-08-03 13:31:40 -04:00
llogiq 470ee4f01d don't allocate a Vec in an Iterator::chain (#15400)
changelog: none
2025-08-03 16:58:15 +00:00
llogiq 151a045fdd clean-up SourceFileRange::as_str (#15401)
changelog: none
2025-08-03 16:56:11 +00:00
Shoyu Vanilla 7d78968bd0 fix: Error on illegal [const]s inside blocks within legal positions 2025-08-04 01:48:28 +09:00
Antoni Boucher 035ff85042 Fix intcast to use the is_signed parameter 2025-08-03 11:58:13 -04:00
bors f34ba774c7 Auto merge of #144732 - lcnr:ignore-shadowed-impls, r=compiler-errors
dont assemble shadowed impl candidates

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/109.

I've originally intended to fix this by supporting lazy reevaluation when rerunning cycles. This ended up being really difficult, see https://github.com/lcnr/search_graph for my notes used while working on this. It is also insufficient for the `rayon-hang-2.rs` test as we end up with goals which we need to rerun for all combinations of provisional results. While landing such an optimization in the future may still be desirable, it is very difficult and insufficient to fix these hangs. Also see the relevant [zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/rustc-rayon.20hang/near/527850058).

I was previously opposed to avoiding assembling shadowed impls as it may prevent future improvements in this area, cc rust-lang/rust#141226. Going to track this and the reasoning behind it in https://github.com/rust-lang/trait-system-refactor-initiative/issues/226.

r? `@BoxyUwU` `@compiler-errors`
2025-08-03 15:33:31 +00:00
Ada Alakbarova 2d8d45e201 use ? for brevity 2025-08-03 17:16:28 +02:00
Ada Alakbarova 3b907eada7 use parens for clearer formatting
the first and second lines now each represent one approach to getting a
`source`
2025-08-03 17:16:28 +02:00
Ada Alakbarova 02ebef4c6a don't allocate a Vec in an Iterator::chain 2025-08-03 17:13:54 +02:00
Kivooeo 754654d5a9 rename rust_panic_without_hook 2025-08-03 17:59:37 +05:00
Lukas Wirth efbe625e35 Merge pull request #20372 from Hmikihiro/remove_unused_fn_from_edit_in_place
Remove unused functions from edit_in_place.rs
2025-08-03 10:59:40 +00:00
Folkert de Vries c691374cc1 Merge pull request #1889 from rust-lang/rustc-pull
Rustc pull update
2025-08-03 10:44:41 +00:00
Hmikihiro 277cf46d3e Remove unused functions from edit_in_place 2025-08-03 19:40:54 +09:00
Folkert de Vries daa742afe5 Merge pull request #1892 from madhav-madhusoodanan/intrinsic-test-constraint-update
`Intrinsic-test`: Updated the Constraint enum to support discrete values
2025-08-03 10:30:10 +00:00
Madhav Madhusoodanan 3b216c3f6f feat: Added another variant of the Constraint enum 2025-08-03 15:33:46 +05:30
Nicholas Nethercote 2434d8cecf Remove unused arg from path_append_impl.
None of the impls use it.
2025-08-03 19:58:59 +10:00
Nicholas Nethercote 03dab500a2 Remove p!.
It's a cryptic macro that makes some things slightly more concise in
`PrettyPrinter`. E.g. if you declare `define_scope_printer!(p)` in a
scope you can then call `p! to get these transformations:
```
p!("foo");         -->  write!(p, "foo")?;
p!(print(ty));     -->  ty.print(p)?;
p!(method(args));  -->  p.method(args)?;
```
You can also chain calls, e.g.:
```
p!("foo", print(ty));  -->  write!(p, "foo")?; ty.print(p)?;
```
Ultimately this doesn't seem worth it. The macro definition is hard to
read, the call sites are hard to read, `define_scope_printer!` is pretty
gross, and the code size reductions are small. Tellingly, many normal
`write!` and `print` calls are sprinkled throughout the code, probably
because people have made modifications and didn't want to use or
understand how to use `p!`.

This commit removes it.
2025-08-03 19:58:56 +10:00
Nicholas Nethercote 03bc1be8dd Simplify SymbolMangler::print_type.
`Bound`/`Placeholder`/`Infer`/`Error` shouldn't occur, so we can handle
them in the second exhaustive `match`, and ignore them in the first
non-exhaustive `match`.
2025-08-03 19:58:00 +10:00
Nicholas Nethercote 1698c8e322 Rename Printer variables.
Currently they are mostly named `cx`, which is a terrible name for a
type that impls `Printer`/`PrettyPrinter`, and is easy to confuse with
other types like `TyCtxt`. This commit changes them to `p`. A couple of
existing `p` variables had to be renamed to make way.
2025-08-03 19:58:00 +10:00
Nicholas Nethercote e7d6a0776b Remove type_name::AbsolutePathPrinter::comma_sep.
It's equivalent to the default `PrettyPrinter::comma_sep`.
2025-08-03 19:58:00 +10:00
Nicholas Nethercote bd0a308ca2 Inline and remove two FmtPrinter methods.
They each have a single call site.
2025-08-03 19:58:00 +10:00
Nicholas Nethercote df524163be Mark Printer methods as unreachable where appropriate.
This helps me understand the structure of the code a lot.

If any of these are actually reachable, we can put the old code back,
add a new test case, and we will have improved our test coverage.
2025-08-03 19:58:00 +10:00
nora 788845811e Merge pull request #2532 from rust-lang/tshepang/date-check
there is still no official policy regarding new rustc crate deps
2025-08-03 11:56:03 +02:00
bors 7cd950546b Auto merge of #144704 - compiler-errors:explode-wf, r=lcnr
expand WF obligations when checking method calls

Don't wrap a bunch of signatures in `FnPtr` then check their WF; instead, check the WFness of each input/output separately.

This is useful for the new trait solver, since because we stall on root obligations we end up needing to repeatedly recompute the WFness of possibly very large function signature types if it ends up bottoming out in ambiguity.

This may also give us more chances to hit the WF fast path for certain types like built-ins.

Finally, this just seems conceptually correct to do. There's nothing conceptually that suggests that wrapping the function signature in an fn pointer makes sense at all to do; I'm guessing that it was just convenient so that we didn't have to register WF obligations in a loop, but it doesn't affect the readability of this code at all.
2025-08-03 09:29:54 +00:00
Zalathar 3abbdffdbf For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info
Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that
test programs can link against stage 1 rustc crates.

Unfortunately, using the stage 0 compiler causes problems when compiletest
tries to obtain target information from the compiler, but the output format has
changed since the last bootstrap beta bump.

We can work around this by also providing compiletest with a stage 1 compiler,
and having it use that compiler to query for target information.
2025-08-03 18:07:54 +10:00
Lukas Wirth 0d2a7e6654 Merge pull request #20371 from Hmikihiro/migrate_generate_trait_from_impl
Migrate `generate_trait_from_impl` assist to use `SyntaxEditor`
2025-08-03 07:23:07 +00:00
Hmikihiro b373cb1006 Migrate generate_trait_from_impl assist to use SyntaxEditor 2025-08-03 16:12:08 +09:00
Jason Newcomb 88bcf1ca19 fix option-if-let-else lint (#15394)
some simple twists
Fixes rust-lang/rust-clippy#15002
Fixes rust-lang/rust-clippy#15379

changelog: [`option_if_let_else`]: Don't remove raw pointer derefs in
suggestions
changelog: [`option_if_let_else`]: Don't suggest passing argless
functions to `Result::map_or_else`
2025-08-03 06:55:48 +00:00
Lukas Wirth e47f791a60 Merge pull request #20368 from Hmikihiro/migrate_delegate_methods
Migrate `generate_delegate_methods` assist to use `SyntaxEditor`
2025-08-03 06:37:22 +00:00
Lukas Wirth 279b4643e8 Merge pull request #20364 from Hmikihiro/migrate_convert_from_to_tryfrom
Migrate `convert_from_to_tryfrom` assist to use `SyntaxEditor`
2025-08-03 06:36:15 +00:00
Jason Newcomb fa09b86bfc Simplify boolean expression in manual_assert (#15368)
Fixes rust-lang/rust-clippy#15359

changelog: [`manual_assert`]: simplify boolean expression
2025-08-03 05:41:51 +00:00
bors da19b9d24c Auto merge of #144677 - nnethercote:bound-const-handling, r=lcnr
Improve bound const handling

A few changes to make const handling more similar to type handling.

r? `@compiler-errors` -errors
2025-08-03 05:26:43 +00:00
Tshepang Mbambo f84c62112a there is still no official policy 2025-08-03 07:18:26 +02:00
Tshepang Mbambo 3bba46bb52 Merge pull request #2509 from rust-lang/tshepang-auto-toc
make toc generation fully automatic
2025-08-03 06:55:44 +02:00
Zalathar 1063b0f090 Change TestCx::error to error_prefix, which returns a string
This reduces the amount of "hidden" printing in error-reporting code, which
will be helpful when overhauling compiletest's error handling and output
capture.
2025-08-03 13:47:40 +10:00
Zalathar d1d44d44f1 Consolidate all ProcRes unwinds into one code path 2025-08-03 13:38:08 +10:00
Zalathar 2ddf0ca9f5 Change ProcRes::print_info to format_info
This method now returns a string instead of printing directly to
(possibly-captured) stdout.
2025-08-03 13:38:07 +10:00
Sayantan Chakraborty 56ba98c7fe Merge pull request #1893 from folkertdev/loongarch-gcc
use gcc 15 as the linker on loongarch
2025-08-03 03:24:12 +00:00
Camille GILLOT effc509b40 Simplify lint emission. 2025-08-03 02:48:58 +00:00
Camille GILLOT 377728a404 Keep scanned set across calls to mark_live_symbols. 2025-08-03 02:09:55 +00:00
Camille GILLOT f601717c5b Use less HIR when seeding work list. 2025-08-03 02:04:58 +00:00
Camille GILLOT 6c39b30f80 Simplify handling of unsolved items. 2025-08-03 02:04:26 +00:00
Camille GILLOT 99ee62305a Remove struct_constructors. 2025-08-03 01:44:20 +00:00
github-actions 97435739ff cargo update
compiler & tools dependencies:
     Locking 14 packages to latest compatible versions
    Updating clap v4.5.41 -> v4.5.42
    Updating clap_builder v4.5.41 -> v4.5.42
    Updating jsonpath-rust v1.0.3 -> v1.0.4
    Updating libredox v0.1.6 -> v0.1.9
    Updating object v0.37.1 -> v0.37.2
    Updating redox_syscall v0.5.16 -> v0.5.17
    Updating redox_users v0.5.0 -> v0.5.2
    Updating rustc-demangle v0.1.25 -> v0.1.26
    Updating serde_json v1.0.141 -> v1.0.142
    Updating wasm-encoder v0.235.0 -> v0.236.0
    Updating wasmparser v0.235.0 -> v0.236.0
    Updating wast v235.0.0 -> v236.0.0
    Updating wat v1.235.0 -> v1.236.0
    Updating windows-targets v0.53.2 -> v0.53.3
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 3 packages to latest compatible versions
    Updating object v0.37.1 -> v0.37.2
    Updating rustc-demangle v0.1.25 -> v0.1.26
    Updating unwinding v0.2.7 -> v0.2.8
note: pass `--verbose` to see 2 unchanged dependencies behind latest

rustbook dependencies:
     Locking 6 packages to latest compatible versions
    Updating cc v1.2.30 -> v1.2.31
    Updating clap v4.5.41 -> v4.5.42
    Updating clap_builder v4.5.41 -> v4.5.42
    Updating redox_syscall v0.5.16 -> v0.5.17
    Updating serde_json v1.0.141 -> v1.0.142
    Updating windows-targets v0.53.2 -> v0.53.3
2025-08-03 00:27:18 +00:00
bors 5b9564a189 Auto merge of #144814 - samueltardieu:rollup-qyum1hj, r=samueltardieu
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links)
 - rust-lang/rust#143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`)
 - rust-lang/rust#143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.)
 - rust-lang/rust#143771 (Constify some more `Result` functions)
 - rust-lang/rust#144185 (Document guarantees of poisoning)
 - rust-lang/rust#144395 (update fortanix tests)
 - rust-lang/rust#144478 (Improve formatting of doc code blocks)
 - rust-lang/rust#144614 (Fortify RemoveUnneededDrops test.)
 - rust-lang/rust#144703 ([test][AIX] ignore extern_weak linkage test)
 - rust-lang/rust#144747 (compiletest: Improve diagnostics for line annotation mismatches 2)
 - rust-lang/rust#144756 (detect infinite recursion with tail calls in ctfe)
 - rust-lang/rust#144766 (Add human readable name "Cygwin")
 - rust-lang/rust#144782 (Properly pass path to staged `rustc` to `compiletest` self-tests)
 - rust-lang/rust#144786 (Cleanup the definition of `group_type`)
 - rust-lang/rust#144796 (Add my previous commit name to .mailmap)
 - rust-lang/rust#144797 (Update safety comment for new_unchecked in niche_types)
 - rust-lang/rust#144803 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-02 23:49:08 +00:00
Camille GILLOT aba0b65707 Use DefKind in should_explore. 2025-08-02 22:42:54 +00:00