Skip to content

port lint attributes - #162811

Open
mejrs wants to merge 4 commits into
rust-lang:mainfrom
mejrs:port_lint_check
Open

mejrs wants to merge 4 commits into
rust-lang:mainfrom
mejrs:port_lint_check

Conversation

@mejrs

@mejrs mejrs commented Sep 15, 2026

Copy link
Copy Markdown
Member

View all comments

Ports the lint attributes. I've kept this as small as possible, but there is a decent amount of clean up/refactoring that can be done afterwards,

r? @JonathanBrouwer @jdonszelmann
cc @Bryntet

@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 15, 2026
Comment on lines +10 to +11
LL | let y: u32 = (x?).try_into().unwrap();
| + +++++++++++++++++++++

@mejrs mejrs Sep 15, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Uh yeah I don't know what's happening here

View changes since the review

@JonathanBrouwer

Copy link
Copy Markdown
Member

I'll take a look at this on Friday! Thanks for doing this!

@Bryntet

Bryntet commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for picking this up ❤️

@JonathanBrouwer

Copy link
Copy Markdown
Member

cc @cjgillot @petrochenkov in case you'd like to take a look (as reviewers of the original pr #155691)

@mejrs

mejrs commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

I'll take a look at this on Friday! Thanks for doing this!

I'll go ahead and cherrypick some changes from this PR then, some things can be split off.

@petrochenkov petrochenkov self-assigned this Sep 15, 2026
#[allow()]
{ }
}
fn expr_block() { { } unsafe { } 'a: { } { } { } }

@mejrs mejrs Sep 15, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We drop these empty lint attributes, this is nice because when we query for the attribute we know it's non-empty and we can do things like lints.first().unwrap()

View changes since the review

@mejrs mejrs mentioned this pull request Sep 15, 2026
@JonathanBrouwer JonathanBrouwer added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Sep 15, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

Blocked on #162813

@rust-log-analyzer

This comment has been minimized.

@mejrs

mejrs commented Sep 15, 2026

Copy link
Copy Markdown
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 Sep 15, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 15, 2026
@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 837b948 (837b9481206c510936be02f4b200f8db8aae1286)
Base parent: 1936d44 (1936d44457352da43b2d740672b940ebc715ac38)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (837b948): comparison URL.

Overall result: ❌✅ regressions and improvements - BENCHMARK(S) FAILED

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • image-0.25.6
  • Job failure

❗ ❗ ❗ ❗ ❗

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.6% [0.2%, 3.5%] 197
Regressions ❌
(secondary)
0.9% [0.1%, 5.8%] 170
Improvements ✅
(primary)
-36.2% [-77.2%, -10.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-77.2%, 3.5%] 201

Max RSS (memory usage)

Results (primary -7.1%, secondary -1.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.6% [0.6%, 3.1%] 3
Regressions ❌
(secondary)
3.5% [2.4%, 4.1%] 3
Improvements ✅
(primary)
-20.2% [-22.6%, -17.8%] 2
Improvements ✅
(secondary)
-7.1% [-9.4%, -3.6%] 3
All ❌✅ (primary) -7.1% [-22.6%, 3.1%] 5

Cycles

Results (primary -7.6%, secondary 2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.0% [1.3%, 4.3%] 11
Regressions ❌
(secondary)
3.1% [2.0%, 5.2%] 16
Improvements ✅
(primary)
-36.8% [-77.7%, -10.0%] 4
Improvements ✅
(secondary)
-4.5% [-4.5%, -4.5%] 1
All ❌✅ (primary) -7.6% [-77.7%, 4.3%] 15

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 495.925s -> 496.275s (0.07%)
Artifact size: 406.90 MiB -> 407.07 MiB (0.04%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 15, 2026
@mejrs

mejrs commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

Perf run without attr_index/lint_index and simply using the position of the link within the LintCheck struct.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6091374 (6091374e5f097ca91586512a9ae4c835892d1bb3)
Base parent: 36b04f3 (36b04f3ad12a98b1a3cf9efe5313306ef7d5848d)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6091374): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.6% [0.1%, 3.4%] 190
Regressions ❌
(secondary)
1.0% [0.1%, 6.0%] 149
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) 0.6% [0.1%, 3.4%] 190

Max RSS (memory usage)

Results (primary -2.4%, secondary -2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-2.4% [-3.0%, -1.3%] 3
Improvements ✅
(secondary)
-3.1% [-5.2%, -0.4%] 4
All ❌✅ (primary) -2.4% [-3.0%, -1.3%] 3

Cycles

Results (primary 3.4%, secondary 3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.4% [1.7%, 5.0%] 7
Regressions ❌
(secondary)
3.6% [2.0%, 5.4%] 18
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [1.7%, 5.0%] 7

Binary size

Results (primary -0.1%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 70
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 53
All ❌✅ (primary) -0.1% [-0.2%, -0.0%] 70

Bootstrap: 497.193s -> 499.023s (0.37%)
Artifact size: 408.84 MiB -> 408.82 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 19, 2026
@mejrs

mejrs commented Sep 19, 2026

Copy link
Copy Markdown
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 Sep 19, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4b49dca (4b49dca8eb42071c8cc3df24e58dedfe791172a8)
Base parent: feaadee (feaadeeaca7db0594da854e7c8c07495341c7439)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4b49dca): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.1%, 0.4%] 15
Regressions ❌
(secondary)
0.4% [0.2%, 1.0%] 27
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 4
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.2%] 7
All ❌✅ (primary) 0.2% [-0.3%, 0.4%] 19

Max RSS (memory usage)

Results (primary -1.1%, secondary -2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-3.9% [-3.9%, -3.9%] 1
Improvements ✅
(secondary)
-3.6% [-5.0%, -1.1%] 3
All ❌✅ (primary) -1.1% [-3.9%, 1.7%] 2

Cycles

Results (secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 502.551s -> 499.436s (-0.62%)
Artifact size: 406.86 MiB -> 408.95 MiB (0.51%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 19, 2026
@mejrs

mejrs commented Sep 19, 2026

Copy link
Copy Markdown
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 Sep 19, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [pretty] tests/pretty/custom-test-runner.rs ... ok
test [pretty] tests/pretty/block-disambig.rs ... ok
test [pretty] tests/pretty/closure-reform-pretty.rs ... ok
test [pretty] tests/pretty/delegation/impl-reuse.rs ... ok
2026-09-19T23:23:33.711271Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:generics.pp\n\n\nmod free_to_trait {\n    trait Trait<'a, XX, Y, T = (), const N: usize = 2> {\n        fn method<A, B>(&self, t: (T, A, B), slice: &'_ [usize; N]) { }\n        fn r#static<A, B>(t: (T, A, B), slice: &'_ [usize; N]) { }\n    }\n\n    struct X;\n    impl <XX, Y, T, const N: usize> Trait<'_, XX, Y, T, N> for X { }\n\n    // When infer is specified for default parameter the generic param is generated.\n    #[attr = Inline(Hint)]\n    fn foo<'a, Self, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _)\n        -> _ where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo<'a, Self, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _\n        where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)\n    }\n\n    // When default params are omitted they are not generated but used in signature inheritance.\n    #[attr = Inline(Hint)]\n    fn bar<'a, Self, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_bar<'a, Self, XX, Y, A, B>(arg0: _, arg1: _) -> _ where\n        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }\n\n    // Check with user specified args in child:\n    // When infer is specified for default parameter the generic param is generated.\n    #[attr = Inline(Hint)]\n    fn foo1<'a, Self, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _\n        where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo1<'a, Self, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _\n        where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)\n    }\n\n    // When default params are omitted they are not generated but used in signature inheritance.\n    #[attr = Inline(Hint)]\n    fn bar1<'a, Self, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_bar1<'a, Self, XX, Y, A>(arg0: _, arg1: _) -> _ where\n        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }\n\n    // Check with explicit self type.\n    #[attr = Inline(Hint)]\n    fn foo2<'a, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _) -> _\n        where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo2<'a, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _\n        where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)\n    }\n\n    #[attr = Inline(Hint)]\n    fn bar2<'a, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2) }\n    #[attr = Inline(Hint)]\n    fn static_bar2<'a, XX, Y, A, B>(arg0: _, arg1: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }\n\n    #[attr = Inline(Hint)]\n    fn foo3<'a, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo3<'a, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _ where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)\n    }\n\n    #[attr = Inline(Hint)]\n    fn bar3<'a, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2) }\n    #[attr = Inline(Hint)]\n    fn static_bar3<'a, XX, Y, A>(arg0: _, arg1: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }\n}\n\nmod trait_impl_to_trait {\n    trait Trait<'a, X, Y, T = (), const N: usize = 2> {\n        fn foo(&self, t: (T, T, T), slice: &'_ [usize; N]) { }\n        fn bar(&self, t: (T, T, T), slice: &'_ [usize; N]) { }\n    }\n\n    struct S;\n    impl <X, Y> Trait<'_, X, Y> for S { }\n\n    struct W(S);\n    impl <X, Y> Trait<'_, X, Y> for W {\n        // Generics of both methods match generics of their signature\n        // functions in `Trait` declaration, no matter specified infers.\n        #[attr = Inline(Hint)]\n        fn foo(self: _, arg1: _, arg2: _)\n            -> _ { Trait::<'static, X, Y>::foo(self.0, arg1, arg2) }\n        #[attr = Inline(Hint)]\n        fn bar(self: _, arg1: _, arg2: _)\n            -> _ { Trait::<'static, X, Y, _, _>::foo(self.0, arg1, arg2) }\n    }\n}\n\nfn main() { }\n\n------------------------------------------\nactual:\n------------------------------------------\n#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\nkind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:generics.pp\n\n\nmod free_to_trait {\n    trait Trait<'a, XX, Y, T = (), const N: usize = 2> {\n        fn method<A, B>(&self, t: (T, A, B), slice: &'_ [usize; N]) { }\n        fn r#static<A, B>(t: (T, A, B), slice: &'_ [usize; N]) { }\n    }\n\n    struct X;\n    impl <XX, Y, T, const N: usize> Trait<'_, XX, Y, T, N> for X { }\n\n    // When infer is specified for default parameter the generic param is generated.\n    #[attr = Inline(Hint)]\n    fn foo<'a, Self, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _)\n        -> _ where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo<'a, Self, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _\n        where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)\n    }\n\n    // When default params are omitted they are not generated but used in signature inheritance.\n    #[attr = Inline(Hint)]\n    fn bar<'a, Self, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_bar<'a, Self, XX, Y, A, B>(arg0: _, arg1: _) -> _ where\n        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }\n\n    // Check with user specified args in child:\n    // When infer is specified for default parameter the generic param is generated.\n    #[attr = Inline(Hint)]\n    fn foo1<'a, Self, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _\n        where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo1<'a, Self, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _\n        where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)\n    }\n\n    // When default params are omitted they are not generated but used in signature inheritance.\n    #[attr = Inline(Hint)]\n    fn bar1<'a, Self, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a {\n        <Self as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_bar1<'a, Self, XX, Y, A>(arg0: _, arg1: _) -> _ where\n        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }\n\n    // Check with explicit self type.\n    #[attr = Inline(Hint)]\n    fn foo2<'a, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _) -> _\n        where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo2<'a, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _\n        where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)\n    }\n\n    #[attr = Inline(Hint)]\n    fn bar2<'a, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2) }\n    #[attr = Inline(Hint)]\n    fn static_bar2<'a, XX, Y, A, B>(arg0: _, arg1: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }\n\n    #[attr = Inline(Hint)]\n    fn foo3<'a, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)\n    }\n    #[attr = Inline(Hint)]\n    fn static_foo3<'a, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _ where\n        'a:'a {\n        <X as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)\n    }\n\n    #[attr = Inline(Hint)]\n    fn bar3<'a, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2) }\n    #[attr = Inline(Hint)]\n    fn static_bar3<'a, XX, Y, A>(arg0: _, arg1: _) -> _ where\n        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }\n}\n\nmod trait_impl_to_trait {\n    trait Trait<'a, X, Y, T = (), const N: usize = 2> {\n        fn foo(&self, t: (T, T, T), slice: &'_ [usize; N]) { }\n        fn bar(&self, t: (T, T, T), slice: &'_ [usize; N]) { }\n    }\n\n    struct S;\n    impl <X, Y> Trait<'_, X, Y> for S { }\n\n    struct W(S);\n    impl <X, Y> Trait<'_, X, Y> for W {\n        // Generics of both methods match generics of their signature\n        // functions in `Trait` declaration, no matter specified infers.\n        #[attr = Inline(Hint)]\n        fn foo(self: _, arg1: _, arg2: _)\n            -> _ { Trait::<'static, X, Y>::foo(self.0, arg1, arg2) }\n        #[attr = Inline(Hint)]\n        fn bar(self: _, arg1: _, arg2: _)\n            -> _ { Trait::<'static, X, Y, _, _>::foo(self.0, arg1, arg2) }\n    }\n}\n\nfn main() { }\n\n------------------------------------------\ndiff:\n------------------------------------------\n-\t#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n+\t#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\n+\tkind: Allow}])]\n2\t#![attr = Feature([fn_delegation#0])]\n3\textern crate std;\n4\t#[attr = PreludeImport]\n\n\n"
test [pretty] tests/pretty/delegation/generics.rs ... FAILED
test [pretty] tests/pretty/delegation/delegation.rs ... ok
2026-09-19T23:23:33.749894Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:inline-attribute.pp\n\n\nmod to_reuse {\n    fn foo(x: usize) -> usize { x }\n}\n\n// Check that #[inline(hint)] is added to foo reuse\n#[attr = Inline(Hint)]\nfn bar(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\ntrait Trait {\n    fn foo(&self) { }\n    fn foo1(&self) { }\n    fn foo2(&self) { }\n    fn foo3(&self) { }\n    fn foo4(&self) { }\n}\n\nimpl Trait for u8 { }\n\nstruct S(u8);\n\nmod to_import {\n    fn check(arg: &'_ u8) -> &'_ u8 { arg }\n}\n\nimpl Trait for S {\n    // Check that #[inline(hint)] is added to foo reuse\n    #[attr = Inline(Hint)]\n    fn foo(self: _)\n        ->\n            _ {\n        // Check that #[inline(hint)] is added to foo0 reuse inside another reuse\n        #[attr = Inline(Hint)]\n        fn foo0(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\n        // Check that #[inline(hint)] is added when other attributes present in inner reuse\n        #[attr = Cold]\n        #[attr = MustUse]\n        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n        #[attr = Inline(Hint)]\n        fn foo1(arg0: _) -> _ { to_reuse::foo(self / 2) }\n\n        // Check that #[inline(never)] is preserved in inner reuse\n        #[attr = Inline(Never)]\n        fn foo2(arg0: _) -> _ { to_reuse::foo(self / 2) }\n\n        // Check that #[inline(always)] is preserved in inner reuse\n        #[attr = Inline(Always)]\n        fn foo3(arg0: _) -> _ { to_reuse::foo(self / 2) }\n\n        // Check that #[inline(never)] is preserved when there are other attributes in inner reuse\n        #[attr = Cold]\n        #[attr = MustUse]\n        #[attr = Inline(Never)]\n        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n        fn foo4(arg0: _) -> _ { to_reuse::foo(self / 2) }\n        Trait::foo(self)\n    }\n\n    // Check that #[inline(hint)] is added when there are other attributes present in trait reuse\n    #[attr = Cold]\n    #[attr = MustUse]\n    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n    #[attr = Inline(Hint)]\n    fn foo1(self: _) -> _ { Trait::foo1(self.0) }\n\n    // Check that #[inline(never)] is preserved in trait reuse\n    #[attr = Inline(Never)]\n    fn foo2(self: _) -> _ { Trait::foo2(self.0) }\n\n    // Check that #[inline(always)] is preserved in trait reuse\n    #[attr = Inline(Always)]\n    fn foo3(self: _) -> _ { Trait::foo3(self.0) }\n\n    // Check that #[inline(never)] is preserved when there are other attributes in trait reuse\n    #[attr = Cold]\n    #[attr = MustUse]\n    #[attr = Inline(Never)]\n    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n    fn foo4(self: _) -> _ { Trait::foo4(self.0) }\n}\n\nfn main() { }\n\n------------------------------------------\nactual:\n------------------------------------------\n#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\nkind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:inline-attribute.pp\n\n\nmod to_reuse {\n    fn foo(x: usize) -> usize { x }\n}\n\n// Check that #[inline(hint)] is added to foo reuse\n#[attr = Inline(Hint)]\nfn bar(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\ntrait Trait {\n    fn foo(&self) { }\n    fn foo1(&self) { }\n    fn foo2(&self) { }\n    fn foo3(&self) { }\n    fn foo4(&self) { }\n}\n\nimpl Trait for u8 { }\n\nstruct S(u8);\n\nmod to_import {\n    fn check(arg: &'_ u8) -> &'_ u8 { arg }\n}\n\nimpl Trait for S {\n    // Check that #[inline(hint)] is added to foo reuse\n    #[attr = Inline(Hint)]\n    fn foo(self: _)\n        ->\n            _ {\n        // Check that #[inline(hint)] is added to foo0 reuse inside another reuse\n        #[attr = Inline(Hint)]\n        fn foo0(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\n        // Check that #[inline(hint)] is added when other attributes present in inner reuse\n        #[attr = Cold]\n        #[attr = MustUse]\n        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n        #[attr = Inline(Hint)]\n        fn foo1(arg0: _) -> _ { to_reuse::foo(self / 2) }\n\n        // Check that #[inline(never)] is preserved in inner reuse\n        #[attr = Inline(Never)]\n        fn foo2(arg0: _) -> _ { to_reuse::foo(self / 2) }\n\n        // Check that #[inline(always)] is preserved in inner reuse\n        #[attr = Inline(Always)]\n        fn foo3(arg0: _) -> _ { to_reuse::foo(self / 2) }\n\n        // Check that #[inline(never)] is preserved when there are other attributes in inner reuse\n        #[attr = Cold]\n        #[attr = MustUse]\n        #[attr = Inline(Never)]\n        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n        fn foo4(arg0: _) -> _ { to_reuse::foo(self / 2) }\n        Trait::foo(self)\n    }\n\n    // Check that #[inline(hint)] is added when there are other attributes present in trait reuse\n    #[attr = Cold]\n    #[attr = MustUse]\n    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n    #[attr = Inline(Hint)]\n    fn foo1(self: _) -> _ { Trait::foo1(self.0) }\n\n    // Check that #[inline(never)] is preserved in trait reuse\n    #[attr = Inline(Never)]\n    fn foo2(self: _) -> _ { Trait::foo2(self.0) }\n\n    // Check that #[inline(always)] is preserved in trait reuse\n    #[attr = Inline(Always)]\n    fn foo3(self: _) -> _ { Trait::foo3(self.0) }\n\n    // Check that #[inline(never)] is preserved when there are other attributes in trait reuse\n    #[attr = Cold]\n    #[attr = MustUse]\n    #[attr = Inline(Never)]\n    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n    fn foo4(self: _) -> _ { Trait::foo4(self.0) }\n}\n\nfn main() { }\n\n------------------------------------------\ndiff:\n------------------------------------------\n-\t#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n+\t#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\n+\tkind: Allow}])]\n2\t#![attr = Feature([fn_delegation#0])]\n3\textern crate std;\n4\t#[attr = PreludeImport]\n\n\n"
test [pretty] tests/pretty/delegation/inline-attribute.rs ... FAILED
test [pretty] tests/pretty/delegation/self-mapping-output.rs ... ok
test [pretty] tests/pretty/delegation/self-rename.rs ... ok
2026-09-19T23:23:33.790943Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse std::prelude::rust_2021::*;\n//@ edition:2021\n//@ aux-crate:to_reuse_functions=to-reuse-functions.rs\n//@ pretty-mode:hir\n//@ pretty-compare-only\n//@ pp-exact:inherit-attributes.pp\n\n\nextern crate to_reuse_functions;\n\nmod to_reuse {\n    #[attr = MustUse {reason: \"foo: some reason\"}]\n    #[attr = Cold]\n    fn foo(x: usize) -> usize { x }\n\n    #[attr = MustUse]\n    #[attr = Cold]\n    fn foo_no_reason(x: usize) -> usize { x }\n\n    #[attr = Cold]\n    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n    fn bar(x: usize) -> usize { x }\n}\n\n#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n#[attr = MustUse {reason: \"foo: some reason\"}]\n#[attr = Inline(Hint)]\nfn foo1(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\n#[attr = MustUse]\n#[attr = Inline(Hint)]\nfn foo_no_reason(arg0: _) -> _ { to_reuse::foo_no_reason(self + 1) }\n\n#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n#[attr = MustUse {reason: \"some reason\"}]\n#[attr = Inline(Hint)]\nfn foo2(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\n#[attr = Inline(Hint)]\nfn bar(arg0: _) -> _ { to_reuse::bar(arg0) }\n\n#[attr = MustUse]\n#[attr = Inline(Hint)]\nunsafe fn unsafe_fn_extern() -> _ { to_reuse_functions::unsafe_fn_extern() }\n#[attr = MustUse {reason: \"extern_fn_extern: some reason\"}]\n#[attr = Inline(Hint)]\nextern \"C\" fn extern_fn_extern()\n    -> _ { to_reuse_functions::extern_fn_extern() }\n#[attr = Inline(Hint)]\nconst fn const_fn_extern() -> _ { to_reuse_functions::const_fn_extern() }\n#[attr = MustUse {reason: \"some reason\"}]\n#[attr = Inline(Hint)]\nasync fn async_fn_extern() -> _ { to_reuse_functions::async_fn_extern() }\n\nmod recursive {\n    // Check that `baz` inherit attribute from `foo`\n    mod first {\n        fn bar() { }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo() -> _ { bar() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn baz() -> _ { foo() }\n    }\n\n    // Check that `baz` inherit attribute from `bar`\n    mod second {\n        #[attr = MustUse {reason: \"some reason\"}]\n        fn bar() { }\n\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo() -> _ { bar() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn baz() -> _ { foo() }\n    }\n\n    // Check that `foo5` don't inherit attribute from `bar`\n    // and inherit attribute from foo4, check that foo1, foo2 and foo3\n    // inherit attribute from bar\n    mod third {\n        #[attr = MustUse {reason: \"some reason\"}]\n        fn bar() { }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo1() -> _ { bar() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo2() -> _ { foo1() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo3() -> _ { foo2() }\n        #[attr = MustUse {reason: \"foo4\"}]\n        #[attr = Inline(Hint)]\n        fn foo4() -> _ { foo3() }\n        #[attr = MustUse {reason: \"foo4\"}]\n        #[attr = Inline(Hint)]\n        fn foo5() -> _ { foo4() }\n    }\n\n    mod fourth {\n        trait T {\n            fn foo(&self, x: usize) -> usize { x + 1 }\n        }\n\n        struct X;\n        impl T for X { }\n\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo(self: _, arg1: _) -> _ { <X as T>::foo(self + 1, arg1) }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn bar(arg0: _, arg1: _) -> _ { foo(self + 1, arg1) }\n    }\n}\n\nfn main() { }\n\n------------------------------------------\nactual:\n------------------------------------------\n#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\nkind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse std::prelude::rust_2021::*;\n//@ edition:2021\n//@ aux-crate:to_reuse_functions=to-reuse-functions.rs\n//@ pretty-mode:hir\n//@ pretty-compare-only\n//@ pp-exact:inherit-attributes.pp\n\n\nextern crate to_reuse_functions;\n\nmod to_reuse {\n    #[attr = MustUse {reason: \"foo: some reason\"}]\n    #[attr = Cold]\n    fn foo(x: usize) -> usize { x }\n\n    #[attr = MustUse]\n    #[attr = Cold]\n    fn foo_no_reason(x: usize) -> usize { x }\n\n    #[attr = Cold]\n    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n    fn bar(x: usize) -> usize { x }\n}\n\n#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n#[attr = MustUse {reason: \"foo: some reason\"}]\n#[attr = Inline(Hint)]\nfn foo1(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\n#[attr = MustUse]\n#[attr = Inline(Hint)]\nfn foo_no_reason(arg0: _) -> _ { to_reuse::foo_no_reason(self + 1) }\n\n#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]\n#[attr = MustUse {reason: \"some reason\"}]\n#[attr = Inline(Hint)]\nfn foo2(arg0: _) -> _ { to_reuse::foo(self + 1) }\n\n#[attr = Inline(Hint)]\nfn bar(arg0: _) -> _ { to_reuse::bar(arg0) }\n\n#[attr = MustUse]\n#[attr = Inline(Hint)]\nunsafe fn unsafe_fn_extern() -> _ { to_reuse_functions::unsafe_fn_extern() }\n#[attr = MustUse {reason: \"extern_fn_extern: some reason\"}]\n#[attr = Inline(Hint)]\nextern \"C\" fn extern_fn_extern()\n    -> _ { to_reuse_functions::extern_fn_extern() }\n#[attr = Inline(Hint)]\nconst fn const_fn_extern() -> _ { to_reuse_functions::const_fn_extern() }\n#[attr = MustUse {reason: \"some reason\"}]\n#[attr = Inline(Hint)]\nasync fn async_fn_extern() -> _ { to_reuse_functions::async_fn_extern() }\n\nmod recursive {\n    // Check that `baz` inherit attribute from `foo`\n    mod first {\n        fn bar() { }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo() -> _ { bar() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn baz() -> _ { foo() }\n    }\n\n    // Check that `baz` inherit attribute from `bar`\n    mod second {\n        #[attr = MustUse {reason: \"some reason\"}]\n        fn bar() { }\n\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo() -> _ { bar() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn baz() -> _ { foo() }\n    }\n\n    // Check that `foo5` don't inherit attribute from `bar`\n    // and inherit attribute from foo4, check that foo1, foo2 and foo3\n    // inherit attribute from bar\n    mod third {\n        #[attr = MustUse {reason: \"some reason\"}]\n        fn bar() { }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo1() -> _ { bar() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo2() -> _ { foo1() }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo3() -> _ { foo2() }\n        #[attr = MustUse {reason: \"foo4\"}]\n        #[attr = Inline(Hint)]\n        fn foo4() -> _ { foo3() }\n        #[attr = MustUse {reason: \"foo4\"}]\n        #[attr = Inline(Hint)]\n        fn foo5() -> _ { foo4() }\n    }\n\n    mod fourth {\n        trait T {\n            fn foo(&self, x: usize) -> usize { x + 1 }\n        }\n\n        struct X;\n        impl T for X { }\n\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn foo(self: _, arg1: _) -> _ { <X as T>::foo(self + 1, arg1) }\n        #[attr = MustUse {reason: \"some reason\"}]\n        #[attr = Inline(Hint)]\n        fn bar(arg0: _, arg1: _) -> _ { foo(self + 1, arg1) }\n    }\n}\n\nfn main() { }\n\n------------------------------------------\ndiff:\n------------------------------------------\n-\t#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n+\t#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\n+\tkind: Allow}])]\n2\t#![attr = Feature([fn_delegation#0])]\n3\textern crate std;\n4\t#[attr = PreludeImport]\n\n\n"
test [pretty] tests/pretty/delegation/inherit-attributes.rs ... FAILED
test [pretty] tests/pretty/delimited-token-groups.rs ... ok
test [pretty] tests/pretty/direct-const-arg.rs ... ok
test [pretty] tests/pretty/disamb-stmt-expr.rs ... ok
test [pretty] tests/pretty/dollar-crate.rs ... ok
---
test [pretty] tests/pretty/fn-types.rs ... ok
test [pretty] tests/pretty/fn-variadic.rs ... ok
test [pretty] tests/pretty/float-trailing-dot.rs ... ok
test [pretty] tests/pretty/format-args-str-escape.rs ... ok
2026-09-19T23:23:34.056150Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:hir-delegation.pp\n\n\nfn b<C>(e: C) { }\n\ntrait G {\n    #[attr = Inline(Hint)]\n    fn b<C>(arg0: _) -> _ { b::<C>(arg0) }\n}\n\nmod m {\n    fn add(a: u32, b: u32) -> u32 { a + b }\n}\n\n#[attr = Inline(Hint)]\nfn add(arg0: _, arg1: _) -> _ { m::add(arg0, arg1) }\n\nfn main() { { let _ = add(1, 2); }; }\n\n------------------------------------------\nactual:\n------------------------------------------\n#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\nkind: Allow}])]\n#![attr = Feature([fn_delegation#0])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:hir-delegation.pp\n\n\nfn b<C>(e: C) { }\n\ntrait G {\n    #[attr = Inline(Hint)]\n    fn b<C>(arg0: _) -> _ { b::<C>(arg0) }\n}\n\nmod m {\n    fn add(a: u32, b: u32) -> u32 { a + b }\n}\n\n#[attr = Inline(Hint)]\nfn add(arg0: _, arg1: _) -> _ { m::add(arg0, arg1) }\n\nfn main() { { let _ = add(1, 2); }; }\n\n------------------------------------------\ndiff:\n------------------------------------------\n-\t#![attr = LintCheck([LintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n+\t#![attr = LintCheck([LintCheck {lint_name: \"incomplete_features\",\n+\tkind: Allow}])]\n2\t#![attr = Feature([fn_delegation#0])]\n3\textern crate std;\n4\t#[attr = PreludeImport]\n\n\n"
test [pretty] tests/pretty/hir-delegation.rs ... FAILED
test [pretty] tests/pretty/gat-bounds.rs ... ok
test [pretty] tests/pretty/for-comment.rs ... ok
test [pretty] tests/pretty/hir-fn-params.rs ... ok
test [pretty] tests/pretty/hir-fn-variadic.rs ... ok
test [pretty] tests/pretty/hir-if-else.rs ... ok
test [pretty] tests/pretty/hir-impl-restriction.rs ... ok
2026-09-19T23:23:34.096969Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#![attr = LintCheck([LintCheck {name: [\"unused\"], kind: Allow}])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:hir-lifetimes.pp\n\n// This tests the pretty-printing of lifetimes in lots of ways.\n\n\nstruct Foo<'a> {\n    x: &'a u32,\n}\n\nimpl <'a> Foo<'a> {\n    fn f<'b>(x: &'b u32) { }\n}\n\nimpl  Foo<'_> {\n    fn a(x: &'_ u32) { }\n\n    fn b(x: &'_ u32) { }\n\n    fn c(x: &'_ u32, y: &'static u32) { }\n\n    // FIXME: `'a` before `self` is omitted\n    fn d<'a>(&self, x: &'a u32) { }\n\n    // FIXME: impl Traits printed as just `/*impl Trait*/`, ugh\n    fn iter1<'a>(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }\n\n    fn iter2(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }\n}\n\nfn a(x: Foo<'_>) { }\n\nfn b<'a>(x: Foo<'a>) { }\n\nstruct Bar<'a, 'b, 'c, T> {\n    x: &'a u32,\n    y: &'b &'c u32,\n    z: T,\n}\n\nfn f1<'a, 'b, T>(x: Bar<'a, 'b, '_, T>) { }\n\nfn f2(x: Bar<'_, '_, '_, u32>) { }\n\ntrait MyTrait<'a, 'b> {\n    fn f(&self, x: Foo<'a>, y: Foo<'b>);\n}\n\nimpl <'a, 'b, 'c, T> MyTrait<'a, 'b> for Bar<'a, 'b, 'c, T> {\n    fn f(&self, x: Foo<'a>, y: Foo<'b>) { }\n}\n\nfn g(x: &'_ dyn for<'a, 'b> MyTrait<'a, 'b>) { }\n\ntrait Blah { }\n\ntype T<'a> = dyn Blah + 'a;\n\ntype Q<'a> = dyn MyTrait<'a, 'a> + 'a;\n\nfn h<'b, F>(f: F, y: Foo<'b>) where F: for<'d> MyTrait<'d, 'b> { }\n\n// FIXME(?): attr printing is weird\n#[attr = Repr {reprs: [ReprC]}]\nstruct S<'a>(&'a u32);\n\nextern \"C\" {\n    unsafe fn g1(s: S<'_>);\n    unsafe fn g2(s: S<'_>);\n    unsafe fn g3<'a>(s: S<'a>);\n}\n\nstruct St<'a> {\n    x: &'a u32,\n}\n\nfn f() { { let _ = St { x: &0 }; }; { let _ = St { x: &0 }; }; }\n\nstruct Name<'a>(&'a str);\n\nconst A: Name<'_> = Name(\"a\");\nconst B: &'_ str = \"\";\nstatic C: &'_ str = \"\";\nstatic D: &'static str = \"\";\n\nfn tr(_: Box<dyn Blah>) { }\n\nfn main() { }\n\n------------------------------------------\nactual:\n------------------------------------------\n#![attr = LintCheck([LintCheck {lint_name: \"unused\", kind: Allow}])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:hir-lifetimes.pp\n\n// This tests the pretty-printing of lifetimes in lots of ways.\n\n\nstruct Foo<'a> {\n    x: &'a u32,\n}\n\nimpl <'a> Foo<'a> {\n    fn f<'b>(x: &'b u32) { }\n}\n\nimpl  Foo<'_> {\n    fn a(x: &'_ u32) { }\n\n    fn b(x: &'_ u32) { }\n\n    fn c(x: &'_ u32, y: &'static u32) { }\n\n    // FIXME: `'a` before `self` is omitted\n    fn d<'a>(&self, x: &'a u32) { }\n\n    // FIXME: impl Traits printed as just `/*impl Trait*/`, ugh\n    fn iter1<'a>(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }\n\n    fn iter2(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }\n}\n\nfn a(x: Foo<'_>) { }\n\nfn b<'a>(x: Foo<'a>) { }\n\nstruct Bar<'a, 'b, 'c, T> {\n    x: &'a u32,\n    y: &'b &'c u32,\n    z: T,\n}\n\nfn f1<'a, 'b, T>(x: Bar<'a, 'b, '_, T>) { }\n\nfn f2(x: Bar<'_, '_, '_, u32>) { }\n\ntrait MyTrait<'a, 'b> {\n    fn f(&self, x: Foo<'a>, y: Foo<'b>);\n}\n\nimpl <'a, 'b, 'c, T> MyTrait<'a, 'b> for Bar<'a, 'b, 'c, T> {\n    fn f(&self, x: Foo<'a>, y: Foo<'b>) { }\n}\n\nfn g(x: &'_ dyn for<'a, 'b> MyTrait<'a, 'b>) { }\n\ntrait Blah { }\n\ntype T<'a> = dyn Blah + 'a;\n\ntype Q<'a> = dyn MyTrait<'a, 'a> + 'a;\n\nfn h<'b, F>(f: F, y: Foo<'b>) where F: for<'d> MyTrait<'d, 'b> { }\n\n// FIXME(?): attr printing is weird\n#[attr = Repr {reprs: [ReprC]}]\nstruct S<'a>(&'a u32);\n\nextern \"C\" {\n    unsafe fn g1(s: S<'_>);\n    unsafe fn g2(s: S<'_>);\n    unsafe fn g3<'a>(s: S<'a>);\n}\n\nstruct St<'a> {\n    x: &'a u32,\n}\n\nfn f() { { let _ = St { x: &0 }; }; { let _ = St { x: &0 }; }; }\n\nstruct Name<'a>(&'a str);\n\nconst A: Name<'_> = Name(\"a\");\nconst B: &'_ str = \"\";\nstatic C: &'_ str = \"\";\nstatic D: &'static str = \"\";\n\nfn tr(_: Box<dyn Blah>) { }\n\nfn main() { }\n\n------------------------------------------\ndiff:\n------------------------------------------\n-\t#![attr = LintCheck([LintCheck {name: [\"unused\"], kind: Allow}])]\n+\t#![attr = LintCheck([LintCheck {lint_name: \"unused\", kind: Allow}])]\n2\textern crate std;\n3\t#[attr = PreludeImport]\n4\tuse ::std::prelude::rust_2015::*;\n\n\n"
test [pretty] tests/pretty/hir-lifetimes.rs ... FAILED
test [pretty] tests/pretty/hir-mut-restriction.rs ... ok
test [pretty] tests/pretty/hir-pretty-attr.rs ... ok
test [pretty] tests/pretty/hir-pretty-loop.rs ... ok
test [pretty] tests/pretty/hir-struct-expr.rs ... ok
---
test [pretty] tests/pretty/offload/offload_kernel.rs#device ... ok
test [pretty] tests/pretty/offload/offload_kernel.rs#host ... ok
test [pretty] tests/pretty/or-pattern-paren.rs ... ok
test [pretty] tests/pretty/offset_of.rs ... ok
2026-09-19T23:23:34.425811Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#![attr = Feature([pin_ergonomics#0])]\n#![attr = LintCheck([LintCheck {name: [\"dead_code\"], kind: Allow},\nLintCheck {name: [\"incomplete_features\"], kind: Allow}])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:pin-ergonomics-hir.pp\n\n\nuse std::pin::Pin;\n\nstruct Foo;\n\nimpl Foo {\n    fn baz(&mut self) { }\n\n    fn baz_const(&self) { }\n\n    fn baz_lt<'a>(&mut self) { }\n\n    fn baz_const_lt(&self) { }\n}\n\nfn foo(_: Pin<&'_ mut Foo>) { }\nfn foo_lt<'a>(_: Pin<&'a mut Foo>) { }\n\nfn foo_const(_: Pin<&'_ Foo>) { }\nfn foo_const_lt(_: Pin<&'_ Foo>) { }\n\nfn bar() {\n    let mut x: Pin<&mut _> = &pin mut Foo;\n    foo(x.as_mut());\n    foo(x.as_mut());\n    foo_const(x);\n\n    let x: Pin<&_> = &pin const Foo;\n\n    foo_const(x);\n    foo_const(x);\n}\n\nfn patterns<'a>(&pin mut x: Pin<&'_ mut i32>, &pin const y: Pin<&'a i32>,\n    ref pin mut z: i32, ref pin const w: i32) { }\n\nfn main() { }\n\n------------------------------------------\nactual:\n------------------------------------------\n#![attr = Feature([pin_ergonomics#0])]\n#![attr = LintCheck([LintCheck {lint_name: \"dead_code\", kind: Allow},\nLintCheck {lint_name: \"incomplete_features\", kind: Allow}])]\nextern crate std;\n#[attr = PreludeImport]\nuse ::std::prelude::rust_2015::*;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:pin-ergonomics-hir.pp\n\n\nuse std::pin::Pin;\n\nstruct Foo;\n\nimpl Foo {\n    fn baz(&mut self) { }\n\n    fn baz_const(&self) { }\n\n    fn baz_lt<'a>(&mut self) { }\n\n    fn baz_const_lt(&self) { }\n}\n\nfn foo(_: Pin<&'_ mut Foo>) { }\nfn foo_lt<'a>(_: Pin<&'a mut Foo>) { }\n\nfn foo_const(_: Pin<&'_ Foo>) { }\nfn foo_const_lt(_: Pin<&'_ Foo>) { }\n\nfn bar() {\n    let mut x: Pin<&mut _> = &pin mut Foo;\n    foo(x.as_mut());\n    foo(x.as_mut());\n    foo_const(x);\n\n    let x: Pin<&_> = &pin const Foo;\n\n    foo_const(x);\n    foo_const(x);\n}\n\nfn patterns<'a>(&pin mut x: Pin<&'_ mut i32>, &pin const y: Pin<&'a i32>,\n    ref pin mut z: i32, ref pin const w: i32) { }\n\nfn main() { }\n\n------------------------------------------\ndiff:\n------------------------------------------\n1\t#![attr = Feature([pin_ergonomics#0])]\n-\t#![attr = LintCheck([LintCheck {name: [\"dead_code\"], kind: Allow},\n-\tLintCheck {name: [\"incomplete_features\"], kind: Allow}])]\n+\t#![attr = LintCheck([LintCheck {lint_name: \"dead_code\", kind: Allow},\n+\tLintCheck {lint_name: \"incomplete_features\", kind: Allow}])]\n4\textern crate std;\n5\t#[attr = PreludeImport]\n6\tuse ::std::prelude::rust_2015::*;\n\n\n"
test [pretty] tests/pretty/pin-ergonomics-hir.rs ... FAILED
test [pretty] tests/pretty/paren-trait-bound.rs ... ok
test [pretty] tests/pretty/path-type-bounds.rs ... ok
test [pretty] tests/pretty/pin-ergonomics.rs ... ok
test [pretty] tests/pretty/postfix-match/precedence.rs ... ok
---

error: pretty-printed source does not match expected source
expected:
------------------------------------------
#![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:generics.pp


mod free_to_trait {
    trait Trait<'a, XX, Y, T = (), const N: usize = 2> {
        fn method<A, B>(&self, t: (T, A, B), slice: &'_ [usize; N]) { }
        fn r#static<A, B>(t: (T, A, B), slice: &'_ [usize; N]) { }
    }

    struct X;
    impl <XX, Y, T, const N: usize> Trait<'_, XX, Y, T, N> for X { }

    // When infer is specified for default parameter the generic param is generated.
    #[attr = Inline(Hint)]
    fn foo<'a, Self, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _)
        -> _ where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo<'a, Self, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _
        where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)
    }

    // When default params are omitted they are not generated but used in signature inheritance.
    #[attr = Inline(Hint)]
    fn bar<'a, Self, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a {
        <Self as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_bar<'a, Self, XX, Y, A, B>(arg0: _, arg1: _) -> _ where
        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }

    // Check with user specified args in child:
    // When infer is specified for default parameter the generic param is generated.
    #[attr = Inline(Hint)]
    fn foo1<'a, Self, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _
        where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo1<'a, Self, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _
        where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)
    }

    // When default params are omitted they are not generated but used in signature inheritance.
    #[attr = Inline(Hint)]
    fn bar1<'a, Self, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a {
        <Self as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_bar1<'a, Self, XX, Y, A>(arg0: _, arg1: _) -> _ where
        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }

    // Check with explicit self type.
    #[attr = Inline(Hint)]
    fn foo2<'a, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _) -> _
        where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo2<'a, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _
        where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)
    }

    #[attr = Inline(Hint)]
    fn bar2<'a, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2) }
    #[attr = Inline(Hint)]
    fn static_bar2<'a, XX, Y, A, B>(arg0: _, arg1: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }

    #[attr = Inline(Hint)]
    fn foo3<'a, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo3<'a, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _ where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)
    }

    #[attr = Inline(Hint)]
    fn bar3<'a, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2) }
    #[attr = Inline(Hint)]
    fn static_bar3<'a, XX, Y, A>(arg0: _, arg1: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }
}

mod trait_impl_to_trait {
    trait Trait<'a, X, Y, T = (), const N: usize = 2> {
        fn foo(&self, t: (T, T, T), slice: &'_ [usize; N]) { }
        fn bar(&self, t: (T, T, T), slice: &'_ [usize; N]) { }
    }

    struct S;
    impl <X, Y> Trait<'_, X, Y> for S { }

    struct W(S);
    impl <X, Y> Trait<'_, X, Y> for W {
        // Generics of both methods match generics of their signature
        // functions in `Trait` declaration, no matter specified infers.
        #[attr = Inline(Hint)]
        fn foo(self: _, arg1: _, arg2: _)
            -> _ { Trait::<'static, X, Y>::foo(self.0, arg1, arg2) }
        #[attr = Inline(Hint)]
        fn bar(self: _, arg1: _, arg2: _)
            -> _ { Trait::<'static, X, Y, _, _>::foo(self.0, arg1, arg2) }
    }
}

fn main() { }

------------------------------------------
actual:
------------------------------------------
#![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:generics.pp


mod free_to_trait {
    trait Trait<'a, XX, Y, T = (), const N: usize = 2> {
        fn method<A, B>(&self, t: (T, A, B), slice: &'_ [usize; N]) { }
        fn r#static<A, B>(t: (T, A, B), slice: &'_ [usize; N]) { }
    }

    struct X;
    impl <XX, Y, T, const N: usize> Trait<'_, XX, Y, T, N> for X { }

    // When infer is specified for default parameter the generic param is generated.
    #[attr = Inline(Hint)]
    fn foo<'a, Self, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _)
        -> _ where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo<'a, Self, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _
        where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)
    }

    // When default params are omitted they are not generated but used in signature inheritance.
    #[attr = Inline(Hint)]
    fn bar<'a, Self, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a {
        <Self as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_bar<'a, Self, XX, Y, A, B>(arg0: _, arg1: _) -> _ where
        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }

    // Check with user specified args in child:
    // When infer is specified for default parameter the generic param is generated.
    #[attr = Inline(Hint)]
    fn foo1<'a, Self, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _
        where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo1<'a, Self, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _
        where
        'a:'a {
        <Self as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)
    }

    // When default params are omitted they are not generated but used in signature inheritance.
    #[attr = Inline(Hint)]
    fn bar1<'a, Self, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a {
        <Self as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_bar1<'a, Self, XX, Y, A>(arg0: _, arg1: _) -> _ where
        'a:'a { <Self as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }

    // Check with explicit self type.
    #[attr = Inline(Hint)]
    fn foo2<'a, XX, Y, T, const N: _, A, B>(self: _, arg1: _, arg2: _) -> _
        where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::method::<A, B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo2<'a, XX, Y, T, const N: _, A, B>(arg0: _, arg1: _) -> _
        where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::r#static::<A, B>(arg0, arg1)
    }

    #[attr = Inline(Hint)]
    fn bar2<'a, XX, Y, A, B>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, B>(self, arg1, arg2) }
    #[attr = Inline(Hint)]
    fn static_bar2<'a, XX, Y, A, B>(arg0: _, arg1: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, B>(arg0, arg1) }

    #[attr = Inline(Hint)]
    fn foo3<'a, XX, Y, T, const N: _, B>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::method::<(), B>(self, arg1, arg2)
    }
    #[attr = Inline(Hint)]
    fn static_foo3<'a, XX, Y, T, const N: _, B>(arg0: _, arg1: _) -> _ where
        'a:'a {
        <X as Trait::<'a, XX, Y, T, N>>::r#static::<(), B>(arg0, arg1)
    }

    #[attr = Inline(Hint)]
    fn bar3<'a, XX, Y, A>(self: _, arg1: _, arg2: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::method::<A, ()>(self, arg1, arg2) }
    #[attr = Inline(Hint)]
    fn static_bar3<'a, XX, Y, A>(arg0: _, arg1: _) -> _ where
        'a:'a { <X as Trait::<'a, XX, Y>>::r#static::<A, ()>(arg0, arg1) }
}

mod trait_impl_to_trait {
    trait Trait<'a, X, Y, T = (), const N: usize = 2> {
        fn foo(&self, t: (T, T, T), slice: &'_ [usize; N]) { }
        fn bar(&self, t: (T, T, T), slice: &'_ [usize; N]) { }
    }

    struct S;
    impl <X, Y> Trait<'_, X, Y> for S { }

    struct W(S);
    impl <X, Y> Trait<'_, X, Y> for W {
        // Generics of both methods match generics of their signature
        // functions in `Trait` declaration, no matter specified infers.
        #[attr = Inline(Hint)]
        fn foo(self: _, arg1: _, arg2: _)
            -> _ { Trait::<'static, X, Y>::foo(self.0, arg1, arg2) }
        #[attr = Inline(Hint)]
        fn bar(self: _, arg1: _, arg2: _)
            -> _ { Trait::<'static, X, Y, _, _>::foo(self.0, arg1, arg2) }
    }
}

fn main() { }

------------------------------------------
diff:
------------------------------------------
- #![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
+ #![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
+ kind: Allow}])]
2 #![attr = Feature([fn_delegation#0])]
3 extern crate std;
4 #[attr = PreludeImport]




thread '[pretty] tests/pretty/delegation/generics.rs' panicked at src/tools/compiletest/src/runtest.rs:456:18:
---

error: pretty-printed source does not match expected source
expected:
------------------------------------------
#![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:inline-attribute.pp


mod to_reuse {
    fn foo(x: usize) -> usize { x }
}

// Check that #[inline(hint)] is added to foo reuse
#[attr = Inline(Hint)]
fn bar(arg0: _) -> _ { to_reuse::foo(self + 1) }

trait Trait {
    fn foo(&self) { }
    fn foo1(&self) { }
    fn foo2(&self) { }
---
impl Trait for u8 { }

struct S(u8);

mod to_import {
    fn check(arg: &'_ u8) -> &'_ u8 { arg }
}

impl Trait for S {
    // Check that #[inline(hint)] is added to foo reuse
    #[attr = Inline(Hint)]
    fn foo(self: _)
        ->
            _ {
        // Check that #[inline(hint)] is added to foo0 reuse inside another reuse
        #[attr = Inline(Hint)]
        fn foo0(arg0: _) -> _ { to_reuse::foo(self + 1) }

        // Check that #[inline(hint)] is added when other attributes present in inner reuse
        #[attr = Cold]
        #[attr = MustUse]
        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
        #[attr = Inline(Hint)]
        fn foo1(arg0: _) -> _ { to_reuse::foo(self / 2) }

        // Check that #[inline(never)] is preserved in inner reuse
        #[attr = Inline(Never)]
        fn foo2(arg0: _) -> _ { to_reuse::foo(self / 2) }

        // Check that #[inline(always)] is preserved in inner reuse
        #[attr = Inline(Always)]
        fn foo3(arg0: _) -> _ { to_reuse::foo(self / 2) }

        // Check that #[inline(never)] is preserved when there are other attributes in inner reuse
        #[attr = Cold]
        #[attr = MustUse]
        #[attr = Inline(Never)]
        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
        fn foo4(arg0: _) -> _ { to_reuse::foo(self / 2) }
        Trait::foo(self)
    }

    // Check that #[inline(hint)] is added when there are other attributes present in trait reuse
    #[attr = Cold]
    #[attr = MustUse]
    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
    #[attr = Inline(Hint)]
    fn foo1(self: _) -> _ { Trait::foo1(self.0) }

    // Check that #[inline(never)] is preserved in trait reuse
    #[attr = Inline(Never)]
    fn foo2(self: _) -> _ { Trait::foo2(self.0) }

    // Check that #[inline(always)] is preserved in trait reuse
    #[attr = Inline(Always)]
    fn foo3(self: _) -> _ { Trait::foo3(self.0) }

    // Check that #[inline(never)] is preserved when there are other attributes in trait reuse
    #[attr = Cold]
    #[attr = MustUse]
    #[attr = Inline(Never)]
    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
    fn foo4(self: _) -> _ { Trait::foo4(self.0) }
}

fn main() { }

------------------------------------------
actual:
------------------------------------------
#![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:inline-attribute.pp


mod to_reuse {
    fn foo(x: usize) -> usize { x }
}

// Check that #[inline(hint)] is added to foo reuse
#[attr = Inline(Hint)]
fn bar(arg0: _) -> _ { to_reuse::foo(self + 1) }

trait Trait {
    fn foo(&self) { }
    fn foo1(&self) { }
    fn foo2(&self) { }
---
impl Trait for u8 { }

struct S(u8);

mod to_import {
    fn check(arg: &'_ u8) -> &'_ u8 { arg }
}

impl Trait for S {
    // Check that #[inline(hint)] is added to foo reuse
    #[attr = Inline(Hint)]
    fn foo(self: _)
        ->
            _ {
        // Check that #[inline(hint)] is added to foo0 reuse inside another reuse
        #[attr = Inline(Hint)]
        fn foo0(arg0: _) -> _ { to_reuse::foo(self + 1) }

        // Check that #[inline(hint)] is added when other attributes present in inner reuse
        #[attr = Cold]
        #[attr = MustUse]
        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
        #[attr = Inline(Hint)]
        fn foo1(arg0: _) -> _ { to_reuse::foo(self / 2) }

        // Check that #[inline(never)] is preserved in inner reuse
        #[attr = Inline(Never)]
        fn foo2(arg0: _) -> _ { to_reuse::foo(self / 2) }

        // Check that #[inline(always)] is preserved in inner reuse
        #[attr = Inline(Always)]
        fn foo3(arg0: _) -> _ { to_reuse::foo(self / 2) }

        // Check that #[inline(never)] is preserved when there are other attributes in inner reuse
        #[attr = Cold]
        #[attr = MustUse]
        #[attr = Inline(Never)]
        #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
        fn foo4(arg0: _) -> _ { to_reuse::foo(self / 2) }
        Trait::foo(self)
    }

    // Check that #[inline(hint)] is added when there are other attributes present in trait reuse
    #[attr = Cold]
    #[attr = MustUse]
    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
    #[attr = Inline(Hint)]
    fn foo1(self: _) -> _ { Trait::foo1(self.0) }

    // Check that #[inline(never)] is preserved in trait reuse
    #[attr = Inline(Never)]
    fn foo2(self: _) -> _ { Trait::foo2(self.0) }

    // Check that #[inline(always)] is preserved in trait reuse
    #[attr = Inline(Always)]
    fn foo3(self: _) -> _ { Trait::foo3(self.0) }

    // Check that #[inline(never)] is preserved when there are other attributes in trait reuse
    #[attr = Cold]
    #[attr = MustUse]
    #[attr = Inline(Never)]
    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
    fn foo4(self: _) -> _ { Trait::foo4(self.0) }
}

fn main() { }

------------------------------------------
diff:
------------------------------------------
- #![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
+ #![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
+ kind: Allow}])]
2 #![attr = Feature([fn_delegation#0])]
3 extern crate std;
4 #[attr = PreludeImport]




thread '[pretty] tests/pretty/delegation/inline-attribute.rs' panicked at src/tools/compiletest/src/runtest.rs:456:18:
---

error: pretty-printed source does not match expected source
expected:
------------------------------------------
#![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2021::*;
//@ edition:2021
//@ aux-crate:to_reuse_functions=to-reuse-functions.rs
//@ pretty-mode:hir
//@ pretty-compare-only
//@ pp-exact:inherit-attributes.pp


extern crate to_reuse_functions;

mod to_reuse {
    #[attr = MustUse {reason: "foo: some reason"}]
    #[attr = Cold]
    fn foo(x: usize) -> usize { x }

    #[attr = MustUse]
    #[attr = Cold]
    fn foo_no_reason(x: usize) -> usize { x }

    #[attr = Cold]
    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
    fn bar(x: usize) -> usize { x }
}

#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
#[attr = MustUse {reason: "foo: some reason"}]
#[attr = Inline(Hint)]
fn foo1(arg0: _) -> _ { to_reuse::foo(self + 1) }

#[attr = MustUse]
#[attr = Inline(Hint)]
fn foo_no_reason(arg0: _) -> _ { to_reuse::foo_no_reason(self + 1) }

#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
#[attr = MustUse {reason: "some reason"}]
#[attr = Inline(Hint)]
fn foo2(arg0: _) -> _ { to_reuse::foo(self + 1) }

#[attr = Inline(Hint)]
fn bar(arg0: _) -> _ { to_reuse::bar(arg0) }

#[attr = MustUse]
#[attr = Inline(Hint)]
unsafe fn unsafe_fn_extern() -> _ { to_reuse_functions::unsafe_fn_extern() }
#[attr = MustUse {reason: "extern_fn_extern: some reason"}]
#[attr = Inline(Hint)]
extern "C" fn extern_fn_extern()
    -> _ { to_reuse_functions::extern_fn_extern() }
#[attr = Inline(Hint)]
const fn const_fn_extern() -> _ { to_reuse_functions::const_fn_extern() }
#[attr = MustUse {reason: "some reason"}]
#[attr = Inline(Hint)]
async fn async_fn_extern() -> _ { to_reuse_functions::async_fn_extern() }

mod recursive {
    // Check that `baz` inherit attribute from `foo`
    mod first {
        fn bar() { }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo() -> _ { bar() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn baz() -> _ { foo() }
    }

    // Check that `baz` inherit attribute from `bar`
    mod second {
        #[attr = MustUse {reason: "some reason"}]
        fn bar() { }

        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo() -> _ { bar() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn baz() -> _ { foo() }
    }

    // Check that `foo5` don't inherit attribute from `bar`
    // and inherit attribute from foo4, check that foo1, foo2 and foo3
    // inherit attribute from bar
    mod third {
        #[attr = MustUse {reason: "some reason"}]
        fn bar() { }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo1() -> _ { bar() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo2() -> _ { foo1() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo3() -> _ { foo2() }
        #[attr = MustUse {reason: "foo4"}]
        #[attr = Inline(Hint)]
        fn foo4() -> _ { foo3() }
        #[attr = MustUse {reason: "foo4"}]
        #[attr = Inline(Hint)]
        fn foo5() -> _ { foo4() }
    }

    mod fourth {
        trait T {
            fn foo(&self, x: usize) -> usize { x + 1 }
        }

        struct X;
        impl T for X { }

        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo(self: _, arg1: _) -> _ { <X as T>::foo(self + 1, arg1) }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn bar(arg0: _, arg1: _) -> _ { foo(self + 1, arg1) }
    }
}

fn main() { }

------------------------------------------
actual:
------------------------------------------
#![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2021::*;
//@ edition:2021
//@ aux-crate:to_reuse_functions=to-reuse-functions.rs
//@ pretty-mode:hir
//@ pretty-compare-only
//@ pp-exact:inherit-attributes.pp


extern crate to_reuse_functions;

mod to_reuse {
    #[attr = MustUse {reason: "foo: some reason"}]
    #[attr = Cold]
    fn foo(x: usize) -> usize { x }

    #[attr = MustUse]
    #[attr = Cold]
    fn foo_no_reason(x: usize) -> usize { x }

    #[attr = Cold]
    #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
    fn bar(x: usize) -> usize { x }
}

#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
#[attr = MustUse {reason: "foo: some reason"}]
#[attr = Inline(Hint)]
fn foo1(arg0: _) -> _ { to_reuse::foo(self + 1) }

#[attr = MustUse]
#[attr = Inline(Hint)]
fn foo_no_reason(arg0: _) -> _ { to_reuse::foo_no_reason(self + 1) }

#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}]
#[attr = MustUse {reason: "some reason"}]
#[attr = Inline(Hint)]
fn foo2(arg0: _) -> _ { to_reuse::foo(self + 1) }

#[attr = Inline(Hint)]
fn bar(arg0: _) -> _ { to_reuse::bar(arg0) }

#[attr = MustUse]
#[attr = Inline(Hint)]
unsafe fn unsafe_fn_extern() -> _ { to_reuse_functions::unsafe_fn_extern() }
#[attr = MustUse {reason: "extern_fn_extern: some reason"}]
#[attr = Inline(Hint)]
extern "C" fn extern_fn_extern()
    -> _ { to_reuse_functions::extern_fn_extern() }
#[attr = Inline(Hint)]
const fn const_fn_extern() -> _ { to_reuse_functions::const_fn_extern() }
#[attr = MustUse {reason: "some reason"}]
#[attr = Inline(Hint)]
async fn async_fn_extern() -> _ { to_reuse_functions::async_fn_extern() }

mod recursive {
    // Check that `baz` inherit attribute from `foo`
    mod first {
        fn bar() { }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo() -> _ { bar() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn baz() -> _ { foo() }
    }

    // Check that `baz` inherit attribute from `bar`
    mod second {
        #[attr = MustUse {reason: "some reason"}]
        fn bar() { }

        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo() -> _ { bar() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn baz() -> _ { foo() }
    }

    // Check that `foo5` don't inherit attribute from `bar`
    // and inherit attribute from foo4, check that foo1, foo2 and foo3
    // inherit attribute from bar
    mod third {
        #[attr = MustUse {reason: "some reason"}]
        fn bar() { }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo1() -> _ { bar() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo2() -> _ { foo1() }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo3() -> _ { foo2() }
        #[attr = MustUse {reason: "foo4"}]
        #[attr = Inline(Hint)]
        fn foo4() -> _ { foo3() }
        #[attr = MustUse {reason: "foo4"}]
        #[attr = Inline(Hint)]
        fn foo5() -> _ { foo4() }
    }

    mod fourth {
        trait T {
            fn foo(&self, x: usize) -> usize { x + 1 }
        }

        struct X;
        impl T for X { }

        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn foo(self: _, arg1: _) -> _ { <X as T>::foo(self + 1, arg1) }
        #[attr = MustUse {reason: "some reason"}]
        #[attr = Inline(Hint)]
        fn bar(arg0: _, arg1: _) -> _ { foo(self + 1, arg1) }
    }
}

fn main() { }

------------------------------------------
diff:
------------------------------------------
- #![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
+ #![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
+ kind: Allow}])]
2 #![attr = Feature([fn_delegation#0])]
3 extern crate std;
4 #[attr = PreludeImport]




thread '[pretty] tests/pretty/delegation/inherit-attributes.rs' panicked at src/tools/compiletest/src/runtest.rs:456:18:
---

error: pretty-printed source does not match expected source
expected:
------------------------------------------
#![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-delegation.pp


fn b<C>(e: C) { }

trait G {
    #[attr = Inline(Hint)]
    fn b<C>(arg0: _) -> _ { b::<C>(arg0) }
}

mod m {
    fn add(a: u32, b: u32) -> u32 { a + b }
}

#[attr = Inline(Hint)]
fn add(arg0: _, arg1: _) -> _ { m::add(arg0, arg1) }

fn main() { { let _ = add(1, 2); }; }

------------------------------------------
actual:
------------------------------------------
#![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
kind: Allow}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-delegation.pp


fn b<C>(e: C) { }

trait G {
    #[attr = Inline(Hint)]
    fn b<C>(arg0: _) -> _ { b::<C>(arg0) }
}

mod m {
    fn add(a: u32, b: u32) -> u32 { a + b }
}

#[attr = Inline(Hint)]
fn add(arg0: _, arg1: _) -> _ { m::add(arg0, arg1) }

fn main() { { let _ = add(1, 2); }; }

------------------------------------------
diff:
------------------------------------------
- #![attr = LintCheck([LintCheck {name: ["incomplete_features"], kind: Allow}])]
+ #![attr = LintCheck([LintCheck {lint_name: "incomplete_features",
+ kind: Allow}])]
2 #![attr = Feature([fn_delegation#0])]
3 extern crate std;
4 #[attr = PreludeImport]




thread '[pretty] tests/pretty/hir-delegation.rs' panicked at src/tools/compiletest/src/runtest.rs:456:18:
---

error: pretty-printed source does not match expected source
expected:
------------------------------------------
#![attr = LintCheck([LintCheck {name: ["unused"], kind: Allow}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-lifetimes.pp

// This tests the pretty-printing of lifetimes in lots of ways.


struct Foo<'a> {
    x: &'a u32,
}

impl <'a> Foo<'a> {
    fn f<'b>(x: &'b u32) { }
}

impl  Foo<'_> {
    fn a(x: &'_ u32) { }

    fn b(x: &'_ u32) { }

    fn c(x: &'_ u32, y: &'static u32) { }

    // FIXME: `'a` before `self` is omitted
    fn d<'a>(&self, x: &'a u32) { }

    // FIXME: impl Traits printed as just `/*impl Trait*/`, ugh
    fn iter1<'a>(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }

    fn iter2(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }
}

fn a(x: Foo<'_>) { }

fn b<'a>(x: Foo<'a>) { }

struct Bar<'a, 'b, 'c, T> {
    x: &'a u32,
    y: &'b &'c u32,
    z: T,
}

fn f1<'a, 'b, T>(x: Bar<'a, 'b, '_, T>) { }

fn f2(x: Bar<'_, '_, '_, u32>) { }

trait MyTrait<'a, 'b> {
    fn f(&self, x: Foo<'a>, y: Foo<'b>);
}

impl <'a, 'b, 'c, T> MyTrait<'a, 'b> for Bar<'a, 'b, 'c, T> {
    fn f(&self, x: Foo<'a>, y: Foo<'b>) { }
}

fn g(x: &'_ dyn for<'a, 'b> MyTrait<'a, 'b>) { }

trait Blah { }

type T<'a> = dyn Blah + 'a;

type Q<'a> = dyn MyTrait<'a, 'a> + 'a;

fn h<'b, F>(f: F, y: Foo<'b>) where F: for<'d> MyTrait<'d, 'b> { }

// FIXME(?): attr printing is weird
#[attr = Repr {reprs: [ReprC]}]
struct S<'a>(&'a u32);

extern "C" {
    unsafe fn g1(s: S<'_>);
    unsafe fn g2(s: S<'_>);
    unsafe fn g3<'a>(s: S<'a>);
}

struct St<'a> {
    x: &'a u32,
}

fn f() { { let _ = St { x: &0 }; }; { let _ = St { x: &0 }; }; }

struct Name<'a>(&'a str);

const A: Name<'_> = Name("a");
const B: &'_ str = "";
static C: &'_ str = "";
static D: &'static str = "";

fn tr(_: Box<dyn Blah>) { }

fn main() { }

------------------------------------------
actual:
------------------------------------------
#![attr = LintCheck([LintCheck {lint_name: "unused", kind: Allow}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-lifetimes.pp

// This tests the pretty-printing of lifetimes in lots of ways.


struct Foo<'a> {
    x: &'a u32,
}

impl <'a> Foo<'a> {
    fn f<'b>(x: &'b u32) { }
}

impl  Foo<'_> {
    fn a(x: &'_ u32) { }

    fn b(x: &'_ u32) { }

    fn c(x: &'_ u32, y: &'static u32) { }

    // FIXME: `'a` before `self` is omitted
    fn d<'a>(&self, x: &'a u32) { }

    // FIXME: impl Traits printed as just `/*impl Trait*/`, ugh
    fn iter1<'a>(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }

    fn iter2(&self) -> /*impl Trait*/ { Range { start: 0, end: 1 } }
}

fn a(x: Foo<'_>) { }

fn b<'a>(x: Foo<'a>) { }

struct Bar<'a, 'b, 'c, T> {
    x: &'a u32,
    y: &'b &'c u32,
    z: T,
}

fn f1<'a, 'b, T>(x: Bar<'a, 'b, '_, T>) { }

fn f2(x: Bar<'_, '_, '_, u32>) { }

trait MyTrait<'a, 'b> {
    fn f(&self, x: Foo<'a>, y: Foo<'b>);
}

impl <'a, 'b, 'c, T> MyTrait<'a, 'b> for Bar<'a, 'b, 'c, T> {
    fn f(&self, x: Foo<'a>, y: Foo<'b>) { }
}

fn g(x: &'_ dyn for<'a, 'b> MyTrait<'a, 'b>) { }

trait Blah { }

type T<'a> = dyn Blah + 'a;

type Q<'a> = dyn MyTrait<'a, 'a> + 'a;

fn h<'b, F>(f: F, y: Foo<'b>) where F: for<'d> MyTrait<'d, 'b> { }

// FIXME(?): attr printing is weird
#[attr = Repr {reprs: [ReprC]}]
struct S<'a>(&'a u32);

extern "C" {
    unsafe fn g1(s: S<'_>);
    unsafe fn g2(s: S<'_>);
    unsafe fn g3<'a>(s: S<'a>);
}

struct St<'a> {
    x: &'a u32,
}

fn f() { { let _ = St { x: &0 }; }; { let _ = St { x: &0 }; }; }

struct Name<'a>(&'a str);

const A: Name<'_> = Name("a");
const B: &'_ str = "";
static C: &'_ str = "";
static D: &'static str = "";

fn tr(_: Box<dyn Blah>) { }

fn main() { }

------------------------------------------
diff:
------------------------------------------
- #![attr = LintCheck([LintCheck {name: ["unused"], kind: Allow}])]
+ #![attr = LintCheck([LintCheck {lint_name: "unused", kind: Allow}])]
2 extern crate std;
3 #[attr = PreludeImport]
4 use ::std::prelude::rust_2015::*;




thread '[pretty] tests/pretty/hir-lifetimes.rs' panicked at src/tools/compiletest/src/runtest.rs:456:18:
---

error: pretty-printed source does not match expected source
expected:
------------------------------------------
#![attr = Feature([pin_ergonomics#0])]
#![attr = LintCheck([LintCheck {name: ["dead_code"], kind: Allow},
LintCheck {name: ["incomplete_features"], kind: Allow}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:pin-ergonomics-hir.pp


use std::pin::Pin;

struct Foo;
---

    fn baz_const_lt(&self) { }
}

fn foo(_: Pin<&'_ mut Foo>) { }
fn foo_lt<'a>(_: Pin<&'a mut Foo>) { }

fn foo_const(_: Pin<&'_ Foo>) { }
fn foo_const_lt(_: Pin<&'_ Foo>) { }

fn bar() {
    let mut x: Pin<&mut _> = &pin mut Foo;
    foo(x.as_mut());
    foo(x.as_mut());
    foo_const(x);

    let x: Pin<&_> = &pin const Foo;

    foo_const(x);
    foo_const(x);
}

fn patterns<'a>(&pin mut x: Pin<&'_ mut i32>, &pin const y: Pin<&'a i32>,
    ref pin mut z: i32, ref pin const w: i32) { }

fn main() { }

------------------------------------------
actual:
------------------------------------------
#![attr = Feature([pin_ergonomics#0])]
#![attr = LintCheck([LintCheck {lint_name: "dead_code", kind: Allow},
LintCheck {lint_name: "incomplete_features", kind: Allow}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:pin-ergonomics-hir.pp


use std::pin::Pin;

struct Foo;
---

    fn baz_const_lt(&self) { }
}

fn foo(_: Pin<&'_ mut Foo>) { }
fn foo_lt<'a>(_: Pin<&'a mut Foo>) { }

fn foo_const(_: Pin<&'_ Foo>) { }
fn foo_const_lt(_: Pin<&'_ Foo>) { }

fn bar() {
    let mut x: Pin<&mut _> = &pin mut Foo;
    foo(x.as_mut());
    foo(x.as_mut());
    foo_const(x);

    let x: Pin<&_> = &pin const Foo;

    foo_const(x);
    foo_const(x);
}

fn patterns<'a>(&pin mut x: Pin<&'_ mut i32>, &pin const y: Pin<&'a i32>,
    ref pin mut z: i32, ref pin const w: i32) { }

fn main() { }

------------------------------------------
diff:
------------------------------------------
1 #![attr = Feature([pin_ergonomics#0])]
- #![attr = LintCheck([LintCheck {name: ["dead_code"], kind: Allow},
- LintCheck {name: ["incomplete_features"], kind: Allow}])]
+ #![attr = LintCheck([LintCheck {lint_name: "dead_code", kind: Allow},
+ LintCheck {lint_name: "incomplete_features", kind: Allow}])]
4 extern crate std;
5 #[attr = PreludeImport]
6 use ::std::prelude::rust_2015::*;




thread '[pretty] tests/pretty/pin-ergonomics-hir.rs' panicked at src/tools/compiletest/src/runtest.rs:456:18:

@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9ae8a4a (9ae8a4a92916fb5730164bd285bbe4675e106e09)
Base parent: feaadee (feaadeeaca7db0594da854e7c8c07495341c7439)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9ae8a4a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.1%, 0.4%] 13
Regressions ❌
(secondary)
0.4% [0.2%, 0.9%] 26
Improvements ✅
(primary)
-0.3% [-0.3%, -0.2%] 8
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.3%] 6
All ❌✅ (primary) 0.1% [-0.3%, 0.4%] 21

Max RSS (memory usage)

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

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.6%, 2.9%] 2
Improvements ✅
(primary)
-2.6% [-2.9%, -2.3%] 2
Improvements ✅
(secondary)
-4.3% [-4.3%, -4.3%] 2
All ❌✅ (primary) -2.6% [-2.9%, -2.3%] 2

Cycles

Results (primary 2.8%, secondary 0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.8% [2.7%, 2.9%] 2
Regressions ❌
(secondary)
3.1% [2.9%, 3.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) 2.8% [2.7%, 2.9%] 2

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 502.551s -> 496.987s (-1.11%)
Artifact size: 406.86 MiB -> 408.96 MiB (0.52%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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-clippy Relevant to the Clippy team. 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.

8 participants