Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover most of the perf loss of #120393 #121625

Closed
wants to merge 2 commits into from

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Feb 26, 2024

#120393

draft for perf

@rustbot
Copy link
Collaborator

rustbot commented Feb 26, 2024

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Feb 26, 2024

@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 Feb 26, 2024
@bors
Copy link
Contributor

bors commented Feb 26, 2024

⌛ Trying commit 301ce36 with merge d9f0079...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
@bors
Copy link
Contributor

bors commented Feb 26, 2024

☀️ Try build successful - checks-actions
Build commit: d9f0079 (d9f00799f0acbbfc170edd1e3aa0e3278994a6be)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d9f0079): 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.8% [0.7%, 0.8%] 4
Regressions ❌
(secondary)
0.5% [0.3%, 0.7%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.7%, 0.8%] 4

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)
3.7% [3.7%, 3.7%] 1
Regressions ❌
(secondary)
4.4% [4.2%, 4.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.7% [3.7%, 3.7%] 1

Cycles

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

Binary size

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

Bootstrap: 650.341s -> 651.214s (0.13%)
Artifact size: 311.22 MiB -> 311.19 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 26, 2024
@Urgau
Copy link
Member Author

Urgau commented Feb 26, 2024

I wasn't expecting a increase, quite the opposite.

I don't really understand how adding a early-return makes the implementation slower.

Or is this just noise and the early-return makes no difference?

@lcnr
Copy link
Contributor

lcnr commented Feb 26, 2024

likely noise 🤔

@Urgau Urgau force-pushed the non-local-defs_recover_perf branch from 8ecf8fb to 2b51202 Compare February 26, 2024 19:08
@the8472
Copy link
Member

the8472 commented Feb 26, 2024

@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 Feb 26, 2024
@bors
Copy link
Contributor

bors commented Feb 26, 2024

⌛ Trying commit 2b51202 with merge c0ada78...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
@bors
Copy link
Contributor

bors commented Feb 26, 2024

☀️ Try build successful - checks-actions
Build commit: c0ada78 (c0ada780adab2f2ec97b24096100377d7122fd72)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c0ada78): comparison URL.

Overall result: ✅ improvements - no 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.

@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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.4%, -0.3%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.4%, -0.3%] 6

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)
3.6% [2.8%, 4.5%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.6% [2.8%, 4.5%] 2

Cycles

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

Binary size

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

Bootstrap: 650.626s -> 650.043s (-0.09%)
Artifact size: 311.12 MiB -> 311.16 MiB (0.01%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Feb 27, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Feb 27, 2024

@bors try @rust-timer queue

@the8472
Copy link
Member

the8472 commented Feb 29, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
@bors
Copy link
Contributor

bors commented Feb 29, 2024

⌛ Trying commit 7c21492 with merge 112fbb5...

@bors
Copy link
Contributor

bors commented Feb 29, 2024

☀️ Try build successful - checks-actions
Build commit: 112fbb5 (112fbb5de2a9305e0ad99fefed5afdb5161616f8)

1 similar comment
@bors
Copy link
Contributor

bors commented Feb 29, 2024

☀️ Try build successful - checks-actions
Build commit: 112fbb5 (112fbb5de2a9305e0ad99fefed5afdb5161616f8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (112fbb5): comparison URL.

Overall result: ❌ regressions - no 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.

@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
Regressions ❌
(secondary)
3.3% [2.9%, 3.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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

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)
- - 0
Regressions ❌
(secondary)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-6.7%, -1.4%] 15
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 652.986s -> 651.533s (-0.22%)
Artifact size: 311.09 MiB -> 311.08 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 29, 2024
@Urgau
Copy link
Member Author

Urgau commented Feb 29, 2024

Even with maximum laziness tcx.parent still seems to be costly. I guess that makes sense.

Now let's try the same laziness but with pure HIR.

EDIT: I'm now wondering if the laziness is even necessary? If this is good I will try without it, it could simplify some things.

@Kobzol
Copy link
Contributor

Kobzol commented Feb 29, 2024

@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 Feb 29, 2024
@bors
Copy link
Contributor

bors commented Feb 29, 2024

⌛ Trying commit 87a3a57 with merge acd70b2...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
@bors
Copy link
Contributor

bors commented Feb 29, 2024

☀️ Try build successful - checks-actions
Build commit: acd70b2 (acd70b218bbb645d9be0452df27e22e3dadbffc5)

1 similar comment
@bors
Copy link
Contributor

bors commented Feb 29, 2024

☀️ Try build successful - checks-actions
Build commit: acd70b2 (acd70b218bbb645d9be0452df27e22e3dadbffc5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (acd70b2): 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
Regressions ❌
(secondary)
1.6% [1.6%, 1.6%] 1
Improvements ✅
(primary)
-0.3% [-0.4%, -0.3%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.4%, -0.3%] 6

Max RSS (memory usage)

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

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)
- - 0
Regressions ❌
(secondary)
8.8% [1.0%, 12.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 650.923s -> 651.466s (0.08%)
Artifact size: 311.19 MiB -> 311.14 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 Feb 29, 2024
@Urgau Urgau force-pushed the non-local-defs_recover_perf branch from 87a3a57 to 1974da7 Compare February 29, 2024 18:16
@Urgau
Copy link
Member Author

Urgau commented Feb 29, 2024

This is going to be my final perf (famous last words). It's using only the HIR but doesn't lazy anything, since I don't think it does much.

@Urgau Urgau force-pushed the non-local-defs_recover_perf branch from 1974da7 to 5e73be3 Compare February 29, 2024 18:24
= help: move this `impl` block outside the of the current constant expression `<unnameable>`
= help: move this `impl` block outside the of the current type alias `A`
Copy link
Member Author

Choose a reason for hiding this comment

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

Hum... This appears to be a correctness issue.

It appears that HIR Owner != tcx.parent.

This example should lint, but doesn't with HIR owner since with parent_owner_iter the parent of the impl def is the anon-const instead of the closure with tcx.parent.

const _: u32 = {
    let _a = || {
        impl Uto6 for Test {}
        //~^ WARN non-local `impl` definition

        1
    };
}

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=Urgau
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_c35563ed-90a9-47ea-8c58-9515d21a68b0
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=9cfe186f25d39939d3ead9ce225d924efa0b557a
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_c35563ed-90a9-47ea-8c58-9515d21a68b0
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_c35563ed-90a9-47ea-8c58-9515d21a68b0
GITHUB_TRIGGERING_ACTOR=Urgau
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/121625/merge
GITHUB_WORKFLOW_SHA=9cfe186f25d39939d3ead9ce225d924efa0b557a
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
#12 writing image sha256:a9e31bebbe37d5ae20761931a45b0afe94ace71a0af8cc59f57de5ccd231c96b done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Thu Feb 29 18:26:35 UTC 2024
  network time: Thu, 29 Feb 2024 18:26:35 GMT
  network time: Thu, 29 Feb 2024 18:26:35 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---

620    = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
621    = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
622    = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
-    = note: the macro `non_local_macro::non_local_impl` may come from an old version of the `non_local_macro` crate, try updating your dependency with `cargo update -p non_local_macro`
625 
626 warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation


633    = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
635    = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
635    = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
-    = note: the macro `non_local_macro::non_local_macro_rules` may come from an old version of the `non_local_macro` crate, try updating your dependency with `cargo update -p non_local_macro`
638 
639 warning: 50 warnings emitted



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

error: 1 errors occurred comparing output.
status: exit status: 0
command: CARGO="/usr/bin/cargo" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lint/non_local_definitions.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/lint/non_local_definitions" "-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/lint/non_local_definitions/auxiliary" "--edition=2021"
--- stderr -------------------------------
warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:36:5
   |
   |
LL | const Z: () = {
   |       - help: use a const-anon item to suppress this lint: `_`
...
LL |     impl Uto for &Test {}
   |
   = help: move this `impl` block outside the of the current constant item `Z`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
   = note: `#[warn(non_local_definitions)]` on by default

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:46:5
   |
LL |     impl Uto for *mut Test {}
   |
   = help: move this `impl` block outside the of the current type alias `A`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:54:9
   |
LL |         impl Uto for Test {}
   |
   = help: move this `impl` block outside the of the current enum `Enum`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:63:5
   |
LL |     impl Uto2 for Test {}
   |
   = help: move this `impl` block outside the of the current static item `A`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:71:5
   |
LL |     impl Uto3 for Test {}
   |
   = help: move this `impl` block outside the of the current constant item `B`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:75:5
   |
LL |     macro_rules! m0 { () => { } };
   |
   |
   = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current constant item `B`
   = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:87:5
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:87:5
   |
LL |     macro_rules! m { () => { } };
   |
   |
   = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `main`
   = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:90:5
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:90:5
   |
LL | /     impl Test {
LL | |     //~^ WARN non-local `impl` definition
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `main`
---
warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:96:9
   |
LL | /         impl Test {
LL | |         //~^ WARN non-local `impl` definition
LL | |         }
   | |_________^
   |
   = help: move this `impl` block outside the of the current function `main` and up 2 bodies
---
warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:105:9
   |
LL | /         impl Test {
LL | |         //~^ WARN non-local `impl` definition
LL | |             fn hoo() {}
   | |_________^
   |
   = help: move this `impl` block outside the of the current function `main` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:114:9
   |
LL | /         impl Test {
LL | |         //~^ WARN non-local `impl` definition
LL | |         }
   | |_________^
   |
   = help: move this `impl` block outside the of the current constant item `_` and up 2 bodies
   = help: move this `impl` block outside the of the current constant item `_` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:122:5
   |
LL | /     impl Display for Test {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `main`
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:129:5
   |
LL |     impl dyn Uto5 {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:132:5
   |
LL |     impl<T: Uto5> Uto5 for Vec<T> { }
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:135:5
   |
LL |     impl Uto5 for &dyn Uto5 {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:138:5
   |
LL |     impl Uto5 for *mut Test {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:141:5
   |
LL |     impl Uto5 for *mut [Test] {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:144:5
   |
LL |     impl Uto5 for [Test; 8] {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:147:5
   |
LL |     impl Uto5 for (Test,) {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:150:5
   |
LL |     impl Uto5 for fn(Test) -> () {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:153:5
   |
LL |     impl Uto5 for fn() -> Test {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:157:9
   |
LL |         impl Uto5 for Test {}
   |
   = help: move this `impl` block outside the of the current function `main` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:164:9
   |
LL |         impl Uto5 for &Test {}
   |
   = help: move this `impl` block outside the of the current type alias `A` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:171:9
   |
LL |         impl Uto5 for &(Test,) {}
   |
   = help: move this `impl` block outside the of the current function `a` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:178:9
   |
LL |         impl Uto5 for &(Test,Test) {}
   |
   = help: move this `impl` block outside the of the current function `b` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:186:5
   |
LL |     impl Uto5 for *mut InsideMain {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:188:5
   |
LL |     impl Uto5 for *mut [InsideMain] {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:190:5
   |
LL |     impl Uto5 for [InsideMain; 8] {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:192:5
   |
LL |     impl Uto5 for (InsideMain,) {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:194:5
   |
LL |     impl Uto5 for fn(InsideMain) -> () {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:196:5
   |
LL |     impl Uto5 for fn() -> InsideMain {}
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:210:9
   |
LL | /         impl Display for InsideMain {
LL | |         //~^ WARN non-local `impl` definition
LL | |             fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
LL | |                 todo!()
LL | |         }
   | |_________^
   |
   = help: move this `impl` block outside the of the current function `inside_inside` and up 2 bodies
   = help: move this `impl` block outside the of the current function `inside_inside` and up 2 bodies
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:217:9
   |
LL | /         impl InsideMain {
LL | |         //~^ WARN non-local `impl` definition
LL | |                 #[macro_export]
...  |
LL | |             }
LL | |         }
---

warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:221:17
   |
LL |                 macro_rules! m2 { () => { } };
   |
   |
   = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current impl item `bar` and up 3 bodies
   = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:231:5
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:231:5
   |
LL |     impl<T: Uto6> Uto3 for Vec<T> { }
   |
   = help: move this `impl` block outside the of the current function `main`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:240:5
   |
LL |     impl Uto7 for Test where Local: std::any::Any {}
   |
   = help: move this `impl` block outside the of the current function `bad`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:243:5
   |
LL |     impl<T> Uto8 for T {}
   |
   = help: move this `impl` block outside the of the current function `bad`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:252:5
   |
LL | /     impl Default for UwU<OwO> {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn default() -> Self {
LL | |             UwU(OwO)
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `fun`
   = help: move this `impl` block outside the of the current function `fun`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:263:5
   |
LL | /     impl From<Cat> for () {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn from(_: Cat) -> () {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   |
   = help: move this `impl` block outside the of the current function `meow`
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:272:5
   |
LL | /     impl AsRef<Cat> for () {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn as_ref(&self) -> &Cat { &Cat }
   | |_____^
   |
   |
   = help: move this `impl` block outside the of the current function `meow`
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:283:5
   |
LL | /     impl PartialEq<B> for G {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn eq(&self, _: &B) -> bool {
LL | |         }
LL | |     }
   | |_____^
   |
---

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:300:5
   |
LL | /     impl PartialEq<Dog> for &Dog {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn eq(&self, _: &Dog) -> bool {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `woof`
   = help: move this `impl` block outside the of the current function `woof`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:307:5
   |
LL | /     impl PartialEq<()> for Dog {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn eq(&self, _: &()) -> bool {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `woof`
   = help: move this `impl` block outside the of the current function `woof`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:314:5
   |
LL | /     impl PartialEq<()> for &Dog {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn eq(&self, _: &()) -> bool {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `woof`
   = help: move this `impl` block outside the of the current function `woof`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:321:5
   |
LL | /     impl PartialEq<Dog> for () {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn eq(&self, _: &Dog) -> bool {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `woof`
   = help: move this `impl` block outside the of the current function `woof`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:343:5
   |
LL | /     impl From<Wrap<Wrap<Lion>>> for () {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn from(_: Wrap<Wrap<Lion>>) -> Self {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `rawr`
   = help: move this `impl` block outside the of the current function `rawr`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:350:5
   |
LL | /     impl From<()> for Wrap<Lion> {
LL | |     //~^ WARN non-local `impl` definition
LL | |         fn from(_: ()) -> Self {
LL | |             todo!()
LL | |     }
   | |_____^
   |
   = help: move this `impl` block outside the of the current function `rawr`
---
   |
LL |             impl MacroTrait for OutsideStruct {}
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | m!();
   |
   |
   = help: move this `impl` block outside the of the current function `my_func`
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
   = note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)


warning: non-local `impl` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:373:1
   |
LL | non_local_macro::non_local_impl!(CargoUpdate);
   |
   = help: move this `impl` block outside the of the current constant item `_IMPL_DEBUG`
   = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
   = note: this warning originates in the macro `non_local_macro::non_local_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
##[warning]  --> /checkout/tests/ui/lint/non_local_definitions.rs:376:1
   |
LL | non_local_macro::non_local_macro_rules!(my_macro);
   |
   |
   = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current constant item `_MACRO_EXPORT`
   = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
   = note: this warning originates in the macro `non_local_macro::non_local_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 50 warnings emitted

@Urgau
Copy link
Member Author

Urgau commented Feb 29, 2024

Well #121625 (comment) puts an abrupt end in this quest, not that it was going somewhere1.

I will send a follow-up PR with some cleanups, improvements and tests for #121625 (comment).

Footnotes

  1. I was mislead by all the tools! I only managed to see today the callgrind and it's mostly the diagnostic machinery anyway.

@Urgau Urgau closed this Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

9 participants