Commit Graph

278239 Commits

Author SHA1 Message Date
lcnr
0910173b35 add test 2025-01-17 13:23:25 +01:00
lcnr
94bf8f04f4 add cache to AmbiguityCausesVisitor 2025-01-17 10:01:45 +01:00
lcnr
ebbcfd4e77 avoid running the overlap check twice 2025-01-15 09:58:04 +01:00
bors
93ba568ab9 Auto merge of #135385 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 27 packages to latest compatible versions
    Updating bitflags v2.6.0 -> v2.7.0
    Updating clap v4.5.23 -> v4.5.26
    Updating clap_builder v4.5.23 -> v4.5.26
    Updating clap_complete v4.5.40 -> v4.5.42
    Updating clap_derive v4.5.18 -> v4.5.24
    Updating handlebars v6.2.0 -> v6.3.0
    Updating libz-sys v1.1.20 -> v1.1.21
    Updating linux-raw-sys v0.4.14 -> v0.4.15
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating pin-project-lite v0.2.15 -> v0.2.16
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating rustix v0.38.42 -> v0.38.43
    Updating serde_json v1.0.134 -> v1.0.135
      Adding siphasher v1.0.1
    Updating syn v2.0.94 -> v2.0.96
    Updating thiserror v2.0.9 -> v2.0.11
    Updating thiserror-impl v2.0.9 -> v2.0.11
    Updating tokio v1.42.0 -> v1.43.0
    Updating uuid v1.11.0 -> v1.11.1
    Updating wasm-encoder v0.222.0 -> v0.223.0
      Adding wasmparser v0.223.0
    Updating wast v222.0.0 -> v223.0.0
    Updating wat v1.222.0 -> v1.223.0
    Updating xattr v1.3.1 -> v1.4.0
note: pass `--verbose` to see 39 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 4 unchanged dependencies behind latest

rustbook dependencies:
     Locking 27 packages to latest compatible versions
    Updating bitflags v2.6.0 -> v2.7.0
    Updating cc v1.2.7 -> v1.2.8
    Updating clap v4.5.23 -> v4.5.26
    Updating clap_builder v4.5.23 -> v4.5.26
    Updating clap_complete v4.5.40 -> v4.5.42
    Updating clap_derive v4.5.18 -> v4.5.24
      Adding darling v0.20.10
      Adding darling_core v0.20.10
      Adding darling_macro v0.20.10
      Adding derive_builder v0.20.2
      Adding derive_builder_core v0.20.2
      Adding derive_builder_macro v0.20.2
    Updating handlebars v6.2.0 -> v6.3.0
      Adding ident_case v1.0.1
    Updating linux-raw-sys v0.4.14 -> v0.4.15
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating rustix v0.38.42 -> v0.38.43
    Updating serde_json v1.0.134 -> v1.0.135
      Adding siphasher v1.0.1
    Updating syn v2.0.94 -> v2.0.96
    Updating thiserror v2.0.9 -> v2.0.11
    Updating thiserror-impl v2.0.9 -> v2.0.11
    Updating winnow v0.6.22 -> v0.6.24
```
2025-01-15 03:54:21 +00:00
bors
dd333ca66f Auto merge of #135180 - tgross35:update-builtins, r=tgross35
Update compiler-builtins to 0.1.141

0.1.141 syncs changes from `libm`. Most of the `libm` changes are testing- or configuration-related.
2025-01-14 23:46:20 +00:00
bors
8361aef0d7 Auto merge of #135496 - matthiaskrgr:rollup-ps0cjzn, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #134216 (Enable "jump to def" feature on patterns)
 - #134880 (Made `Path::name` only have item name rather than full name)
 - #135466 (Leak check in `impossible_predicates` to avoid monomorphizing impossible instances)
 - #135476 (Remove remnant of asmjs)
 - #135479 (mir borrowck: cleanup late-bound region handling)
 - #135493 (Fix legacy symbol mangling of closures)
 - #135495 (Add missing closing backtick in commit hook message 🐸)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-14 20:52:08 +00:00
Trevor Gross
fcc34b2c44 Update compiler-builtins to 0.1.141
0.1.141 syncs changes from `libm`. Most of the `libm` changes are
testing- or configuration-related.
2025-01-14 18:36:45 +00:00
Matthias Krüger
eb763f81a7
Rollup merge of #135495 - yotamofek:close-backtick, r=Kobzol
Add missing closing backtick in commit hook message 🐸

This has been really bugging me 😮‍💨
2025-01-14 19:25:09 +01:00
Matthias Krüger
f9c2c1256b
Rollup merge of #135493 - compiler-errors:legacy-mangle-closure, r=lqd
Fix legacy symbol mangling of closures

When this code was written, there was no `type_of` implementation for closures. That has long since been changed.

In the UI test:

```
trait A where
    [(); (|| {}, 1).1]: Sized,
{
}
```

We tried to walk up the def path tree for the closure, from closure -> anon const -> trait. When we reached the trait, we tried to call `type_of` on it which obviously doesn't do the right thing and ICEs.

Fixes #135418
2025-01-14 19:25:08 +01:00
Matthias Krüger
7354f6e73b
Rollup merge of #135479 - lcnr:method-calls-on-opaques, r=compiler-errors
mir borrowck: cleanup late-bound region handling

r? types
2025-01-14 19:25:07 +01:00
Matthias Krüger
e0e2f6a200
Rollup merge of #135476 - kleisauke:remove-asmjs-remnant, r=Kobzol
Remove remnant of asmjs

See: https://github.com/rust-lang/rust/issues/131467#issuecomment-2529314603.
2025-01-14 19:25:07 +01:00
Matthias Krüger
866e61aae0
Rollup merge of #135466 - compiler-errors:leak-check-impossible, r=lcnr
Leak check in `impossible_predicates` to avoid monomorphizing impossible instances

Fixes #135462

r? lcnr
2025-01-14 19:25:06 +01:00
Matthias Krüger
ca9a9d2f35
Rollup merge of #134880 - as1100k-forks:fix-rustdoc-json-path-name, r=aDotInTheVoid
Made `Path::name` only have item name rather than full name

Closes #134853

This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code

```rust
pub mod foo {
    pub struct Bar;
}

pub fn get_bar() -> foo::Bar {
    foo::Bar
}
```
and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives:
```json
{
    "41": {
        "id": 41,
        "name": "get_bar",
        "inner": {
            "function": {
                "sig": {
                    "inputs": [],
                    "output": {
                        "resolved_path": {
                            "name": "Bar",
                            "id": 0,
                            "args": { "angle_bracketed": { "args": [], "constraints": [] }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
_Information which isn't useful here was trimmed_

r? aDotInTheVoid
2025-01-14 19:25:05 +01:00
Matthias Krüger
aeadee0642
Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmease
Enable "jump to def" feature on patterns

Part of https://github.com/rust-lang/rust/issues/89095.

Pattern (as in "patterns in pattern matching") were not handled by the feature, it's now added.

It all started when I realized that prelude values like `Some` or `Err` were not getting a link generated either (added support for it in the first commit).

r? ``@fmease``
2025-01-14 19:25:04 +01:00
bors
3736b85779 Auto merge of #135313 - compiler-errors:needs-mono, r=BoxyUwU
Eagerly mono drop for structs with lifetimes

That is, use `!generics.requires_monomorphization()` rather than `generics.is_empty()` like the rest of the mono collector code.
2025-01-14 17:55:26 +00:00
Yotam Ofek
c141f506bc Add missing closing backtick in commit hook message 🐸 2025-01-14 17:25:22 +00:00
Michael Goulet
faafa5c310 Fix legacy symbol mangling of closures 2025-01-14 16:33:03 +00:00
bors
8c39ce5b4f Auto merge of #135278 - tgross35:ignore-std-dep-crates, r=SparrowLii
Exclude dependencies of `std` for diagnostics

Currently crates in the sysroot can show up in diagnostic suggestions, such as in https://github.com/rust-lang/rust/issues/135232. To prevent this, duplicate `all_traits` into `visible_traits` which only shows traits in non-private crates.

Setting `#![feature(rustc_private)]` overrides this and makes items in private crates visible as well, since `rustc_private` enables use of `std`'s private dependencies.

This may be reviewed per-commit.

Fixes: https://github.com/rust-lang/rust/issues/135232
2025-01-14 14:15:39 +00:00
lcnr
99657aa338 mir borrowck: cleanup late-bound region handling 2025-01-14 14:16:12 +01:00
bors
c074d8eee7 Auto merge of #135442 - antoyo:subtree-update_cg_gcc_2025_01_12, r=GuillaumeGomez
Subtree update cg_gcc 2025/01/12

r? GuillaumeGomez
2025-01-14 11:28:34 +00:00
Kleis Auke Wolthuizen
3a66b97b9b Remove remnant of asmjs
See: https://github.com/rust-lang/rust/issues/131467#issuecomment-2529314603.
2025-01-14 10:49:32 +01:00
lcnr
94ffced667
add note to test 2025-01-14 10:06:22 +01:00
Trevor Gross
ed63539282 Mark dependencies of the standard library as private by default
In order to avoid diagnostics suggesting stdlib-private dependencies,
make everything that is a direct dependency of any `std` crates private
by default. Note that this will be overridden, if the same crate is
public elsewhere in the crate graph then that overrides the private
default.

It may also be feasible to do this in the library crate, marking `std`'s
dependencies private via Cargo. However, given that the feature is still
rather unstable, doing this within the compiler seems more
straightforward.

Fixes: https://github.com/rust-lang/rust/issues/135232 [1]
2025-01-14 08:51:19 +00:00
Trevor Gross
2da9accab9 Add tcx.visible_traits() and use it for producing diagnostics
Add an alternative to `tcx.all_traits()` that only shows traits that the
user might be able to use, for diagnostic purposes. With this available,
make use of it for diagnostics including associated type errors, which
is part of the problem with [1].

Includes a few comment updates for related API.

[1]: https://github.com/rust-lang/rust/issues/135232
2025-01-14 08:51:19 +00:00
Trevor Gross
9c34253762 Make #[rustc_private] override dependency visibility
Really this is always-visible override only needs to happen when the
crate is a dependency of itself. However, this is a very internal
feature, so it doesn't seem worth doing any additional filtering here.
2025-01-14 08:51:19 +00:00
Trevor Gross
4dc866c642 rustc_metadata: Rename root to dep_root
Currently `root` or `crate_root` is used to refer to an instance of
`CrateRoot` (representation of a crate's serialized metadata), but the
name `root` sometimes also refers to a `CratePath` representing a "root"
node in the dependency graph. In order to disambiguate, rename all
instances of the latter to `dep_root`.
2025-01-14 08:51:19 +00:00
Trevor Gross
4896a65d18 Add a UI test for stdlib-private dependencies
Introduce a test that shows stdlib-private dependencies leaking into
diagnostics. This is resolved by a later commit.
2025-01-14 08:51:17 +00:00
bors
a48e7b0057 Auto merge of #135473 - matthiaskrgr:rollup-ksnst4l, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #135381 (Add an example for `Vec::splice` inserting elements without removing)
 - #135451 (Remove code duplication when hashing query result and interning node)
 - #135464 (fix ICE with references to infinite structs in consts)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-14 08:45:47 +00:00
Matthias Krüger
4cadb5d513
Rollup merge of #135464 - lukas-code:project-infinite-to-error, r=FedericoBruzzone,oli-obk
fix ICE with references to infinite structs in consts

fixes https://github.com/rust-lang/rust/issues/114484

Normalizing `<Type as Pointee>::Metadata` may emit a (non-fatal) error during trait selection if finding the struct tail of `Type` hits the recursion limit. When this happens, prior this PR, we would treat the projection as rigid, i.e. don't normalize it further. This PR changes it so that we normalize to `ty::Error` instead.

This is important, because to compute the layout of `&Type` we need to compute the layout of `<Type as Pointee>::Metadata`

2ae9916816/compiler/rustc_ty_utils/src/layout.rs (L247-L273)

and computing the layout of a rigid alias will (correctly) fail and needs to report an error to the user. For example:

```rust
trait Project {
    type Assoc;
}

fn foo<T: Project>() {
    [(); {
        let _: Option<T::Assoc> = None;
                   // ^^^^^^^^ this projection is rigid, so we can't know it's layout
        0
    }];
}
```

```
error: constant expression depends on a generic parameter
  --> src/lib.rs:6:10
   |
6  |       [(); {
   |  __________^
7  | |         let _: Option<T::Assoc> = None;
8  | |                    // ^^^^^^^^ this projection is rigid, so we can't know it's layout
9  | |         0
10 | |     }];
   | |_____^
   |
   = note: this may fail depending on what value the parameter takes
```

For non-generic rigid projections we will currently ICE, because we incorrectly assume that `LayoutError::Unknown` means that a const must be generic (https://github.com/rust-lang/rust/issues/135138). This is being fixed and turned into a proper error in https://github.com/rust-lang/rust/pull/135158.

```rust
#![feature(trivial_bounds)]

trait Project {
    type Assoc;
}

fn foo()
where
    u8: Project,
{
    [(); {
        let _: Option<<u8 as Project>::Assoc> = None; // ICEs currently, but will be an error
        0
    }];
}
```

However, if we hit the recursion limit when normalizing `<Type as Pointee>::Metadata` we don't want to report a layout error, because we already emitted the recursion error. So by normalizing to `ty::Error` here, we get a `LayoutError::ReferencesError` instead of a `LayoutError::Unknown` and don't report the layout error to the user.
2025-01-14 07:56:24 +01:00
Matthias Krüger
62f2c3c75c
Rollup merge of #135451 - mzacho:code-duplication, r=oli-obk
Remove code duplication when hashing query result and interning node

Refactored the duplicated code into a function.

`with_feed_task` currently passes the query key to `debug_assert!`. I believe that's a mistake, since `with_task` prints the `DepNode` which is more sensible, so this commit changes that, so it debug prints the `DepNode`.
2025-01-14 07:56:24 +01:00
Matthias Krüger
bf228a87ff
Rollup merge of #135381 - cod10129:vec-splice-doc, r=tgross35
Add an example for `Vec::splice` inserting elements without removing

This example clearly showcases how `splice` can be used to insert multiple elements efficiently at an index into a vector.

Fixes #135369.

The added example:

> Using `splice` to insert new items into a vector efficiently at a specific position indicated by an empty range:
> ```rust
> let mut v = vec![1, 5];
> let new = [2, 3, 4];
> v.splice(1..1, new);
> assert_eq!(v, [1, 2, 3, 4, 5]);
> ```

`@rustbot` label A-docs A-collections
2025-01-14 07:56:23 +01:00
Aditya Kumar
2c4aee92fa
Made Path::name only have item name rather than full name 2025-01-14 06:03:43 +00:00
bors
e491caec14 Auto merge of #135359 - RalfJung:lang-start-unwind, r=joboet
use a single large catch_unwind in lang_start

I originally planned to use `abort_unwind` but reading the comment in `thread_cleanup` it seems we are deliberately going for slightly nicer error messages here, so this preserves that. It still seems nice to not repeat `catch_unwind` so often.
2025-01-14 05:58:48 +00:00
bors
35c2908177 Auto merge of #135465 - jhpratt:rollup-7p93bct, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - #134498 (Fix cycle error only occurring with -Zdump-mir)
 - #134977 (Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion)
 - #135390 (Re-added regression test for #122638)
 - #135393 (uefi: helpers: Introduce OwnedDevicePath)
 - #135440 (rm unnecessary `OpaqueTypeDecl` wrapper)
 - #135441 (Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024)
 - #135444 (Update books)
 - #135450 (Fix emscripten-wasm-eh with unwind=abort)
 - #135452 (bootstrap: fix outdated feature name in comment)
 - #135454 (llvm: Allow sized-word rather than ymmword in tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-14 03:08:59 +00:00
Michael Goulet
377dbc96a6 Leak check in impossible_predicates to avoid monomorphizing impossible instances 2025-01-14 01:51:16 +00:00
Jacob Pratt
9fdebf65f0
Rollup merge of #135454 - maurer:sized-word-ymmword, r=jieyouxu
llvm: Allow sized-word rather than ymmword in tests

llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests.

`@rustbot` label: +llvm-main
2025-01-13 20:43:51 -05:00
Jacob Pratt
ab77d157e2
Rollup merge of #135452 - jieyouxu:fix-comment, r=compiler-errors
bootstrap: fix outdated feature name in comment

Follow-up to https://github.com/rust-lang/rust/pull/135391#discussion_r1912826594.

I guess I updated everything else **except** the comment right next to the actual dependencies 💀

r? bootstrap
2025-01-13 20:43:50 -05:00
Jacob Pratt
05ae6bfeb4
Rollup merge of #135450 - hoodmane:wasm-eh-abort-fix, r=workingjubilee
Fix emscripten-wasm-eh with unwind=abort

If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort`.

Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`.

Followup to #131830.

r? workingjubilee
2025-01-13 20:43:49 -05:00
Jacob Pratt
78aa0b917a
Rollup merge of #135444 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

10 commits in 04d06dfe541607e6419f3d028c3f9b245f3be4d9..5a65e2af063ff701ae858f1f7536ee347b3cfe63
2025-01-09 17:59:43 UTC to 2025-01-06 13:47:07 UTC

- Appendix E: Update for 2024 Edition (rust-lang/book#4196)
- Implement and integrate an mdBook plugin to strip markup from headings (rust-lang/book#4195)
- Update appendix-06-translation.md - new persian translation added (rust-lang/book#4192)
- Remove extraneous `use` statement (rust-lang/book#4193)
- Take measurement inaccuracy intervals into account (rust-lang/book#4078)
- Ch. 21.3: remove error ferris from working code (rust-lang/book#4183)
- infra: match mdbook version in CI to rust-lang/rust (rust-lang/book#4191)
- Ch. 17: Set correct heading level for the chapter (rust-lang/book#4190)
- Switch back from `eprintln!` to `println!` in listing 17-12 (rust-lang/book#4178)
- fix typo in Listing invocation for listing 20-14 (rust-lang/book#4184)

## rust-lang/nomicon

1 commits in 7ef05b9777c94836bc92f50f23e6e00981521a89..625b200e5b33a5af35589db0bc454203a3d46d20
2025-01-06 17:17:38 UTC to 2025-01-06 17:17:38 UTC

- Fix accidental inline HTML in Markdown (rust-lang/nomicon#474)

## rust-lang/reference

3 commits in acd6794e712d5e2ef6f5c84fb95688d32a69b816..293af991003772bdccf2d6b980182d84dd055942
2025-01-07 16:31:22 UTC to 2025-01-06 17:17:15 UTC

- Add spec identifiers to dynamically-sized-types.md (rust-lang/reference#1582)
- fix typo in a "rule" name in type-coercions.md (rust-lang/reference#1708)
- Fix unclosed `<sup>` elements (rust-lang/reference#1709)

## rust-lang/rust-by-example

2 commits in 093397535b48ae13ec76bc526b7e6eb8c096a85c..054259ed1bf01cdee4309ee764c7e103f6df3de5
2025-01-13 10:44:04 UTC to 2025-01-03 18:59:26 UTC

- Fix function name in new_types.md in Japanese (rust-lang/rust-by-example#1907)
- Fix typo in static_lifetime.md (rust-lang/rust-by-example#1905)
2025-01-13 20:43:48 -05:00
Jacob Pratt
77b7ee1960
Rollup merge of #135441 - compiler-errors:redundant-captures-lint, r=lqd
Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024

I never got sign-off on #127672 for this lint being warn by default in edition 2024, so let's turn downgrade this lint to allow for now.

Should be backported so it ships with the edition.

```@rustbot``` label: +beta-nominated
2025-01-13 20:43:48 -05:00
Jacob Pratt
9bdb601575
Rollup merge of #135440 - lcnr:yeeeeeeeeeeeeeeeeeeeeeeet, r=compiler-errors
rm unnecessary `OpaqueTypeDecl` wrapper
2025-01-13 20:43:47 -05:00
Jacob Pratt
954b06f257
Rollup merge of #135393 - Ayush1325:uefi-helper-path, r=thomcc
uefi: helpers: Introduce OwnedDevicePath

This PR is split off from #135368 to reduce noise.

No real functionality changes, just some quality of life improvements.

Also implement Debug for OwnedDevicePath for some quality of life
improvements.
2025-01-13 20:43:46 -05:00
Jacob Pratt
f10513f22d
Rollup merge of #135390 - ranger-ross:readd-test-122638, r=BoxyUwU
Re-added regression test for #122638

Re-adds the test for #122638 😄
fixes #122638

r? `@BoxyUwU`

(please let me know if this can be improved. I am still fairly new to using compiletest)
2025-01-13 20:43:46 -05:00
Jacob Pratt
54c324f47b
Rollup merge of #134977 - estebank:issue-112357, r=BoxyUwU
Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion

When a newcomer attempts to use an "out parameter" using borrows, they sometimes get confused and instead of mutating the borrow they try to mutate the function-local binding instead. This leads to either type errors (due to assigning an owned value to a mutable binding of reference type) or a multitude of lifetime errors and unused binding warnings.

This change adds a suggestion to the type error

```
error[E0308]: mismatched types
  --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:6:14
   |
LL | fn change_object(mut object: &Object) {
   |                              ------- expected due to this parameter type
LL |     let object2 = Object;
LL |     object = object2;
   |              ^^^^^^^ expected `&Object`, found `Object`
   |
help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding
   |
LL ~ fn change_object(object: &mut Object) {
LL |     let object2 = Object;
LL ~     *object = object2;
   |
```
and to the unused assignment lint
```
error: value assigned to `object` is never read
  --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:11:5
   |
LL |     object = &object2;
   |     ^^^^^^
   |
note: the lint level is defined here
  --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:1:9
   |
LL | #![deny(unused_assignments, unused_variables)]
   |         ^^^^^^^^^^^^^^^^^^
help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding
   |
LL ~ fn change_object2(object: &mut Object) {
LL |     let object2 = Object;
LL ~     *object = object2;
   |
```

Fix #112357.
2025-01-13 20:43:45 -05:00
Jacob Pratt
81f742954a
Rollup merge of #134498 - oli-obk:push-wmxynprsyxvr, r=compiler-errors
Fix cycle error only occurring with -Zdump-mir

fixes #134205

During mir dumping, we evaluate static items to render their allocations. If a static item refers to itself, its own MIR will have a reference to itself, so during mir dumping we end up evaluating the static again, causing us to try to build MIR again (mir dumping happens during MIR building).

Thus I disabled evaluation of statics during MIR dumps in case the MIR body isn't far enough along yet to be able to be guaranteed cycle free.
2025-01-13 20:43:44 -05:00
bors
1ab85fbd74 Auto merge of #135438 - matthiaskrgr:rollup-rt2zrbz, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #133752 (replace copypasted ModuleLlvm::parse)
 - #135245 (rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests)
 - #135405 (path: Move is_absolute check to sys::path)
 - #135426 (Assert that `Instance::try_resolve` is only used on body-like things)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: x86_64-mingw-1
2025-01-14 00:23:49 +00:00
Lukas Markeffsky
7a3c4f73ae fix ICE with references to infinite structs in consts 2025-01-14 01:22:04 +01:00
cod10129
b11f87a53c Add another Vec::splice example
Add an example for using splice to insert multiple elements efficiently into a vector.
2025-01-13 17:37:09 -06:00
Hood Chatham
4d0a838001 Fix emscripten-wasm-eh with unwind=abort
If we build the standard library with wasm-eh then we need to link
with `-fwasm-exceptions` even if we compile with `panic=abort`
Without this change, linking a `panic=abort` crate fails with:
`undefined symbol: __cpp_exception`.

Followup to #131830.
2025-01-13 23:34:06 +01:00
Matthew Maurer
aa14931503 llvm: Allow sized-word rather than ymmword in tests
llvm/llvm-project#122530 changes LLVM to use sized-word rather than
ymmword for scatter gather pointers. While this will not always be
qword, it is for these two tests.
2025-01-13 20:50:57 +00:00