256833 Commits

Author SHA1 Message Date
Michael Goulet
00583a64ee Properly gate safe keyword in pre-expansion
(cherry picked from commit 108b3f214a7e160ecb7ac2ec05bbb41aedd05a95)
2024-07-05 09:34:45 -07:00
bors
64a1fe6711 Auto merge of #126772 - cuviper:beta-next, r=cuviper
[beta] backports

- Only compute `specializes` query if (min)specialization is enabled in the crate of the specializing impl #126139
- Add pub struct with allow(dead_code) into worklist #126315
- ci: Update centos:7 to use vault repos #126352

r? cuviper
2024-06-21 21:31:13 +00:00
Josh Stone
c67b09538d ci: Update centos:7 to use vault repos
CentOS 7 is going EOL on June 30, after which its package repos will no
longer exist on the regular mirrors. We'll still be able to access
packages from the vault server though, and can start doing so now. This
affects `dist-i686-linux` and `dist-x86_64-linux`.

I also removed `epel-release` because we were only using that for its
`cmake3`, but we've been building our own version for a while.

(cherry picked from commit 6d2493bf5d6c97bc52aa109944a7f27ee456192e)
2024-06-21 09:51:26 -07:00
r0cky
303ab0fac4 Add pub struct with allow(dead_code) into worklist
(cherry picked from commit 64450732be8c3111360589e9f8c44eab83f449e0)
2024-06-20 17:51:31 -07:00
Michael Goulet
24c34cb315 Only compute specializes query if specialization is enabled in the crate of the specialized impl
(cherry picked from commit 4b188d9d667dfcc7ba4caf95e56cbb3a6697f292)
2024-06-20 17:44:53 -07:00
Michael Goulet
319b8c1481 Failing test
(cherry picked from commit 1653a2d34a7f841f15b0704c7ce07c74dee2bada)
2024-06-20 17:44:53 -07:00
bors
105fc5ccc9 Auto merge of #126453 - cuviper:beta-next, r=cuviper
[beta] backports and stage0 bump

- Bump stage0 to 1.79.0
- Do not define opaque types when selecting impls #126258
- Remove failing GUI test to stop blocking CI until it is fixed #126445

r? cuviper
2024-06-14 20:17:23 +00:00
Guillaume Gomez
b78497cf7a Remove failing GUI test to stop blocking CI until it is fixed
(cherry picked from commit 9e466d33613105b678fcb461df01b6dbc7cb179e)
2024-06-14 09:22:07 -07:00
Oli Scherer
f1dd0974dc Also test under next solver
(cherry picked from commit 03fa9b807379dbce92b346b489acecff6082e283)
2024-06-13 18:14:12 -07:00
Oli Scherer
85ca09b7c2 Revert "When checking whether an impl applies, constrain hidden types of opaque types."
This reverts commit 29a630eb72ffb94c3708947afae1e948ad3cb189.

(cherry picked from commit 6cca6da1265b9bede368f34da6be42057adc9834)
2024-06-13 18:14:12 -07:00
Oli Scherer
11495decd5 Add regression test
(cherry picked from commit fe55c0091db4654ad0185831aa3dd110e5e6cd73)
2024-06-13 18:14:12 -07:00
Josh Stone
f0a3643af1 Bump stage0 to 1.79.0 2024-06-13 18:13:44 -07:00
bors
544e5fb73e Auto merge of #126278 - lqd:beta, r=Mark-Simulacrum
[beta] Ensure self-contained linker is only enabled on dev/nightly

It seems the self-contained linker is enabled on beta. Let's fix that.

```console
$ cargo clean && cargo +beta build && readelf -p .comment target/debug/helloworld
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s

String dump of section '.comment':
  [     0]  Linker: LLD 18.1.7
  [    14]  GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  [    3f]  rustc version 1.80.0-beta.1 (75ac3b633 2024-06-10)
```

I will open a PR to fix it on master as well, right after I test CI's behavior on beta.
2024-06-13 09:47:29 +00:00
Rémy Rakic
50cb2efdc5 ensure the self-contained linker is only enabled on nightly/dev 2024-06-11 17:08:12 +00:00
Rémy Rakic
ba643c50b3 fix rustfmt issue in libstd 2024-06-11 17:07:45 +00:00
bors
75ac3b6331 Auto merge of #126220 - ferrocene:pa-beta-1.80.0, r=pietroalbini
[beta] Prepare Rust 1.80.0

r? `@ghost`
2024-06-10 13:16:23 +00:00
Pietro Albini
2ccb6e4a56
replace version placeholder 2024-06-10 14:50:54 +02:00
Pietro Albini
ef609b0618
bump channel to beta 2024-06-10 14:50:10 +02:00
Pietro Albini
4ee097f71e
squash release notes from master 2024-06-10 14:49:53 +02:00
bors
804421dff5 Auto merge of #126134 - matthiaskrgr:rollup-vzlegsc, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #124012 (Stabilize `binary_heap_as_slice`)
 - #124214 (Parse unsafe attributes)
 - #125572 (Detect pub structs never constructed and unused associated constants)
 - #125781 (prefer `compile::stream_cargo` for building tools)
 - #126030 (Update `./x fmt` command in library/std/src/sys/pal/windows/c/README.md)
 - #126047 (Simplify the rayon calls in the installer)
 - #126052 (More `rustc_parse` cleanups)
 - #126077 (Revert "Use the HIR instead of mir_keys for determining whether something will have a MIR body.")
 - #126089 (Stabilize Option::take_if)
 - #126112 (Clean up source root in run-make tests)
 - #126119 (Improve docs for using custom paths with `--emit`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-07 20:12:49 +00:00
Matthias Krüger
df35d7a117
Rollup merge of #126119 - Zalathar:emit-filename, r=ehuss
Improve docs for using custom paths with `--emit`

Recently I found myself concluding that this feature didn't exist (https://github.com/rust-lang/rust/pull/126111#discussion_r1630707215), despite having read the documentation, because it was hidden away in the middle of a paragraph full of other information.

Giving this documentation more space of its own should make it easier to find.
2024-06-07 20:14:32 +02:00
Matthias Krüger
b8e28d1426
Rollup merge of #126112 - Kobzol:runmake-source-root, r=jieyouxu
Clean up source root in run-make tests

The name `S` isn't exactly the most descriptive, and we also shouldn't need to pass it when building (actually I think that most of the env. vars that we pass to `cargo` here are probably not really needed).

Related issue: https://github.com/rust-lang/rust/issues/126071

r? ```@jieyouxu```
2024-06-07 20:14:32 +02:00
Matthias Krüger
ccbd6c29b4
Rollup merge of #126089 - wutchzone:option_take_if, r=scottmcm
Stabilize Option::take_if

Closes #98934

ed: FCP complete in https://github.com/rust-lang/rust/issues/98934#issuecomment-2104627082
2024-06-07 20:14:31 +02:00
Matthias Krüger
2e82d7f569
Rollup merge of #126077 - oli-obk:revert_is_mir_available, r=BoxyUwU
Revert "Use the HIR instead of mir_keys for determining whether something will have a MIR body."

This reverts commit e5cba17b84bf7bf755686e8bb36aa3775ef53f77.

turns out SMIR still needs it (https://github.com/model-checking/kani/issues/3218). I'll create a full plan and MCP for what I intended this to be a part of. Maybe my plan is nonsense anyway.
2024-06-07 20:14:31 +02:00
Matthias Krüger
4aceaaa7f3
Rollup merge of #126052 - nnethercote:rustc_parse-more-cleanups, r=spastorino
More `rustc_parse` cleanups

Following on from #125815.

r? `@spastorino`
2024-06-07 20:14:30 +02:00
Matthias Krüger
bc793291b5
Rollup merge of #126047 - cuviper:installer-try_for_each, r=albertlarsan68
Simplify the rayon calls in the installer

Rayon's `try_for_each` makes the `CombinedEncoder` a lot simpler.
2024-06-07 20:14:30 +02:00
Matthias Krüger
3689adf5a4
Rollup merge of #126030 - ChrisDenton:update-wingen-readme, r=Mark-Simulacrum
Update `./x fmt` command in library/std/src/sys/pal/windows/c/README.md

`./x fmt` no longer accepts paths so the command in the readme won't work.
2024-06-07 20:14:29 +02:00
Matthias Krüger
65fcba61e4
Rollup merge of #125781 - onur-ozkan:improve-tool-builder, r=albertlarsan68
prefer `compile::stream_cargo` for building tools

Previously, we were running bare commands for `ToolBuild` step and were unable to utilize some of the flags which  are already handled by `compile::stream_cargo`.

This change makes `ToolBuild` to use `compile::stream_cargo`, allowing us to benefit from the flags supported by the bootstrap cargo.

Resolves #125666
2024-06-07 20:14:29 +02:00
Matthias Krüger
13314df21b
Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix
Detect pub structs never constructed and unused associated constants

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->

Lints never constructed public structs.

If we don't provide public methods to construct public structs with private fields, and don't construct them in the local crate. They would be never constructed. So that we can detect such public structs.

---
Update:

Also lints unused associated constants in traits.
2024-06-07 20:14:28 +02:00
Matthias Krüger
6e534c73c3
Rollup merge of #124214 - carbotaniuman:parse_unsafe_attrs, r=michaelwoerister
Parse unsafe attributes

Initial parse implementation for #123757

This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
2024-06-07 20:14:28 +02:00
Matthias Krüger
0acb5b8513
Rollup merge of #124012 - slanterns:as_slice_stabilize, r=BurntSushi
Stabilize `binary_heap_as_slice`

This PR stabilizes `binary_heap_as_slice`:

```rust
// std::collections::BinaryHeap

impl BinaryHeap<T> {
    pub fn as_slice(&self) -> &[T]
}
```

<br>

Tracking issue: https://github.com/rust-lang/rust/issues/83659.
Implementation PR: https://github.com/rust-lang/rust/pull/82331.

FCPs already completed in the tracking issue.

Closes https://github.com/rust-lang/rust/issues/83659.

r? libs-api
2024-06-07 20:14:27 +02:00
bors
4dc24ae394 Auto merge of #125798 - camelid:refactor-doctest, r=GuillaumeGomez
rustdoc: Refactor doctest collection and running code

This code previously had a quite confusing structure, mixing the collection,
processing, and running of doctests with multiple layers of indirection. There
are also many cases where tons of parameters are passed to functions with little
typing information (e.g., booleans or strings are often used).

As a result, the source of bugs is obfuscated (e.g. #81070) and large changes
(e.g.  #123974) become unnecessarily complicated. This PR is a first step to try
to simplify the code and make it easier to follow and less bug-prone.

r? `@GuillaumeGomez`
2024-06-07 18:02:40 +00:00
Guillaume Gomez
6aab04e9b7 run fmt 2024-06-07 18:10:31 +02:00
Noah Lev
3670ad59ad Fix broken rustdoc unit tests 2024-06-07 17:53:45 +02:00
Noah Lev
815c447680 Parse full doctest source; extract helper for parsing code
It doesn't really make sense to skip part of the source when we're
parsing it, so parse the whole doctest. This simplifies things too.
2024-06-07 17:53:44 +02:00
Noah Lev
d06a05e262 Move logic for "making" doctests to submodule
This code turns the raw code given by the user into something actually
runnable, e.g. by adding a `main` function if it doesn't already exist.

I also made a couple other items private that didn't need to be
crate-public.
2024-06-07 17:51:48 +02:00
Noah Lev
0dc72d9551 Make doctests before running them; reintroduce RunnableDoctest 2024-06-07 17:48:48 +02:00
Noah Lev
366000dc07 Move some arguments to fields and reorganize fields
I moved some local arguments and options to either the local options
struct or, if it made sense, the global options struct.
2024-06-07 17:48:48 +02:00
Noah Lev
a429afacbc Remove RunnableDoctest
It should instead be the actual input to the running logic. Currently
it's not actually quite runnable since it's still missing some
information.
2024-06-07 17:48:48 +02:00
Noah Lev
e9e2634547 Make two fields computed on-demand 2024-06-07 17:48:48 +02:00
Noah Lev
790b7e9cbf rustdoc: Remove DoctestVisitor::get_line
This was used to get the line number of the first line from the current
docstring, which was then used together with an offset within the
docstring. It's simpler to just pass the offset to the visitor and have
it do the math because it's clearer and this calculation only needs to
be done in one place (the Rust doctest visitor).
2024-06-07 17:48:47 +02:00
Noah Lev
46d2aa5a8f Remove global options from IndividualTestOptions 2024-06-07 17:48:47 +02:00
Noah Lev
279b4d22f7 Merge RustDoctest and MdDoctest into one type 2024-06-07 17:48:47 +02:00
Noah Lev
b7dd401a78 rustdoc: Extract actual doctest running logic into function 2024-06-07 17:48:47 +02:00
Noah Lev
85499ebf13 Separate doctest collection from running 2024-06-07 17:48:47 +02:00
Noah Lev
16db1a1bd0 Move Markdown-specific doctest code into submodule 2024-06-07 17:48:47 +02:00
Noah Lev
516010bd0f Start moving format-specific code into doctest submodule 2024-06-07 17:48:45 +02:00
Noah Lev
f9e12ef946 rustdoc: Use write_all to ensure all content is written 2024-06-07 17:41:04 +02:00
Noah Lev
3ee4629446 rustdoc: Rename Tester to DoctestVisitor
The new name more accurately captures what it is.
2024-06-07 17:41:03 +02:00
bors
e3c3ce62d7 Auto merge of #126110 - workingjubilee:backtrace-0.3.73, r=workingjubilee
Update backtrace to 0.3.73

Fixes #126109

r? `@ghost`
2024-06-07 14:44:46 +00:00