Skip to content

Conversation

Noratrieb
Copy link
Member

A hopefully correct port of carbon-language/carbon-lang#3327

Carbon's hashing doesn't seem to use the "hash each compoment of the struct" strategy the way Rust does, but we may still benefit from it.

the compiler bootstraps locally and doesn't take too much time, so it must be good! it even passes UI tests, except the ones that seem to iterate over hashmaps >.<

r? @ghost

@rustbot rustbot added 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. labels Oct 23, 2023
@Noratrieb
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 23, 2023
@bors
Copy link
Collaborator

bors commented Oct 23, 2023

⌛ Trying commit 023d1b3 with merge f06e258...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 23, 2023
Try Carbon's new hashing strategy in the compiler

A hopefully correct port of carbon-language/carbon-lang#3327

Carbon's hashing doesn't seem to use the "hash each compoment of the struct" strategy the way Rust does, but we may still benefit from it.

the compiler bootstraps locally and doesn't take too much time, so it must be good! it even passes UI tests, except the ones that seem to iterate over hashmaps >.<

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Oct 23, 2023

☀️ Try build successful - checks-actions
Build commit: f06e258 (f06e2588ccd72e05fc8a5b13d79001f4087b525b)

@Mark-Simulacrum
Copy link
Member

@rust-timer build f06e258

@Urgau
Copy link
Member

Urgau commented Oct 23, 2023

Shouldn't all of those functions have a #[inline] attributes ?

@Noratrieb
Copy link
Member Author

Shouldn't all of those functions have a #[inline] attributes ?

yes, they should, i forgot about that. that said, PGO+ThinLTO should hopefully inline them anyways. but since perf is stuck, i'm just gonna add them now to be sure

It's not needed everywhere, but just to be sure that I didn't forget
anything.
@Noratrieb
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Oct 23, 2023

⌛ Trying commit f296f32 with merge 53d3149...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 23, 2023
Try Carbon's new hashing strategy in the compiler

A hopefully correct port of carbon-language/carbon-lang#3327

Carbon's hashing doesn't seem to use the "hash each compoment of the struct" strategy the way Rust does, but we may still benefit from it.

the compiler bootstraps locally and doesn't take too much time, so it must be good! it even passes UI tests, except the ones that seem to iterate over hashmaps >.<

r? `@ghost`
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-15 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_abd82be7-9709-4e5d-848e-b33bdec9d6d2
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=carbon-hash
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_abd82be7-9709-4e5d-848e-b33bdec9d6d2
GITHUB_REF=refs/pull/117079/merge
GITHUB_REF_NAME=117079/merge
GITHUB_REF_PROTECTED=false
---
........................................................................................  1496/15656
.........................................................................i..............  1584/15656
........................................................................................  1672/15656
........................................................................................  1760/15656
...................i............................................................F..F....  1848/15656
........................................................................................  2024/15656
........................................................................................  2112/15656
........................i............i...........ii.....................................  2200/15656
........................................................................................  2288/15656
---
---- [ui] tests/ui/check-cfg/mix.rs#cfg stdout ----
diff of stderr:

38    |
39    = help: expected names are: `cfg`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `names_values`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
40 
- warning: unexpected condition value `bar` for condition name `feature`
-    |
-    = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
45 warning: unexpected `unknown_name` as condition name
46    |
46    |
47    = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
+ 
+ 
+ warning: unexpected condition value `bar` for condition name `feature`
+    |
+    = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
49 warning: unexpected `cfg` condition name: `widnows`
50   --> $DIR/mix.rs:43:10



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix.cfg/mix.cfg.stderr
To only update this specific test, also pass `--test-args check-cfg/mix.rs`


error in revision `cfg`: 1 errors occurred comparing output.
status: exit status: 0
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/check-cfg/mix.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "cfg" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix.cfg" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix.cfg/auxiliary" "--cfg" "feature=\"bar\"" "--cfg" "unknown_name" "-Z" "unstable-options" "--check-cfg=cfg(names_values,cfg)" "--check-cfg=cfg(feature,values(\"foo\"))"
--- stderr -------------------------------
warning: unexpected `cfg` condition name: `widnows`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:15:7
   |
   |
LL | #[cfg(widnows)]
   |       ^^^^^^^ help: there is a config with a similar name: `windows`
Build completed unsuccessfully in 0:12:36
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition value: (none)
warning: unexpected `cfg` condition value: (none)
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:19:7
   |
LL | #[cfg(feature)]
   |       ^^^^^^^- help: specify a config value: `= "foo"`
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition value: `bar`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:26:7
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:26:7
   |
LL | #[cfg(feature = "bar")]
   |       ^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL | #[cfg(feature = "zebra")]
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `uu`
warning: unexpected `cfg` condition name: `uu`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:34:12
   |
LL | #[cfg_attr(uu, test)]
   |
   |
   = help: expected names are: `cfg`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `names_values`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
warning: unexpected `unknown_name` as condition name
   |
   |
   = help: was set with `--cfg` but isn't in the `--check-cfg` expected names

warning: unexpected condition value `bar` for condition name `feature`
   |
   = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
warning: unexpected `cfg` condition name: `widnows`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:43:10
   |
   |
LL |     cfg!(widnows);
   |          ^^^^^^^ help: there is a config with a similar name: `windows`
warning: unexpected `cfg` condition value: `bar`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:46:10
   |
   |
LL |     cfg!(feature = "bar");
   |
   = note: expected values for `feature` are: `foo`


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(feature = "zebra");
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:50:10
   |
LL |     cfg!(xxx = "foo");

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:52:10
   |
   |
LL |     cfg!(xxx);

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:54:14
   |
   |
LL |     cfg!(any(xxx, windows));

warning: unexpected `cfg` condition value: `bad`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:56:14
   |
   |
LL |     cfg!(any(feature = "bad", windows));
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:58:23
   |
LL |     cfg!(any(windows, xxx));

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:60:20
   |
   |
LL |     cfg!(all(unix, xxx));

warning: unexpected `cfg` condition name: `aa`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:62:14
   |
   |
LL |     cfg!(all(aa, bb));

warning: unexpected `cfg` condition name: `bb`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:62:18
   |
   |
LL |     cfg!(all(aa, bb));

warning: unexpected `cfg` condition name: `aa`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:65:14
   |
   |
LL |     cfg!(any(aa, bb));

warning: unexpected `cfg` condition name: `bb`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:65:18
   |
   |
LL |     cfg!(any(aa, bb));


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(any(unix, feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:70:14
   |
LL |     cfg!(any(xxx, feature = "zebra"));


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(any(xxx, feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:73:14
   |
LL |     cfg!(any(xxx, unix, xxx));

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:73:25
   |
   |
LL |     cfg!(any(xxx, unix, xxx));


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`

warning: 28 warnings emitted
warning: 28 warnings emitted
------------------------------------------


---- [ui] tests/ui/check-cfg/mix.rs#names_values stdout ----
diff of stderr:

38    |
39    = help: expected names are: `cfg`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `names_values`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
40 
- warning: unexpected condition value `bar` for condition name `feature`
-    |
-    = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
45 warning: unexpected `unknown_name` as condition name
46    |
46    |
47    = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
+ 
+ 
+ warning: unexpected condition value `bar` for condition name `feature`
+    |
+    = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
49 warning: unexpected `cfg` condition name: `widnows`
50   --> $DIR/mix.rs:43:10



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix.names_values/mix.names_values.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args check-cfg/mix.rs`

error in revision `names_values`: 1 errors occurred comparing output.
status: exit status: 0
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/check-cfg/mix.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "names_values" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix.names_values" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix.names_values/auxiliary" "--cfg" "feature=\"bar\"" "--cfg" "unknown_name" "-Z" "unstable-options" "--check-cfg=cfg(names_values,cfg)" "--check-cfg=names()" "--check-cfg=values(feature,\"foo\")"
--- stderr -------------------------------
warning: unexpected `cfg` condition name: `widnows`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:15:7
   |
   |
LL | #[cfg(widnows)]
   |       ^^^^^^^ help: there is a config with a similar name: `windows`
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition value: (none)
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:19:7
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:19:7
   |
LL | #[cfg(feature)]
   |       ^^^^^^^- help: specify a config value: `= "foo"`
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition value: `bar`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:26:7
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:26:7
   |
LL | #[cfg(feature = "bar")]
   |       ^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL | #[cfg(feature = "zebra")]
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `uu`
warning: unexpected `cfg` condition name: `uu`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:34:12
   |
LL | #[cfg_attr(uu, test)]
   |
   |
   = help: expected names are: `cfg`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `names_values`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
warning: unexpected `unknown_name` as condition name
   |
   |
   = help: was set with `--cfg` but isn't in the `--check-cfg` expected names

warning: unexpected condition value `bar` for condition name `feature`
   |
   = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
warning: unexpected `cfg` condition name: `widnows`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:43:10
   |
   |
LL |     cfg!(widnows);
   |          ^^^^^^^ help: there is a config with a similar name: `windows`
warning: unexpected `cfg` condition value: `bar`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:46:10
   |
   |
LL |     cfg!(feature = "bar");
   |
   = note: expected values for `feature` are: `foo`


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(feature = "zebra");
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:50:10
   |
LL |     cfg!(xxx = "foo");

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:52:10
   |
   |
LL |     cfg!(xxx);

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:54:14
   |
   |
LL |     cfg!(any(xxx, windows));

warning: unexpected `cfg` condition value: `bad`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:56:14
   |
   |
LL |     cfg!(any(feature = "bad", windows));
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:58:23
   |
LL |     cfg!(any(windows, xxx));

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:60:20
   |
   |
LL |     cfg!(all(unix, xxx));

warning: unexpected `cfg` condition name: `aa`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:62:14
   |
   |
LL |     cfg!(all(aa, bb));

warning: unexpected `cfg` condition name: `bb`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:62:18
   |
   |
LL |     cfg!(all(aa, bb));

warning: unexpected `cfg` condition name: `aa`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:65:14
   |
   |
LL |     cfg!(any(aa, bb));

warning: unexpected `cfg` condition name: `bb`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:65:18
   |
   |
LL |     cfg!(any(aa, bb));


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(any(unix, feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:70:14
   |
LL |     cfg!(any(xxx, feature = "zebra"));


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(any(xxx, feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:73:14
   |
LL |     cfg!(any(xxx, unix, xxx));

warning: unexpected `cfg` condition name: `xxx`
##[warning]  --> /checkout/tests/ui/check-cfg/mix.rs:73:25
   |
   |
LL |     cfg!(any(xxx, unix, xxx));


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`


warning: unexpected `cfg` condition value: `zebra`
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: `foo`

warning: 28 warnings emitted
warning: 28 warnings emitted
------------------------------------------


---- [ui] tests/ui/generic-associated-types/self-outlives-lint.rs stdout ----
diff of stderr:

108    = note: this bound is currently required to ensure that impls have maximum flexibility
109    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
- error: missing required bound on `Iterator`
-   --> $DIR/self-outlives-lint.rs:142:5
-    |
-    |
- LL |     type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
-    |                                                       |
-    |                                                       |
-    |                                                       help: add the required where clause: `where Self: 'a`
-    |
-    = note: this bound is currently required to ensure that impls have maximum flexibility
-    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
122 error: missing required bound on `Item`
123   --> $DIR/self-outlives-lint.rs:140:5
124    |


126    |     ^^^^^^^^^^^^^-
127    |                  |
128    |                  help: add the required where clause: `where Self: 'a`
+    |
+    = note: this bound is currently required to ensure that impls have maximum flexibility
+    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
+ error: missing required bound on `Iterator`
+   --> $DIR/self-outlives-lint.rs:142:5
+    |
+    |
+ LL |     type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
+    |                                                       |
+    |                                                       |
+    |                                                       help: add the required where clause: `where Self: 'a`
129    |
130    = note: this bound is currently required to ensure that impls have maximum flexibility
131    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/self-outlives-lint/self-outlives-lint.stderr
To update references, rerun the tests and pass the `--bless` flag
---
   |
LL |     type Item<'x>;
   |     ^^^^^^^^^^^^^-
   |                  |
   |                  help: add the required where clause: `where Self: 'x`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:23:5
   |
LL |     type Out<'x>;
LL |     type Out<'x>;
   |     ^^^^^^^^^^^^-
   |                 |
   |                 help: add the required where clause: `where T: 'x`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:37:5
   |
LL |     type Out<'x>;
LL |     type Out<'x>;
   |     ^^^^^^^^^^^^-
   |                 |
   |                 help: add the required where clause: `where T: 'x`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bounds on `Out`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:44:5
   |
   |
LL |     type Out<'x, 'y>;
   |                     |
   |                     |
   |                     help: add the required where clauses: `where T: 'x, U: 'y`
   |
   = note: these bounds are currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:59:5
   |
   |
LL |     type Out<'x, D>;
   |                    |
   |                    |
   |                    help: add the required where clause: `where D: 'x`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:75:5
   |
   |
LL |     type Out<'x, D>;
   |                    |
   |                    |
   |                    help: add the required where clause: `where D: 'x`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:90:5
   |
   |
LL |     type Out<'x, D>;
   |                    |
   |                    |
   |                    help: add the required where clause: `where D: 'x`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bounds on `Bar`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:112:5
   |
   |
LL |     type Bar<'b>;
   |                 |
   |                 |
   |                 help: add the required where clauses: `where Self: 'a, Self: 'b`
   |
   = note: these bounds are currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:120:5
   |
   |
LL |     type Bar<'b>;
   |                 |
   |                 |
   |                 help: add the required where clause: `where Self: 'b`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:127:5
   |
   |
LL |     type Bar<'b>;
   |                 |
   |                 |
   |                 help: add the required where clause: `where Self: 'b`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:140:5
   |
LL |     type Item<'a>;
LL |     type Item<'a>;
   |     ^^^^^^^^^^^^^-
   |                  |
   |                  help: add the required where clause: `where Self: 'a`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Iterator`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:142:5
   |
   |
LL |     type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
   |                                                       |
   |                                                       |
   |                                                       help: add the required where clause: `where Self: 'a`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:148:5
   |
LL |     type Item<'a>;
LL |     type Item<'a>;
   |     ^^^^^^^^^^^^^-
   |                  |
   |                  help: add the required where clause: `where Self: 'a`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:157:5
   |
   |
LL |     type Bar<'a, 'b>;
   |                     |
   |                     |
   |                     help: add the required where clause: `where 'b: 'a`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Fut`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:173:5
   |
   |
LL |     type Fut<'out>;
   |                   |
   |                   |
   |                   help: add the required where clause: `where 'ctx: 'out`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
##[error]  --> /checkout/tests/ui/generic-associated-types/self-outlives-lint.rs:213:5
   |
LL |     type Item<'a>;
LL |     type Item<'a>;
   |     ^^^^^^^^^^^^^-
   |                  |
   |                  help: add the required where clause: `where Self: 'a`
   |
   = note: this bound is currently required to ensure that impls have maximum flexibility
   = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: aborting due to 16 previous errors
------------------------------------------



---- [ui] tests/ui/lint/unused/unused-macro-rules-compile-error.rs stdout ----
diff of stderr:

10 LL | #![deny(unused_macro_rules)]
11    |         ^^^^^^^^^^^^^^^^^^
12 
- error: 3rd rule of macro `num2` is never used
-   --> $DIR/unused-macro-rules-compile-error.rs:22:5
-    |
- LL |     (two_) => { compile_error! };
- 
- 
19 error: 2nd rule of macro `num2` is never used
20   --> $DIR/unused-macro-rules-compile-error.rs:20:5


22 LL |     (two) => { fn compile_error() {} };
+ 
+ 
+ error: 3rd rule of macro `num2` is never used
+   --> $DIR/unused-macro-rules-compile-error.rs:22:5
+    |
+ LL |     (two_) => { compile_error! };
24 
25 error: aborting due to 3 previous errors
26 

---
--- stderr -------------------------------
error: 5th rule of macro `num` is never used
##[error]  --> /checkout/tests/ui/lint/unused/unused-macro-rules-compile-error.rs:12:5
   |
LL |     (four) => { 4 }; //~ ERROR: rule of macro
   |
note: the lint level is defined here
  --> /checkout/tests/ui/lint/unused/unused-macro-rules-compile-error.rs:1:9
   |
   |
LL | #![deny(unused_macro_rules)]
   |         ^^^^^^^^^^^^^^^^^^

error: 2nd rule of macro `num2` is never used
   |
   |
LL |     (two) => { fn compile_error() {} }; //~ ERROR: rule of macro


error: 3rd rule of macro `num2` is never used
   |
   |
LL |     (two_) => { compile_error! }; //~ ERROR: rule of macro

error: aborting due to 3 previous errors
------------------------------------------



---- [ui] tests/ui/stats/hir-stats.rs stdout ----
diff of stderr:

8 ast-stats-1 WherePredicate            56 ( 0.9%)             1            56
9 ast-stats-1 - BoundPredicate            56 ( 0.9%)             1
10 ast-stats-1 Attribute                 64 ( 1.0%)             2            32
- ast-stats-1 - Normal                    32 ( 0.5%)             1
12 ast-stats-1 - DocComment                32 ( 0.5%)             1
+ ast-stats-1 - Normal                    32 ( 0.5%)             1
13 ast-stats-1 Local                     72 ( 1.1%)             1            72
14 ast-stats-1 Arm                       96 ( 1.5%)             2            48
15 ast-stats-1 ForeignItem               96 ( 1.5%)             1            96

16 ast-stats-1 - Fn                        96 ( 1.5%)             1
17 ast-stats-1 FnDecl                   120 ( 1.8%)             5            24
- ast-stats-1 FieldDef                 160 ( 2.5%)             2            80
+ ast-stats-1 Param                    160 ( 2.5%)             4            40
19 ast-stats-1 Stmt                     160 ( 2.5%)             5            32
- ast-stats-1 - Local                     32 ( 0.5%)             1
21 ast-stats-1 - MacCall                   32 ( 0.5%)             1
+ ast-stats-1 - Local                     32 ( 0.5%)             1
22 ast-stats-1 - Expr                      96 ( 1.5%)             3
- ast-stats-1 Param                    160 ( 2.5%)             4            40
+ ast-stats-1 FieldDef                 160 ( 2.5%)             2            80
24 ast-stats-1 Block                    192 ( 3.0%)             6            32
25 ast-stats-1 Variant                  208 ( 3.2%)             2           104
26 ast-stats-1 GenericBound             224 ( 3.5%)             4            56

27 ast-stats-1 - Trait                    224 ( 3.5%)             4
28 ast-stats-1 AssocItem                352 ( 5.4%)             4            88
- ast-stats-1 - Type                     176 ( 2.7%)             2
30 ast-stats-1 - Fn                       176 ( 2.7%)             2
+ ast-stats-1 - Type                     176 ( 2.7%)             2
31 ast-stats-1 GenericParam             480 ( 7.4%)             5            96
32 ast-stats-1 Pat                      504 ( 7.8%)             7            72
33 ast-stats-1 - Struct                    72 ( 1.1%)             1

35 ast-stats-1 - Ident                    360 ( 5.5%)             5
36 ast-stats-1 Expr                     576 ( 8.9%)             8            72
37 ast-stats-1 - Path                      72 ( 1.1%)             1
- ast-stats-1 - Match                     72 ( 1.1%)             1
39 ast-stats-1 - Struct                    72 ( 1.1%)             1
+ ast-stats-1 - Match                     72 ( 1.1%)             1
40 ast-stats-1 - Lit                      144 ( 2.2%)             2
41 ast-stats-1 - Block                    216 ( 3.3%)             3
42 ast-stats-1 PathSegment              720 (11.1%)            30            24

43 ast-stats-1 Ty                       896 (13.8%)            14            64
- ast-stats-1 - Ptr                       64 ( 1.0%)             1
45 ast-stats-1 - Ref                       64 ( 1.0%)             1
+ ast-stats-1 - Ptr                       64 ( 1.0%)             1
46 ast-stats-1 - ImplicitSelf             128 ( 2.0%)             2
47 ast-stats-1 - Path                     640 ( 9.9%)            10
48 ast-stats-1 Item                   1_224 (18.9%)             9           136

- ast-stats-1 - Trait                    136 ( 2.1%)             1
+ ast-stats-1 - Impl                     136 ( 2.1%)             1
50 ast-stats-1 - Enum                     136 ( 2.1%)             1
51 ast-stats-1 - ForeignMod               136 ( 2.1%)             1
- ast-stats-1 - Impl                     136 ( 2.1%)             1
+ ast-stats-1 - Trait                    136 ( 2.1%)             1
53 ast-stats-1 - Fn                       272 ( 4.2%)             2
54 ast-stats-1 - Use                      408 ( 6.3%)             3
55 ast-stats-1 ----------------------------------------------------------------

68 ast-stats-2 Arm                       96 ( 1.4%)             2            48
69 ast-stats-2 ForeignItem               96 ( 1.4%)             1            96
70 ast-stats-2 - Fn                        96 ( 1.4%)             1
- ast-stats-2 InlineAsm                120 ( 1.7%)             1           120
72 ast-stats-2 FnDecl                   120 ( 1.7%)             5            24
+ ast-stats-2 InlineAsm                120 ( 1.7%)             1           120
73 ast-stats-2 Attribute                128 ( 1.8%)             4            32
74 ast-stats-2 - DocComment                32 ( 0.5%)             1
75 ast-stats-2 - Normal                    96 ( 1.4%)             3

- ast-stats-2 FieldDef                 160 ( 2.3%)             2            80
+ ast-stats-2 Param                    160 ( 2.3%)             4            40
77 ast-stats-2 Stmt                     160 ( 2.3%)             5            32
- ast-stats-2 - Local                     32 ( 0.5%)             1
79 ast-stats-2 - Semi                      32 ( 0.5%)             1
+ ast-stats-2 - Local                     32 ( 0.5%)             1
80 ast-stats-2 - Expr                      96 ( 1.4%)             3
- ast-stats-2 Param                    160 ( 2.3%)             4            40
+ ast-stats-2 FieldDef                 160 ( 2.3%)             2            80
82 ast-stats-2 Block                    192 ( 2.7%)             6            32
83 ast-stats-2 Variant                  208 ( 2.9%)             2           104
84 ast-stats-2 GenericBound             224 ( 3.2%)             4            56

85 ast-stats-2 - Trait                    224 ( 3.2%)             4
86 ast-stats-2 AssocItem                352 ( 5.0%)             4            88
- ast-stats-2 - Type                     176 ( 2.5%)             2
88 ast-stats-2 - Fn                       176 ( 2.5%)             2
+ ast-stats-2 - Type                     176 ( 2.5%)             2
89 ast-stats-2 GenericParam             480 ( 6.8%)             5            96
90 ast-stats-2 Pat                      504 ( 7.1%)             7            72
91 ast-stats-2 - Struct                    72 ( 1.0%)             1

93 ast-stats-2 - Ident                    360 ( 5.1%)             5
94 ast-stats-2 Expr                     648 ( 9.1%)             9            72
95 ast-stats-2 - Path                      72 ( 1.0%)             1
- ast-stats-2 - Match                     72 ( 1.0%)             1
97 ast-stats-2 - Struct                    72 ( 1.0%)             1
+ ast-stats-2 - Match                     72 ( 1.0%)             1
98 ast-stats-2 - InlineAsm                 72 ( 1.0%)             1
99 ast-stats-2 - Lit                      144 ( 2.0%)             2
100 ast-stats-2 - Block                    216 ( 3.0%)             3

101 ast-stats-2 PathSegment              792 (11.2%)            33            24
102 ast-stats-2 Ty                       896 (12.6%)            14            64
- ast-stats-2 - Ptr                       64 ( 0.9%)             1
104 ast-stats-2 - Ref                       64 ( 0.9%)             1
+ ast-stats-2 - Ptr                       64 ( 0.9%)             1
105 ast-stats-2 - ImplicitSelf             128 ( 1.8%)             2
106 ast-stats-2 - Path                     640 ( 9.0%)            10
107 ast-stats-2 Item                   1_496 (21.1%)            11           136

- ast-stats-2 - Trait                    136 ( 1.9%)             1
+ ast-stats-2 - Impl                     136 ( 1.9%)             1
109 ast-stats-2 - Enum                     136 ( 1.9%)             1
- ast-stats-2 - ExternCrate              136 ( 1.9%)             1
111 ast-stats-2 - ForeignMod               136 ( 1.9%)             1
- ast-stats-2 - Impl                     136 ( 1.9%)             1
+ ast-stats-2 - Trait                    136 ( 1.9%)             1
+ ast-stats-2 - ExternCrate              136 ( 1.9%)             1
113 ast-stats-2 - Fn                       272 ( 3.8%)             2
114 ast-stats-2 - Use                      544 ( 7.7%)             4
115 ast-stats-2 ----------------------------------------------------------------

123 hir-stats Mod                       32 ( 0.4%)             1            32
124 hir-stats ExprField                 40 ( 0.4%)             1            40
125 hir-stats TraitItemRef              56 ( 0.6%)             2            28
- hir-stats Local                     64 ( 0.7%)             1            64
127 hir-stats Param                     64 ( 0.7%)             2            32
- hir-stats InlineAsm                 72 ( 0.8%)             1            72
+ hir-stats Local                     64 ( 0.7%)             1            64
129 hir-stats ImplItemRef               72 ( 0.8%)             2            36
+ hir-stats InlineAsm                 72 ( 0.8%)             1            72
+ hir-stats Arm                       96 ( 1.1%)             2            48
130 hir-stats Body                      96 ( 1.1%)             3            32
131 hir-stats FieldDef                  96 ( 1.1%)             2            48
- hir-stats Arm                       96 ( 1.1%)             2            48
133 hir-stats Stmt                      96 ( 1.1%)             3            32
- hir-stats - Local                     32 ( 0.4%)             1
135 hir-stats - Semi                      32 ( 0.4%)             1
136 hir-stats - Expr                      32 ( 0.4%)             1
+ hir-stats - Local                     32 ( 0.4%)             1
137 hir-stats FnDecl                   120 ( 1.3%)             3            40
- hir-stats Attribute                128 ( 1.4%)             4            32
139 hir-stats GenericArg               128 ( 1.4%)             4            32
140 hir-stats - Type                      32 ( 0.4%)             1
141 hir-stats - Lifetime                  96 ( 1.1%)             3

+ hir-stats Attribute                128 ( 1.4%)             4            32
142 hir-stats GenericArgs              144 ( 1.6%)             3            48
143 hir-stats Variant                  176 ( 1.9%)             2            88
- hir-stats GenericBound             192 ( 2.1%)             4            48
- hir-stats - Trait                    192 ( 2.1%)             4
146 hir-stats WherePredicate           192 ( 2.1%)             3            64
147 hir-stats - BoundPredicate           192 ( 2.1%)             3
+ hir-stats GenericBound             192 ( 2.1%)             4            48
+ hir-stats - Trait                    192 ( 2.1%)             4
148 hir-stats Block                    288 ( 3.2%)             6            48
149 hir-stats Pat                      360 ( 3.9%)             5            72
- hir-stats - Wild                      72 ( 0.8%)             1
151 hir-stats - Struct                    72 ( 0.8%)             1
+ hir-stats - Wild                      72 ( 0.8%)             1
152 hir-stats - Binding                  216 ( 2.4%)             3
153 hir-stats GenericParam             400 ( 4.4%)             5            80
154 hir-stats Generics                 560 ( 6.1%)            10            56

155 hir-stats Ty                       720 ( 7.9%)            15            48
- hir-stats - Ptr                       48 ( 0.5%)             1
157 hir-stats - Ref                       48 ( 0.5%)             1
+ hir-stats - Ptr                       48 ( 0.5%)             1
158 hir-stats - Path                     624 ( 6.8%)            13
159 hir-stats Expr                     768 ( 8.4%)            12            64
160 hir-stats - Path                      64 ( 0.7%)             1

164 hir-stats - Lit                      128 ( 1.4%)             2
165 hir-stats - Block                    384 ( 4.2%)             6
166 hir-stats Item                     968 (10.6%)            11            88
- hir-stats - Trait                     88 ( 1.0%)             1
+ hir-stats - Impl                      88 ( 1.0%)             1
168 hir-stats - Enum                      88 ( 1.0%)             1
- hir-stats - ExternCrate               88 ( 1.0%)             1
170 hir-stats - ForeignMod                88 ( 1.0%)             1
- hir-stats - Impl                      88 ( 1.0%)             1
+ hir-stats - Trait                     88 ( 1.0%)             1
+ hir-stats - ExternCrate               88 ( 1.0%)             1
172 hir-stats - Fn                       176 ( 1.9%)             2
173 hir-stats - Use                      352 ( 3.9%)             4
174 hir-stats Path                   1_240 (13.6%)            31            40

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/stats/hir-stats/hir-stats.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args stats/hir-stats.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/stats/hir-stats.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/stats/hir-stats" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/stats/hir-stats/auxiliary" "-Zhir-stats"
--- stderr -------------------------------
--- stderr -------------------------------
ast-stats-1 PRE EXPANSION AST STATS
ast-stats-1 Name                Accumulated Size         Count     Item Size
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 GenericArgs               40 ( 0.6%)             1            40
ast-stats-1 - AngleBracketed            40 ( 0.6%)             1
ast-stats-1 Crate                     40 ( 0.6%)             1            40
ast-stats-1 ExprField                 48 ( 0.7%)             1            48
ast-stats-1 WherePredicate            56 ( 0.9%)             1            56
ast-stats-1 - BoundPredicate            56 ( 0.9%)             1
ast-stats-1 Attribute                 64 ( 1.0%)             2            32
ast-stats-1 - DocComment                32 ( 0.5%)             1
ast-stats-1 - Normal                    32 ( 0.5%)             1
ast-stats-1 Local                     72 ( 1.1%)             1            72
ast-stats-1 Arm                       96 ( 1.5%)             2            48
ast-stats-1 ForeignItem               96 ( 1.5%)             1            96
ast-stats-1 - Fn                        96 ( 1.5%)             1
ast-stats-1 FnDecl                   120 ( 1.8%)             5            24
ast-stats-1 Param                    160 ( 2.5%)             4            40
ast-stats-1 Stmt                     160 ( 2.5%)             5            32
ast-stats-1 - MacCall                   32 ( 0.5%)             1
ast-stats-1 - Local                     32 ( 0.5%)             1
ast-stats-1 - Expr                      96 ( 1.5%)             3
ast-stats-1 FieldDef                 160 ( 2.5%)             2            80
ast-stats-1 Block                    192 ( 3.0%)             6            32
ast-stats-1 Variant                  208 ( 3.2%)             2           104
ast-stats-1 GenericBound             224 ( 3.5%)             4            56
ast-stats-1 - Trait                    224 ( 3.5%)             4
ast-stats-1 AssocItem                352 ( 5.4%)             4            88
ast-stats-1 - Fn                       176 ( 2.7%)             2
ast-stats-1 - Type                     176 ( 2.7%)             2
ast-stats-1 GenericParam             480 ( 7.4%)             5            96
ast-stats-1 Pat                      504 ( 7.8%)             7            72
ast-stats-1 - Struct                    72 ( 1.1%)             1
ast-stats-1 - Wild                      72 ( 1.1%)             1
ast-stats-1 - Ident                    360 ( 5.5%)             5
ast-stats-1 Expr                     576 ( 8.9%)             8            72
ast-stats-1 - Path                      72 ( 1.1%)             1
ast-stats-1 - Struct                    72 ( 1.1%)             1
ast-stats-1 - Match                     72 ( 1.1%)             1
ast-stats-1 - Lit                      144 ( 2.2%)             2
ast-stats-1 - Block                    216 ( 3.3%)             3
ast-stats-1 PathSegment              720 (11.1%)            30            24
ast-stats-1 Ty                       896 (13.8%)            14            64
ast-stats-1 - Ref                       64 ( 1.0%)             1
ast-stats-1 - Ptr                       64 ( 1.0%)             1
ast-stats-1 - ImplicitSelf             128 ( 2.0%)             2
ast-stats-1 - Path                     640 ( 9.9%)            10
ast-stats-1 Item                   1_224 (18.9%)             9           136
ast-stats-1 - Impl                     136 ( 2.1%)             1
ast-stats-1 - Enum                     136 ( 2.1%)             1
ast-stats-1 - ForeignMod               136 ( 2.1%)             1
ast-stats-1 - Trait                    136 ( 2.1%)             1
ast-stats-1 - Fn                       272 ( 4.2%)             2
ast-stats-1 - Use                      408 ( 6.3%)             3
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 Total                  6_488
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 GenericArgs               40 ( 0.6%)             1            40
ast-stats-2 - AngleBracketed            40 ( 0.6%)             1
ast-stats-2 Crate                     40 ( 0.6%)             1            40
ast-stats-2 ExprField                 48 ( 0.7%)             1            48
ast-stats-2 WherePredicate            56 ( 0.8%)             1            56
ast-stats-2 - BoundPredicate            56 ( 0.8%)             1
ast-stats-2 Local                     72 ( 1.0%)             1            72
ast-stats-2 Arm                       96 ( 1.4%)             2            48
ast-stats-2 ForeignItem               96 ( 1.4%)             1            96
ast-stats-2 - Fn                        96 ( 1.4%)             1
ast-stats-2 FnDecl                   120 ( 1.7%)             5            24
ast-stats-2 InlineAsm                120 ( 1.7%)             1           120
ast-stats-2 Attribute                128 ( 1.8%)             4            32
ast-stats-2 - DocComment                32 ( 0.5%)             1
ast-stats-2 - Normal                    96 ( 1.4%)             3
ast-stats-2 Param                    160 ( 2.3%)             4            40
ast-stats-2 Stmt                     160 ( 2.3%)             5            32
ast-stats-2 - Semi                      32 ( 0.5%)             1
ast-stats-2 - Local                     32 ( 0.5%)             1
ast-stats-2 - Expr                      96 ( 1.4%)             3
ast-stats-2 FieldDef                 160 ( 2.3%)             2            80
ast-stats-2 Block                    192 ( 2.7%)             6            32
ast-stats-2 Variant                  208 ( 2.9%)             2           104
ast-stats-2 GenericBound             224 ( 3.2%)             4            56
ast-stats-2 - Trait                    224 ( 3.2%)             4
ast-stats-2 AssocItem                352 ( 5.0%)             4            88
ast-stats-2 - Fn                       176 ( 2.5%)             2
ast-stats-2 - Type                     176 ( 2.5%)             2
ast-stats-2 GenericParam             480 ( 6.8%)             5            96
ast-stats-2 Pat                      504 ( 7.1%)             7            72
ast-stats-2 - Struct                    72 ( 1.0%)             1
ast-stats-2 - Wild                      72 ( 1.0%)             1
ast-stats-2 - Ident                    360 ( 5.1%)             5
ast-stats-2 Expr                     648 ( 9.1%)             9            72
ast-stats-2 - Path                      72 ( 1.0%)             1
ast-stats-2 - Struct                    72 ( 1.0%)             1
ast-stats-2 - Match                     72 ( 1.0%)             1
ast-stats-2 - InlineAsm                 72 ( 1.0%)             1
ast-stats-2 - Lit                      144 ( 2.0%)             2
ast-stats-2 - Block                    216 ( 3.0%)             3
ast-stats-2 PathSegment              792 (11.2%)            33            24
ast-stats-2 Ty                       896 (12.6%)            14            64
ast-stats-2 - Ref                       64 ( 0.9%)             1
ast-stats-2 - Ptr                       64 ( 0.9%)             1
ast-stats-2 - ImplicitSelf             128 ( 1.8%)             2
ast-stats-2 - Path                     640 ( 9.0%)            10
ast-stats-2 Item                   1_496 (21.1%)            11           136
ast-stats-2 - Impl                     136 ( 1.9%)             1
ast-stats-2 - Enum                     136 ( 1.9%)             1
ast-stats-2 - ForeignMod               136 ( 1.9%)             1
ast-stats-2 - Trait                    136 ( 1.9%)             1
ast-stats-2 - ExternCrate              136 ( 1.9%)             1
ast-stats-2 - Fn                       272 ( 3.8%)             2
ast-stats-2 - Use                      544 ( 7.7%)             4
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 Total                  7_088
hir-stats HIR STATS
hir-stats Name                Accumulated Size         Count     Item Size
hir-stats ----------------------------------------------------------------
hir-stats ----------------------------------------------------------------
hir-stats ForeignItemRef            24 ( 0.3%)             1            24
hir-stats Lifetime                  24 ( 0.3%)             1            24
hir-stats Mod                       32 ( 0.4%)             1            32
hir-stats ExprField                 40 ( 0.4%)             1            40
hir-stats TraitItemRef              56 ( 0.6%)             2            28
hir-stats Param                     64 ( 0.7%)             2            32
hir-stats Local                     64 ( 0.7%)             1            64
hir-stats ImplItemRef               72 ( 0.8%)             2            36
hir-stats InlineAsm                 72 ( 0.8%)             1            72
hir-stats Arm                       96 ( 1.1%)             2            48
hir-stats Body                      96 ( 1.1%)             3            32
hir-stats FieldDef                  96 ( 1.1%)             2            48
hir-stats Stmt                      96 ( 1.1%)             3            32
hir-stats - Semi                      32 ( 0.4%)             1
hir-stats - Expr                      32 ( 0.4%)             1
hir-stats - Local                     32 ( 0.4%)             1
hir-stats FnDecl                   120 ( 1.3%)             3            40
hir-stats GenericArg               128 ( 1.4%)             4            32
hir-stats - Type                      32 ( 0.4%)             1
hir-stats - Lifetime                  96 ( 1.1%)             3
hir-stats Attribute                128 ( 1.4%)             4            32
hir-stats GenericArgs              144 ( 1.6%)             3            48
hir-stats Variant                  176 ( 1.9%)             2            88
hir-stats WherePredicate           192 ( 2.1%)             3            64
hir-stats - BoundPredicate           192 ( 2.1%)             3
hir-stats GenericBound             192 ( 2.1%)             4            48
hir-stats - Trait                    192 ( 2.1%)             4
hir-stats Block                    288 ( 3.2%)             6            48
hir-stats Pat                      360 ( 3.9%)             5            72
hir-stats - Struct                    72 ( 0.8%)             1
hir-stats - Wild                      72 ( 0.8%)             1
hir-stats - Binding                  216 ( 2.4%)             3
hir-stats GenericParam             400 ( 4.4%)             5            80
hir-stats Generics                 560 ( 6.1%)            10            56
hir-stats Ty                       720 ( 7.9%)            15            48
hir-stats - Ref                       48 ( 0.5%)             1
hir-stats - Ptr                       48 ( 0.5%)             1
hir-stats - Path                     624 ( 6.8%)            13
hir-stats Expr                     768 ( 8.4%)            12            64
hir-stats - Path                      64 ( 0.7%)             1
hir-stats - Struct                    64 ( 0.7%)             1
hir-stats - Match                     64 ( 0.7%)             1
hir-stats - InlineAsm                 64 ( 0.7%)             1
hir-stats - Lit                      128 ( 1.4%)             2
hir-stats - Block                    384 ( 4.2%)             6
hir-stats Item                     968 (10.6%)            11            88
hir-stats - Impl                      88 ( 1.0%)             1
hir-stats - Enum                      88 ( 1.0%)             1
hir-stats - ForeignMod                88 ( 1.0%)             1
hir-stats - Trait                     88 ( 1.0%)             1
hir-stats - ExternCrate               88 ( 1.0%)             1
hir-stats - Fn                       176 ( 1.9%)             2
hir-stats - Use                      352 ( 3.9%)             4
hir-stats Path                   1_240 (13.6%)            31            40
hir-stats PathSegment            1_920 (21.0%)            40            48
hir-stats ----------------------------------------------------------------
hir-stats
------------------------------------------



---- [ui] tests/ui/suggestions/issue-98562.rs stdout ----
diff of stderr:

4 LL | impl TraitA<u8, u16, u32> for X {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `baz` in implementation
6    |
-    = help: implement the missing item: `fn baz<U: TraitC<I1 = u8, I2 = u16> + TraitD<I3 = u32>, V: TraitD<I3 = u8>>(_: U, _: V) -> Self where U: TraitE, U: TraitB, <U as TraitB>::Item: Copy { todo!() }`
+    = help: implement the missing item: `fn baz<V: TraitD<I3 = u8>, U: TraitC<I1 = u8, I2 = u16> + TraitD<I3 = u32>>(_: U, _: V) -> Self where U: TraitE, U: TraitB, <U as TraitB>::Item: Copy { todo!() }`
9 error: aborting due to previous error
10 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-98562/issue-98562.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/issue-98562.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/issue-98562.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-98562" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-98562/auxiliary"
--- stderr -------------------------------
error[E0046]: not all trait items implemented, missing: `baz`
##[error]  --> /checkout/tests/ui/suggestions/issue-98562.rs:7:1
   |
   |
LL | impl TraitA<u8, u16, u32> for X {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `baz` in implementation
   |
   = help: implement the missing item: `fn baz<V: TraitD<I3 = u8>, U: TraitC<I1 = u8, I2 = u16> + TraitD<I3 = u32>>(_: U, _: V) -> Self where U: TraitE, U: TraitB, <U as TraitB>::Item: Copy { todo!() }`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0046`.
------------------------------------------

@Mark-Simulacrum
Copy link
Member

@rust-timer build f06e258

@bjorn3

This comment was marked as resolved.

@bors
Copy link
Collaborator

bors commented Oct 23, 2023

☀️ Try build successful - checks-actions
Build commit: 53d3149 (53d3149586c6d25e87f86d9041425dcb40017ca6)

@Noratrieb
Copy link
Member Author

@rust-timer build 53d3149

@Noratrieb
Copy link
Member Author

I saw the right commit in the queue before but now it's the old one again.
@rust-timer build 53d3149

@Noratrieb
Copy link
Member Author

Still not correct. Whatever, let's just wait for the commit to come through. Maybe thinlto did everything correctly and we'll get something anyways. I will build the second commit afterwards.

Copy link

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, that was fast. =D

Two comments, that may be obvious, but just to be sure... First, you'll need to be using a hash table like HashBrown for this to work well in practice. And two, if Fx is just an xor hash (which is all I saw?) then it'll certainly be faster. That's even further on the "speed but forget quality" spectrum than this version.

self.hash_bytes_large(bytes);
}

#[inline]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd encourage this to not be inline FWIW. The code is quite large and doesn't seem to benefit much from it.

@bjorn3
Copy link
Member

bjorn3 commented Oct 23, 2023

First, you'll need to be using a hash table like HashBrown for this to work well in practice.

The HashMap implementation in rust's standard library is a wrapper around the hashbrown crate.

And two, if Fx is just an xor hash (which is all I saw?) then it'll certainly be faster.

https://github.com/rust-lang/rustc-hash/blob/786ccda70fce97a3177d6088f21a22ac7f0f2f85/src/lib.rs#L79

Basically for every input byte shift by a constant amount, xor by the input byte and then multiply by a constant.

@chandlerc
Copy link

First, you'll need to be using a hash table like HashBrown for this to work well in practice.

The HashMap implementation in rust's standard library is a wrapper around the hashbrown crate.

And two, if Fx is just an xor hash (which is all I saw?) then it'll certainly be faster.

rust-lang/rustc-hash@786ccda/src/lib.rs#L79

Basically for every input byte shift by a constant amount, xor by the input byte and then multiply by a constant.

So, I expect that to be a bit faster for small inputs and slower for large ones.

But I also expect that to produce very bad results when hashing common cases like pointers. Not just "low quality" but "extraordinarily low quality" unless there is some other shifting or rotating done to pointers. And if there is, then you can get rid of that with this hash function and likely have it be same-or-faster.

@lqd
Copy link
Member

lqd commented Oct 23, 2023

We don't often hash large inputs (compared to how often we hash u32s for example ^^).

There are more details about fxhash and how it's used, (some of) what was tried to improve it, and more in this post btw: https://nnethercote.github.io/2021/12/08/a-brutally-effective-hash-function-in-rust.html

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f06e258): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.2%, 1.1%] 142
Regressions ❌
(secondary)
0.6% [0.1%, 1.7%] 82
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.4%] 5
All ❌✅ (primary) 0.5% [-0.2%, 1.1%] 143

Max RSS (memory usage)

Results

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)
1.4% [1.1%, 2.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.1%, -1.9%] 2
All ❌✅ (primary) - - 0

Cycles

Results

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)
1.2% [0.9%, 1.5%] 3
Regressions ❌
(secondary)
3.5% [1.1%, 5.9%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.9%, 1.5%] 3

Binary size

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

Bootstrap: missing data
Artifact size: 304.33 MiB -> 304.28 MiB (-0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 23, 2023
@bjorn3
Copy link
Member

bjorn3 commented Oct 23, 2023

Wall time is probably the most relevant metric here as this hasher is supposed to have better latency. The results are very mixed: https://perf.rust-lang.org/compare.html?start=6bb4ad6dfb7d373c2f19b6cc8c0f05bd73f6d3cc&end=f06e2588ccd72e05fc8a5b13d79001f4087b525b&stat=wall-time&tab=compile&nonRelevant=true Some benchmarks have a two-digit improvement while others have a two-digit regression. On average I think it tends more towards a regression than an improvement.

@Noratrieb
Copy link
Member Author

@rust-timer build 53d3149

Checking with the inline

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53d3149): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.2%, 1.0%] 140
Regressions ❌
(secondary)
0.6% [0.1%, 1.5%] 85
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 3
Improvements ✅
(secondary)
-0.6% [-0.8%, -0.5%] 6
All ❌✅ (primary) 0.4% [-0.3%, 1.0%] 143

Max RSS (memory usage)

Results

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)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

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)
1.4% [0.8%, 3.4%] 30
Regressions ❌
(secondary)
3.4% [0.8%, 5.0%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [0.8%, 3.4%] 30

Binary size

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

Bootstrap: missing data
Artifact size: 304.30 MiB -> 304.31 MiB (0.00%)

@Noratrieb
Copy link
Member Author

instructions are negative, cycles are negative and wall time is noisy. just as you predicted, this is indeed slower. fxhash wins once again!
interesting point about pointers though. rust does hash quite some pointers (u32 indices are still the most common keys though), so maybe doing some shifting on pointers could help. there's also a nice central place for the pointers that are getting hashed:

I assume you mean shifting away the alignment bits, since they don't have any entropy?

@jackh726 jackh726 added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 21, 2023
@Noratrieb Noratrieb closed this Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.