Commit Graph

253706 Commits

Author SHA1 Message Date
Matthias Krüger
c32e2fe179 add test for https://github.com/rust-lang/rust/issues/109812 2024-04-28 10:23:10 +02:00
Matthias Krüger
c968b8b777 add test for ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path with staged_ap
Fixes https://github.com/rust-lang/rust/issues/108697
2024-04-28 10:23:10 +02:00
Gurinder Singh
4aafec1bc1 Rename inihibit_union_abi_opt() to inihibits_union_abi_opt()
The present tense makes it read more naturally at use site i.e.
"this repr _inhibits_ optimizations"
2024-04-28 13:09:36 +05:30
bors
cb49406457 Auto merge of #124210 - the8472:consign-ebadf-to-the-fire, r=Mark-Simulacrum
Abort a process when FD ownership is violated

When an owned FD has already been closed before it's dropped that means something else touched an FD in ways it is not allowed to. At that point things can already be arbitrarily bad, e.g. clobbered mmaps. Recovery is not possible.
All we can do is hasten the fire.

Unlike the previous attempt in #124130 this shouldn't suffer from the possibility that FUSE filesystems can return arbitrary errors.
2024-04-28 06:20:28 +00:00
bors
6c90ac8d8f Auto merge of #123546 - Rajveer100:branch-for-issue-122128, r=onur-ozkan
Bootstrap: Check validity of `--target` and `--host` triples before starting a build

Resolves #122128

As described in the issue, validating the `target` and `host` triples would save a lot of time before actually starting a build. This would also check for custom targets by looking for a valid JSON spec if the specified target does not exist in the [supported](42825768b1/compiler/rustc_target/src/spec/mod.rs (L1401-L1689)) list of targets.
2024-04-28 04:16:05 +00:00
yukang
6faedd381b Fix the assertion crash from rustdoc document indent widths 2024-04-28 11:17:09 +08:00
bors
2207179a59 Auto merge of #124454 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump version to 1.80

https://forge.rust-lang.org/release/process.html#bump-the-stable-version-number-t-6-days-friday-the-week-before

r? `@Mark-Simulacrum`
2024-04-28 02:12:04 +00:00
bors
0986358d2c Auto merge of #124456 - matthiaskrgr:rollup-8bm3m6v, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123248 (1.78 release notes)
 - #123942 (`x vendor`)
 - #124165 (add test for incremental ICE: slice-pattern-const.rs #83085)
 - #124242 (bootstrap: Describe build_steps modules)
 - #124406 (Remove unused `[patch]` for clippy_lints)
 - #124429 (bootstrap: Document `struct Builder` and its fields)
 - #124447 (Unconditionally call `really_init` on GNU/Linux)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-28 00:05:11 +00:00
The 8472
1ba00d9cb2 put FD validity behind late debug_asserts checking
uses the same machinery as assert_unsafe_precondition
2024-04-28 01:44:25 +02:00
Matthias Krüger
be8976022e
Rollup merge of #124447 - workingjubilee:set-argv-twice-on-gnu, r=ChrisDenton
Unconditionally call `really_init` on GNU/Linux

This makes miri not diverge in behavior, it fixes running Rust linux-gnu binaries on musl with gcompat, it fixes dlopen edge-cases that cranelift somehow hits, etc.

Fixes #124126

thou hast gazed into this abyss with me:
r? ``@ChrisDenton``
2024-04-28 01:25:02 +02:00
Matthias Krüger
088753cb9a
Rollup merge of #124429 - Enselic:document-builder, r=Mark-Simulacrum
bootstrap: Document `struct Builder` and its fields

I'm exploring the code of bootstrap and had a bit of a hard time understanding exactly what `Builder` is for at first. I decided to help document it and its field to help future explorers.
2024-04-28 01:25:01 +02:00
Matthias Krüger
62a88c375c
Rollup merge of #124406 - Alexendoo:cargo-patch-clippy, r=Mark-Simulacrum
Remove unused `[patch]` for clippy_lints

Looks like it was once used by RLS
2024-04-28 01:25:01 +02:00
Matthias Krüger
f17ce8bf7a
Rollup merge of #124242 - workingjubilee:describe-bootstrap-files-better, r=Mark-Simulacrum
bootstrap: Describe build_steps modules

One of my preferred ways to understand source code is to start with its API. This implies the code is documented reasonably accurately, even if it is a private API. The description of one of these modules had not been updated since 2015 and so was both terse and confusing, so I rewrote it. Then I noticed many others went unremarked, so I offered some remarks.
2024-04-28 01:25:00 +02:00
Matthias Krüger
289bf549ad
Rollup merge of #124165 - matthiaskrgr:slice-pattern-const-ice-incr, r=Mark-Simulacrum
add test for incremental ICE: slice-pattern-const.rs #83085

Fixes #83085
2024-04-28 01:25:00 +02:00
Matthias Krüger
8ef4a8df4b
Rollup merge of #123942 - onur-ozkan:x-vendor, r=Mark-Simulacrum
`x vendor`

This PR implements `x vendor` on bootstrap; enabling dependency vendoring without the need for developers to have `cargo` installed on their system (previously, we suggested running `cargo vendor ...` but now we can accomplish the same task with `x vendor`).

In addition, fixes #112391 problem.
2024-04-28 01:24:59 +02:00
Matthias Krüger
856dfdca8e
Rollup merge of #123248 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
1.78 release notes

cc `@rust-lang/release`

r? `@cuviper`
2024-04-28 01:24:59 +02:00
Mark Rousskov
a7696ed4ab Bump version to 1.80 2024-04-27 19:03:50 -04:00
Mark Rousskov
7a69a4a5cf 1.78 release notes 2024-04-27 19:00:19 -04:00
Michael Goulet
17728a9bb2 Record certainty of evaluate_added_goals_and_make_canonical_response call in candidate 2024-04-27 17:46:29 -04:00
bors
aed2187d53 Auto merge of #124448 - matthiaskrgr:rollup-iloy9vz, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #124370 (Fix substitution parts having a shifted underline in some cases)
 - #124394 (Fix ICE on invalid const param types)
 - #124425 (Do not ICE on invalid consts when walking mono-reachable blocks)
 - #124434 (Remove lazycell and once_cell from compiletest dependencies)
 - #124437 (doc: Make the `mod.rs` in the comment point to the correct location)
 - #124443 (Elaborate in comment about `statx` probe)
 - #124445 (bootstrap: Change `global(true)` to `global = true` for flags for consistency)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-27 20:49:06 +00:00
Matthias Krüger
6f8811d113
Rollup merge of #124445 - Enselic:global-true, r=onur-ozkan
bootstrap: Change `global(true)` to `global = true` for flags for consistency

All other arg properties use the `prop = value` style, which makes it slightly annoying to use the `prop(value)` only style for `global`. Change to `prop = value` also for `global` for consistency.
2024-04-27 20:46:10 +02:00
Matthias Krüger
45019310b8
Rollup merge of #124443 - tbu-:pr_statx_enosys_comment, r=workingjubilee
Elaborate in comment about `statx` probe

As requested by `@workingjubilee` in https://github.com/rust-lang/rust/pull/123928#discussion_r1564916743.
2024-04-27 20:46:09 +02:00
Matthias Krüger
9c634f95bf
Rollup merge of #124437 - linyihai:doc-link-typeck, r=compiler-errors
doc: Make the `mod.rs` in the comment point to the correct location

The origin `mod.rs` had moved to `rustc_hir_analysis::check`, but the annotation doesn't point to it.

See [the origin PR](https://github.com/rust-lang/rust/pull/61857/files#diff-b65997b61ccd8d8e08238c925d631207671aca506e93ce7c5cfa0bec134c0a8e).
2024-04-27 20:46:09 +02:00
Matthias Krüger
8f962a6256
Rollup merge of #124434 - GKFX:remove-lazy-dependencies, r=jieyouxu
Remove lazycell and once_cell from compiletest dependencies

Use the standard library `OnceLock` instead of third-party equivalents. A macro is used for the regexes to make their initialization less unwieldy.
2024-04-27 20:46:09 +02:00
Matthias Krüger
0430e743e4
Rollup merge of #124425 - saethlin:ceci-nest-pas-une-ice, r=compiler-errors
Do not ICE on invalid consts when walking mono-reachable blocks

The `bug!` here was written under the logic of "this condition is impossible, right?" except that of course, if the compiler is given code that results in an compile error, then the situation is possible.

So now we just direct errors into the already-existing path for when we can't do a mono-time optimization.
2024-04-27 20:46:08 +02:00
Matthias Krüger
aeb4c0413c
Rollup merge of #124394 - gurry:123863-ice-unexpected-region, r=lcnr
Fix ICE on invalid const param types

Fixes ICE #123863 which occurs because the const param has a type which is not a `bool`, `char` or an integral type.

The ICEing code path begins here in `typeck_with_fallback`: cb3752d20e/compiler/rustc_hir_typeck/src/lib.rs (L167)

The `fallback` invokes the `type_of` query and that eventually ends up calling `ct_infer` from the lowering code over here:
cb3752d20e/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs (L561) and `ct_infer` ICEs at this location: cb3752d20e/compiler/rustc_hir_analysis/src/collect.rs (L392)

To fix the ICE it I'm triggering a `span_delayed_bug` before we hit `ct_infer` if the type of the const param is not one of the supported types

### Edit
On `@lcnr's` suggestion I've changed the approach to not let `ReStatic` region hit the `bug!` in `ct_infer` instead of triggering a `span_delayed_bug`.
2024-04-27 20:46:08 +02:00
Matthias Krüger
52ce43e9ac
Rollup merge of #124370 - ShE3py:substitution-part-offset, r=fee1-dead
Fix substitution parts having a shifted underline in some cases

If two suggestions parts are side by side, the underline's offset:
(WIP PR as an example, not yet pushed)
```
error: expected a pattern, found an expression
 --> ./main.rs:4:9
  |
4 |         1 + 2 => 3
  |         ^^^^^ arbitrary expressions are not allowed in patterns
  |
help: check the value in an arm guard
  |
4 |         n if n == 1 + 2 => 3
  |         ~     +++++++++++++
```
The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.)

```
help: check the value in an arm guard
  |
4 |         n if n == 1 + 2 => 3
  |         ~ +++++++++++++
```

``@rustbot`` label +A-suggestion-diagnostics
2024-04-27 20:46:07 +02:00
bors
825e831dc3 Auto merge of #124405 - RalfJung:miri-core-alloc-tests, r=clubby789
miri core/alloc tests: do not test a 2nd target

check-aux seems to be one of the slowest runners since we started running standard library tests in Miri on it. So maybe it'd be better to reduce test coverage a bit by not doing cross-target testing of core and alloc? I don't recall finding target-specific issues in these libraries ever (and we still have the extra test coverage via our [out-of-tree nightly tests](https://github.com/rust-lang/miri-test-libstd)). This gives us more buffer to deal with the fact that the number of tests we run will only grow over time.

Cc `@rust-lang/miri` `@rust-lang/infra`
2024-04-27 18:45:51 +00:00
Jubilee Young
fa73ebb303 Unconditionally call really_init
This makes miri not diverge in behavior, it fixes running Rust linux-gnu
binaries on musl with gcompat, it fixes dlopen edge-cases that cranelift
somehow hits, etc.
2024-04-27 11:33:15 -07:00
Rajveer
09c076810c Bootstrap: Check validity of --target and --host triples before starting a build
Resolves #122128
2024-04-27 23:50:48 +05:30
Martin Nordholts
4c2a7d17cf bootstrap: Change global(true) to global = true for flags for consistency
All other arg properties use the `prop = value` style, which makes it
slightly annoying to use the `prop(value)` style for `global`. Change to
`prop = value` also for `global` for consistency.
2024-04-27 19:30:57 +02:00
Martin Nordholts
4e83776731 bootstrap: Document struct Builder and its fields 2024-04-27 19:27:59 +02:00
Tobias Bucher
adebad1dce Elaborate in comment about statx probe
As requested by @workingjubilee in
https://github.com/rust-lang/rust/pull/123928#discussion_r1564916743.
2024-04-27 18:36:29 +02:00
bors
61a1dbd751 Auto merge of #124432 - zetanumbers:non_copy_into_raw_with_alloc, r=Nilstrieb
Relax `A: Clone` bound for `rc::Weak::into_raw_and_alloc`

Makes this method to behave the same way as [`Box::into_raw_with_allocator`](https://doc.rust-lang.org/1.77.2/alloc/boxed/struct.Box.html#method.into_raw_with_allocator) and [`Vec::into_raw_parts_with_alloc`](https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html#method.into_raw_parts_with_alloc).

I have also noticed the inconsistent presence and naming, should probably be addressed in the future.
2024-04-27 13:41:45 +00:00
Lin Yihai
4faaa53392 doc: Replace mod.rs with the appropriate link 2024-04-27 21:22:04 +08:00
George Bateman
31af4f81ca
Remove lazycell and once_cell from compiletest dependencies 2024-04-27 12:38:51 +01:00
bors
261823eee7 Auto merge of #124430 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2024-04-27 09:32:46 +00:00
Daria Sukhonina
255a1e9554 Relax A: Clone bound for rc::Weak::into_raw_and_alloc 2024-04-27 12:21:23 +03:00
bors
35194e76b7 Auto merge of #124428 - matthiaskrgr:rollup-sk5z4z8, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124382 (ast: Generalize item kind visiting)
 - #124387 (thread_local: be excruciatingly explicit in dtor code)
 - #124427 (Add missing tests for an ICE)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-27 07:28:53 +00:00
Matthias Krüger
9a6bfc7bfc
Rollup merge of #124427 - gurry:122191-unhandled-type, r=matthiaskrgr
Add missing tests for an ICE

Fixes #122191
2024-04-27 07:55:38 +02:00
Matthias Krüger
7c5213cf0a
Rollup merge of #124387 - workingjubilee:use-raw-pointers-in-thread-locals, r=joboet
thread_local: be excruciatingly explicit in dtor code

Use raw pointers to accomplish internal mutability, and clearly split references where applicable. This reduces the likelihood that any of these parts are misunderstood, either by humans or the compiler's optimizations.

Fixes #124317

r? ``@joboet``
2024-04-27 07:55:38 +02:00
Matthias Krüger
cf07246ae9
Rollup merge of #124382 - petrochenkov:itemvisit, r=lcnr
ast: Generalize item kind visiting

And avoid duplicating logic for visiting `Item`s with different kinds (regular, associated, foreign).

The diff is better viewed with whitespace ignored.
2024-04-27 07:55:37 +02:00
Gurinder Singh
fc73b4c344 Add missing tests for an ICE 2024-04-27 11:02:15 +05:30
Gurinder Singh
c62bc31b16 Fix ICE on invalid const param types 2024-04-27 09:36:38 +05:30
Ben Kimock
82cc02a60b Do not ICE on invalid consts when walking mono-reachable blocks 2024-04-26 23:06:21 -04:00
bors
9ac33d9c33 Auto merge of #124416 - weihanglo:update-cargo, r=weihanglo
Update cargo

9 commits in c9392675917adc2edab269eea27c222b5359c637..b60a1555155111e962018007a6d0ef85207db463
2024-04-23 19:35:19 +0000 to 2024-04-26 16:37:29 +0000
- fix(toml): Remove underscore field support in 2024 (rust-lang/cargo#13804)
- fix: emit 1.77 syntax error only when msrv is incompatible (rust-lang/cargo#13808)
- docs(ref): Index differences between virtual / real manifests (rust-lang/cargo#13794)
- refactor(toml): extract dependency-to-source-id to function (rust-lang/cargo#13802)
- Add where lint was set (rust-lang/cargo#13801)
- fix(toml): Don't double-warn when underscore is used in workspace dep (rust-lang/cargo#13800)
- fix(toml): Be more forceful with underscore/dash redundancy (rust-lang/cargo#13798)
- Fix warning suppression for config.toml vs config compat symlinks (rust-lang/cargo#13793)
- Cleanup linting system (rust-lang/cargo#13797)

r? ghost
2024-04-27 02:30:40 +00:00
Jubilee
c63b0ceb94
thread_local: refine LazyKeyInner::take safety doc
Co-authored-by: joboet <jonasboettiger@icloud.com>
2024-04-26 18:28:46 -07:00
bors
80d1c8349a Auto merge of #124424 - jhpratt:rollup-o3ngkjy, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - #124341 (resolve: Remove two cases of misleading macro call visiting)
 - #124383 (Port run-make `--print=native-static-libs` to rmake.rs)
 - #124391 (`rustc_builtin_macros` cleanups)
 - #124408 (crashes: add more tests)
 - #124410 (PathBuf: replace transmuting by accessor functions)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-27 00:26:48 +00:00
Jacob Pratt
7cbba53396
Rollup merge of #124410 - RalfJung:path-buf-transmute, r=Nilstrieb
PathBuf: replace transmuting by accessor functions

The existing `repr(transparent)` was anyway insufficient as `OsString` was not `repr(transparent)`. And furthermore, on Windows it was blatantly wrong as `OsString` wraps `Wtf8Buf` which is a `repr(Rust)` type with 2 fields:

51a7396ad3/library/std/src/sys_common/wtf8.rs (L131-L146)

So let's just be honest about what happens and add accessor methods that make this abstraction-breaking act of PathBuf visible on the APIs that it pierces through.

Fixes https://github.com/rust-lang/rust/issues/124409
2024-04-26 19:25:57 -04:00
Jacob Pratt
7cb7337c1b
Rollup merge of #124408 - matthiaskrgr:loltest, r=jieyouxu
crashes: add more tests
2024-04-26 19:25:56 -04:00