Skip to content

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

samestep and others added 13 commits November 15, 2024 12:46
Co-authored-by: Boxy UwU <rust@boxyuwu.dev>
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
Use `ConstArgKind::Path` for all single-segment paths, not just params under `min_generic_const_args`

r? `@BoxyUwU`

edit by `@BoxyUwU:`

This PR introduces a `min_generic_const_args` feature gate and implements some preliminary work for it, representing all const arguments that are single segment paths as `ConstArg::Path` instead of only those that resolve to a const generic parameter. There are a few bits of follow up work after this lands:
- Figure out how to represent `Foo<{ STATIC }>`
- Figure out how to evaluate `Foo<{ EnumVariantConstructor }>`
- Make param env normalization handle non-anon-consts
- Move `try_from_lit` and `from_anon_const` to hir ty lowering too
…o, r=petrochenkov

Report the `unexpected_cfgs` lint in external macros

This PR marks the `unexpected_cfgs` lint as being reportable in external macros, as it's probably not the intention of the macro author to leave ineffective cfgs in the users code.

Fixes rust-lang#132572

try-job: aarch64-gnu-debug
…nnethercote

Merge `-Zhir-stats` into `-Zinput-stats`

Currently `-Z hir-stats` prints the size and count of various kinds of nodes, and the total size of all the nodes it counted, but not the total count of nodes. So, before this PR:

```
$ git clone https://github.com/BurntSushi/ripgrep
$ cd ripgrep
$ cargo +nightly rustc -- -Z hir-stats
ast-stats-1 PRE EXPANSION AST STATS
ast-stats-1 Name                Accumulated Size         Count     Item Size
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 ...
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 Total                 93_576
ast-stats-1
ast-stats-2 POST EXPANSION AST STATS
ast-stats-2 Name                Accumulated Size         Count     Item Size
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 ...
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 Total              2_430_648
ast-stats-2
hir-stats HIR STATS
hir-stats Name                Accumulated Size         Count     Item Size
hir-stats ----------------------------------------------------------------
hir-stats ...
hir-stats ----------------------------------------------------------------
hir-stats Total              3_678_512
hir-stats
```

For consistency, this PR adds a total for the count as well:

```
$ cargo +stage1 rustc -- -Z hir-stats
ast-stats-1 PRE EXPANSION AST STATS
ast-stats-1 Name                Accumulated Size         Count     Item Size
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 ...
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 Total                 93_576                 1_877
ast-stats-1
ast-stats-2 POST EXPANSION AST STATS
ast-stats-2 Name                Accumulated Size         Count     Item Size
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 ...
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 Total              2_430_648                48_625
ast-stats-2
hir-stats HIR STATS
hir-stats Name                Accumulated Size         Count     Item Size
hir-stats ----------------------------------------------------------------
hir-stats ...
hir-stats ----------------------------------------------------------------
hir-stats Total              3_678_512                73_418
hir-stats
```

I wasn't sure if I was supposed to update `tests/ui/stats/hir-stats.stderr` to reflect this. I ran it locally, thinking it would fail, but it didn't:

```
$ ./x test tests/ui/stats
...

running 2 tests
i.

test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 17949 filtered out
```

Also: is there a reason `-Z hir-stats` and `-Z input-stats` both exist? The former seems like it should completely supercede the latter. But strangely, the two give very different numbers for node counts:

```
$ cargo +nightly rustc -- -Z input-stats
...
Lines of code:             483
Pre-expansion node count:  2386
Post-expansion node count: 63844
```

That's a 30% difference in this case. Is it intentional that these numbers are so different? I see comments for both saying that they are merely approximations and should not be expected to be correct:

https://github.com/rust-lang/rust/blob/bd0826a4521a845f36cce1b00e1dd2918ba09e90/compiler/rustc_ast_passes/src/node_count.rs#L1

https://github.com/rust-lang/rust/blob/bd0826a4521a845f36cce1b00e1dd2918ba09e90/compiler/rustc_passes/src/hir_stats.rs#L1-L3
ignore an occasionally-failing test in Miri

This is like rust-lang#128640, the test [sometimes](rust-lang#133189) fails due to rust-lang#121950.
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 19, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=4

@bors
Copy link
Collaborator

bors commented Nov 19, 2024

📌 Commit 9aac15d has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2024
@bors
Copy link
Collaborator

bors commented Nov 19, 2024

⌛ Testing commit 9aac15d with merge be7ec27...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-ext failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   |
18 | #[derive(Debug, Default, Deserialize)]
   |                          ^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default
   = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)


warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning] --> C:\a\rust\rust\build\ct\tokei\target\debug\build\tokei-93faf8bcc0fffe96\out/language_type.rs:5:10
  |
5 | #[derive(Deserialize, Serialize)]
  |          ^^^^^^^^^^^
  |
  = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unexpected `cfg` condition value: `cargo-clippy`
warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning] --> C:\a\rust\rust\build\ct\tokei\target\debug\build\tokei-93faf8bcc0fffe96\out/language_type.rs:5:23
  |
5 | #[derive(Deserialize, Serialize)]
  |                       ^^^^^^^^^
  |
  = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unexpected `cfg` condition value: `cargo-clippy`
warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning]  --> src\language\languages.rs:20:26
   |
20 | #[derive(Debug, Default, Serialize)]
   |                          ^^^^^^^^^
   |
   = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unexpected `cfg` condition value: `cargo-clippy`
warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning]  --> src\language\mod.rs:15:24
   |
15 | #[derive(Clone, Debug, Deserialize, Default, PartialEq, Serialize)]
   |                        ^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unexpected `cfg` condition value: `cargo-clippy`
warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning]  --> src\language\mod.rs:15:57
   |
15 | #[derive(Clone, Debug, Deserialize, Default, PartialEq, Serialize)]
   |                                                         ^^^^^^^^^
   |
   = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unexpected `cfg` condition value: `cargo-clippy`
warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning] --> src\stats.rs:4:10
  |
4 | #[derive(Deserialize, Serialize, Clone, Debug, PartialEq)]
  |          ^^^^^^^^^^^
  |
  = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unexpected `cfg` condition value: `cargo-clippy`
warning: unexpected `cfg` condition value: `cargo-clippy`
##[warning] --> src\stats.rs:4:23
  |
4 | #[derive(Deserialize, Serialize, Clone, Debug, PartialEq)]
  |                       ^^^^^^^^^
  |
  = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `json`, `serde_cbor`, `serde_json`, `serde_yaml`, and `yaml`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
---
[RUSTC-TIMING] miri test:false 5.819
error: failed to remove file `C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools\x86_64-pc-windows-msvc\release\miri.exe`

Caused by:
  Access is denied. (os error 5)
Command has failed. Rerun with -v to see more details.
  local time: Tue, Nov 19, 2024  1:21:07 PM
  network time: Tue, 19 Nov 2024 13:21:07 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Collaborator

bors commented Nov 19, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2024
@jieyouxu jieyouxu added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Nov 19, 2024
@jieyouxu
Copy link
Member

@bors retry (msvc)

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2024
@bors
Copy link
Collaborator

bors commented Nov 19, 2024

⌛ Testing commit 9aac15d with merge 7899368...

@bors
Copy link
Collaborator

bors commented Nov 19, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 7899368 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 19, 2024
@bors bors merged commit 7899368 into rust-lang:master Nov 19, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 19, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#131081 Use ConstArgKind::Path for all single-segment paths, not … 7e80d78fcbad032367d0a1eb8f14fbdac3be41eb (link)
#132577 Report the unexpected_cfgs lint in external macros ff274eae159f2f2edcb9e47eedecc5421c61bdc8 (link)
#133023 Merge -Zhir-stats into -Zinput-stats dc7379128b4912a19290320e700a92b484bfe82b (link)
#133200 ignore an occasionally-failing test in Miri b3db772e62b807272cd52e540a2c6689dd407b33 (link)

previous master: 89b6885529

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7899368): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -0.8%, secondary -3.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-3.4% [-4.9%, -2.1%] 3
All ❌✅ (primary) -0.8% [-0.8%, -0.8%] 1

Cycles

Results (secondary -2.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 794.555s -> 793.886s (-0.08%)
Artifact size: 335.29 MiB -> 335.28 MiB (-0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-xhhhp5u branch January 25, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-meta Area: Issues & PRs about the rust-lang/rust repository itself CI-spurious-fail-msvc CI spurious failure: target env msvc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.