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

[WIP] Remove placeholders completely #130227

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amandasystems
Copy link
Contributor

@amandasystems amandasystems commented Sep 11, 2024

This PR does shotgun surgery on borrowck to remove all special handling of placeholders, completely replacing them with a preprocessing step that rewrites placeholder leaks into constraints, removing constraint propagation of placeholders and all logic used to detect placeholder violations during error reporting. This finishes what #123720 started.

The new method works like this:

  1. during SCC construction, some information about SCC membership and reachability is retained
  2. just after SCC construction, a constraint r - (from: to_invalid) - > 'static is added when r is the representative of an SCC and
    1. that SCC either has had its universe shrunk because it reaches a region with a smaller one (in which case to_invalid is the smallest-universed region it reaches), or if it reaches a region with a too large universe that isn't part of the SCC (in which case to_invalid is the region with a too large universe). In either case, from is also r.
  3. some region reaches in r's SCC reaches another placeholder, reached, in which case the added constraint is r -> (reaches: reached) 'static. Through clever choice of defaults (chosing minimum elements), reached will be r if at all possible.

When tracing errors for diagnostics one of these special constraints along a path are treated much like a HTTP redirect: if we are explaining from: to and reach an edge with reaches: invalid we stop the search and start following reaches: invalid instead. When doing this the implicit edges x: 'static for every region x are ignored, since the search would otherwise be able to cheat by going through 'static and re-find the same edge again.

A bunch of optimisations are possible:

  • Conservatively add constraints, e.g. one per SCC. May worsen error tracing!
  • as a final pass, allow fusing the annotations for the SCC after adding the extra constraints to remove unnecessary information and save memory. This could be done cheaply since we already iterate over the entire set of SCCs.
  • currently, if constraints are added the entire set of SCCs are recomputed. This is of course rather wasteful, and we could do better. Especially since SCCs are added in dependency order. This would require a fully separate SCC module since the dynamic SCC combo we'd need now shares almost no properties with regular SCC computation. Given that this is meant to be a temporary work-around, that seems like too much work.

There are a bunch of rather nice bonuses:

  • We now don't need to expose region indices in MirTypeckRegionConstraints to the entire crate. The only entry point is placeholder_region() so correctness of the indices is now guaranteed
  • A lot of things that were previously iterations over lists is now a single lookup
  • The constraint graph search functions are simple and at least one of them can now take a proper region as target rather than a predicate function. The only case that needs the predicate argument to find_constraint_path_to() is find_sub_region_live_at(), which may or may not be possible to work around.

r​? nikomatsakis

@rustbot
Copy link
Collaborator

rustbot commented Sep 11, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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. labels Sep 11, 2024
@amandasystems
Copy link
Contributor Author

r? nikomatsakis

@rustbot rustbot assigned nikomatsakis and unassigned TaKO8Ki Sep 11, 2024
@amandasystems
Copy link
Contributor Author

@rustbot author

@rustbot rustbot added 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 Sep 11, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 23, 2024

☔ The latest upstream changes (presumably #130724) made this pull request unmergeable. Please resolve the merge conflicts.

@lqd
Copy link
Member

lqd commented Sep 27, 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 Sep 27, 2024
@bors
Copy link
Contributor

bors commented Sep 27, 2024

⌛ Trying commit 4633c56 with merge b8cc49b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2024
…mpletely, r=<try>

[WIP] Remove placeholders completely

This PR does shotgun surgery on borrowck to remove all special handling of placeholders, completely replacing them with a preprocessing step that rewrites placeholder leaks into constraints, removing constraint propagation of placeholders and all logic used to detect placeholder violations during error reporting. This finishes what rust-lang#123720 started.

The new method works like this:
1. during SCC construction, some information about SCC membership and reachability is retained
2. just after SCC construction, a constraint `r - (from: to_invalid) - > 'static` is added when `r` is the representative of an SCC and
   1. that SCC either has had its universe shrunk because it reaches a region with a smaller one (in which case `to_invalid` is the smallest-universed region it reaches), or if it reaches a region with a too large universe that isn't part of the SCC (in which case `to_invalid` is the region with a too large universe). In either case, `from` is also `r`.
 2.  some region `reaches` in `r`'s SCC reaches another placeholder, `reached`, in which case the added constraint is `r -> (reaches: reached) 'static`. Through clever choice of defaults (chosing minimum elements), `reached` will be `r` if at all possible.

When tracing errors for diagnostics one of these special constraints along a path are treated much like a HTTP redirect: if we are explaining `from: to` and reach an edge with `reaches: invalid` we stop the search and start following `reaches: invalid` instead. When doing this the implicit edges `x: 'static` for every region `x` are ignored, since the search would otherwise be able to cheat by going through 'static and re-find the same edge again.

A bunch of optimisations are possible:
- Conservatively add constraints, e.g. one per SCC. May worsen error tracing!
- as a final pass, allow fusing the annotations for the SCC after adding the extra constraints to remove unnecessary information and save memory. This could be done cheaply since we already iterate over the entire SCC.
- currently, if constraints are added the entire set of SCCs are recomputed. This is of course rather wasteful, and we could maybe do better.

There are a bunch of rather nice bonuses:
- We now don't need to expose region indices in `MirTypeckRegionConstraints` to the entire crate. The only entry point is `placeholder_region()` so correctness of the indices is now guaranteed
- A lot of things that were previously iterations over lists is now a single lookup
- The constraint graph search functions are simple and at least one of them can now take a proper region as target rather than a predicate function. The only case that needs the predicate argument  to `find_constraint_path_to()` is `find_sub_region_live_at()`, which may or may not be possible to work around.

 r​? nikomatsakis
@amandasystems
Copy link
Contributor Author

amandasystems commented Sep 27, 2024

Failing test cases left:

"for any two lifetimes" becomes "for any one", with the other replaced by the user-supplied region variable

  • tests/ui/associated-types/associated-types-eq-hr.rs
  • tests/ui/async-await/return-type-notation/issue-110963-early.rs
  • tests/ui/coroutine/auto-trait-regions.rs
  • tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs

missing "note: due to current limitations in the borrow checker, this implies a 'static lifetime":

  • tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 27, 2024

☀️ Try build successful - checks-actions
Build commit: b8cc49b (b8cc49b4b6432618a26e2a74fec6b342ee94484e)

@rust-timer

This comment has been minimized.

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 4, 2024
@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented Oct 13, 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 Oct 13, 2024
@bors
Copy link
Contributor

bors commented Oct 13, 2024

⌛ Trying commit 40f3aea with merge 4bb6bd0...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
…mpletely, r=<try>

[WIP] Remove placeholders completely

This PR does shotgun surgery on borrowck to remove all special handling of placeholders, completely replacing them with a preprocessing step that rewrites placeholder leaks into constraints, removing constraint propagation of placeholders and all logic used to detect placeholder violations during error reporting. This finishes what rust-lang#123720 started.

The new method works like this:
1. during SCC construction, some information about SCC membership and reachability is retained
2. just after SCC construction, a constraint `r - (from: to_invalid) - > 'static` is added when `r` is the representative of an SCC and
   1. that SCC either has had its universe shrunk because it reaches a region with a smaller one (in which case `to_invalid` is the smallest-universed region it reaches), or if it reaches a region with a too large universe that isn't part of the SCC (in which case `to_invalid` is the region with a too large universe). In either case, `from` is also `r`.
 2.  some region `reaches` in `r`'s SCC reaches another placeholder, `reached`, in which case the added constraint is `r -> (reaches: reached) 'static`. Through clever choice of defaults (chosing minimum elements), `reached` will be `r` if at all possible.

When tracing errors for diagnostics one of these special constraints along a path are treated much like a HTTP redirect: if we are explaining `from: to` and reach an edge with `reaches: invalid` we stop the search and start following `reaches: invalid` instead. When doing this the implicit edges `x: 'static` for every region `x` are ignored, since the search would otherwise be able to cheat by going through 'static and re-find the same edge again.

A bunch of optimisations are possible:
- ~~Conservatively add constraints, e.g. one per SCC. May worsen error tracing!~~
- as a final pass, allow fusing the annotations for the SCC after adding the extra constraints to remove unnecessary information and save memory. This could be done cheaply since we already iterate over the entire set of SCCs.
- currently, if constraints are added the entire set of SCCs are recomputed. This is of course rather wasteful, and we could do better. Especially since SCCs are added in dependency order. This would require a fully separate SCC module since the dynamic SCC combo we'd need now shares almost no properties with regular SCC computation. Given that this is meant to be a temporary work-around, that seems like too much work.

There are a bunch of rather nice bonuses:
- We now don't need to expose region indices in `MirTypeckRegionConstraints` to the entire crate. The only entry point is `placeholder_region()` so correctness of the indices is now guaranteed
- A lot of things that were previously iterations over lists is now a single lookup
- The constraint graph search functions are simple and at least one of them can now take a proper region as target rather than a predicate function. The only case that needs the predicate argument  to `find_constraint_path_to()` is `find_sub_region_live_at()`, which may or may not be possible to work around.

 r​? nikomatsakis
@bors
Copy link
Contributor

bors commented Oct 13, 2024

☀️ Try build successful - checks-actions
Build commit: 4bb6bd0 (4bb6bd0d97cea42fa7c848e51eb10bf93ce84b1d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4bb6bd0): 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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.2%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -1.4%, secondary 1.4%)

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

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
2.7% [2.7%, 2.8%] 3
Improvements ✅
(primary)
-4.3% [-4.3%, -4.3%] 1
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) -1.4% [-4.3%, 1.5%] 2

Cycles

Results (secondary -1.2%)

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

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

Binary size

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

Bootstrap: 781.228s -> 782.066s (0.11%)
Artifact size: 332.08 MiB -> 331.95 MiB (-0.04%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Oct 13, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 4, 2024

☔ The latest upstream changes (presumably #132581) made this pull request unmergeable. Please resolve the merge conflicts.

This version is maximally naive, and currently unsound.

Handle more placeholder errors.

This update extends the SCC metadata tracking a lot
and uses the extra information to add p: 'static for
any placeholder that reaches another placeholder.

It also inlines the few measly bits of `init_free_and_bound_regions()`
that still remain as relevant. This increases the constructor for
`RegionInferenceContext`s somewhat, but I still think it's
readable.

The documentation for `init_free_and_bound_regions()` was out of
date, and the correct, up to date version is available in the various
places where the logic was moved.

Use annotions on the outlives-static constraints to
help the search for who is to blame.

Invalid placeholder relation constraints are redirects

This commit makes the search for blamable outlives constraints
treat an added `x: 'static` edge as a redirect to figure out
why it reached an invalid placeholder.

As a drive-by it also refactors the blame search somewhat, renames
a few methods, and allows iterating over outgoing constraints
without the implied edges from 'static.

This version mostly works!

I've switched to encoding our new outlives-static constraints
with two extra parameters: the source and drain of a path in the
original constraint graph that caused a placeholder issue.

This handles all of the soundness issues, leaving 16 failing
diagnostics.

Remove some stuff we don't need or can't use anymore

Figure out better names for opaque types!

Fix tidy error

Fix most of the cases of missing "implied 'static" warnings

Fix documentation that build-failed
This seems to hit the sweet spot between enabling debugging
and being efficient.

Somewhat cleaner representation that separates concerns

Avoid handling placeholders for MIR bodies without them

Determine once and for all if there are higher-kinded concerns and nope out

This also changes how annotations for SCCs work.

This version finally does away with all kinds of universe handling

It does so in a preprocessing step that now also removes higher-ranked
concerns from type tests.

Fix handling of opaque regions
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
------
 > importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:c32c805632780b5c1de330e3f44561b336c2efe163bc0990acb392390157a8e1d9f855d75914a239aa40c49d77f4a837247d05d2f8d46f554b98e1f46712a3e3:
------
##[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-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
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-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--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', 'rust.lld=false', '--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-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
26 error: higher-ranked subtype error
-   --> $DIR/issue-111404-1.rs:10:1
+   --> $DIR/issue-111404-1.rs:10:8
28    |
29 LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
-    |
-    |
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
33 
34 error: aborting due to 4 previous errors
35 



The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args associated-inherent-types/issue-111404-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/associated-inherent-types/issue-111404-1.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/associated-inherent-types/issue-111404-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/associated-inherent-types/issue-111404-1.rs:10:11
   |
   |
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
   |
   = note: expected struct `Foo<fn(&())>`
              found struct `Foo<for<'b> fn(&'b ())>`
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/associated-inherent-types/issue-111404-1.rs:10:11
   |
   |
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
   |
   = note: expected struct `Foo<fn(&())>`
              found struct `Foo<for<'b> fn(&'b ())>`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: higher-ranked subtype error
##[error]  --> /checkout/tests/ui/associated-inherent-types/issue-111404-1.rs:10:1
   |
   |
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}

error: higher-ranked subtype error
##[error]  --> /checkout/tests/ui/associated-inherent-types/issue-111404-1.rs:10:8
   |
   |
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}

error: aborting due to 4 previous errors

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


---- [ui] tests/ui/associated-types/associated-types-eq-hr.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-hr/associated-types-eq-hr.stderr"


48 LL |     tuple_one::<Tuple>();
49    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
50    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
54 error: implementation of `TheTrait` is not general enough
55   --> $DIR/associated-types-eq-hr.rs:96:5


57 LL |     tuple_one::<Tuple>();
58    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
59    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+    = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
64 error: implementation of `TheTrait` is not general enough
65   --> $DIR/associated-types-eq-hr.rs:96:5


67 LL |     tuple_one::<Tuple>();
68    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
69    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
72    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
74 error: implementation of `TheTrait` is not general enough


77 LL |     tuple_one::<Tuple>();
78    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
79    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+    = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
82    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
84 error: implementation of `TheTrait` is not general enough


87 LL |     tuple_two::<Tuple>();
88    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
89    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
93 error: implementation of `TheTrait` is not general enough
94   --> $DIR/associated-types-eq-hr.rs:104:5


96 LL |     tuple_two::<Tuple>();
97    |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
98    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+    = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
103 error[E0308]: mismatched types
104   --> $DIR/associated-types-eq-hr.rs:104:5


135 LL |     tuple_four::<Tuple>();
136    |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
137    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
141 error: implementation of `TheTrait` is not general enough
142   --> $DIR/associated-types-eq-hr.rs:116:5


144 LL |     tuple_four::<Tuple>();
145    |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
146    |
-    = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+    = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
151 error: aborting due to 12 previous errors
152 



The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args associated-types/associated-types-eq-hr.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/associated-types/associated-types-eq-hr.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/associated-types/associated-types-eq-hr" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0271]: type mismatch resolving `<UintStruct as TheTrait<&isize>>::A == &isize`
   |
   |
LL |     foo::<UintStruct>(); //~ ERROR type mismatch
   |           ^^^^^^^^^^ type mismatch resolving `<UintStruct as TheTrait<&isize>>::A == &isize`
   |
note: expected this to be `&isize`
   |
   |
LL |     type A = &'a usize;
   = note: expected reference `&isize`
              found reference `&usize`
note: required by a bound in `foo`
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:45:36
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:45:36
   |
LL | fn foo<T>()
   |    --- required by a bound in this function
LL | where
LL |     T: for<'x> TheTrait<&'x isize, A = &'x isize>,
   |                                    ^^^^^^^^^^^^^ required by this bound in `foo`

error[E0271]: type mismatch resolving `<IntStruct as TheTrait<&isize>>::A == &usize`
   |
   |
LL |     bar::<IntStruct>(); //~ ERROR type mismatch
   |           ^^^^^^^^^ type mismatch resolving `<IntStruct as TheTrait<&isize>>::A == &usize`
note: expected this to be `&usize`
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:14:14
   |
   |
LL |     type A = &'a isize;
   = note: expected reference `&usize`
              found reference `&isize`
note: required by a bound in `bar`
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:52:36
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:52:36
   |
LL | fn bar<T>()
   |    --- required by a bound in this function
LL | where
LL |     T: for<'x> TheTrait<&'x isize, A = &'x usize>,

error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:96:5
   |
   |
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:96:5
   |
   |
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:96:5
   |
   |
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:96:5
   |
   |
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:104:5
   |
   |
LL |     tuple_two::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:104:5
   |
   |
LL |     tuple_two::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:104:5
   |
   |
LL |     tuple_two::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
   = note: expected reference `&'x _`
              found reference `&'y _`
note: the lifetime requirement is introduced here
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:66:53
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:66:53
   |
LL |     T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:104:5
   |
   |
LL |     tuple_two::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
   = note: expected reference `&'x _`
              found reference `&'y _`
note: the lifetime requirement is introduced here
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:66:53
  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:66:53
   |
LL |     T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,
   |                                                     ^^^^^^^^^^^^^
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:116:5
   |
   |
LL |     tuple_four::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'0 isize, &'y isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: implementation of `TheTrait` is not general enough
##[error]  --> /checkout/tests/ui/associated-types/associated-types-eq-hr.rs:116:5
   |
   |
LL |     tuple_four::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
   |
   = note: `Tuple` must implement `TheTrait<(&'x isize, &'0 isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `TheTrait<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: aborting due to 12 previous errors

Some errors have detailed explanations: E0271, E0308.
For more information about an error, try `rustc --explain E0271`.
---

9 LL | |     });
10    | |______^ implementation of `Send` is not general enough
11    |
-    = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any two lifetimes `'0` and `'1`...
-    = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2`
+    = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any lifetime `'0`...
+    = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'1>(..) }`, for some specific lifetime `'1`
15 error: implementation of `Send` is not general enough
16   --> $DIR/issue-110963-early.rs:14:5

23 LL | |     });
23 LL | |     });
24    | |______^ implementation of `Send` is not general enough
25    |
-    = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any two lifetimes `'0` and `'1`...
-    = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2`
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+    = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'_>(..) }`, for any lifetime `'0`...
+    = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'1>(..) }`, for some specific lifetime `'1`
30 error: aborting due to 2 previous errors
31 



The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/return-type-notation/issue-110963-early.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/return-type-notation/issue-110963-early.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/async-await/return-type-notation/issue-110963-early" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021"
--- stderr -------------------------------
error: implementation of `Send` is not general enough
##[error]  --> /checkout/tests/ui/async-await/return-type-notation/issue-110963-early.rs:14:5
   |
   |
LL | /     spawn(async move {
LL | |         let mut hc = hc;
LL | |         if !hc.check().await {
LL | |             log_health_check_failure().await;
LL | |     });
   | |______^ implementation of `Send` is not general enough
   |
   |
   = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any lifetime `'0`...
   = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'1>(..) }`, for some specific lifetime `'1`
error: implementation of `Send` is not general enough
##[error]  --> /checkout/tests/ui/async-await/return-type-notation/issue-110963-early.rs:14:5
   |
   |
LL | /     spawn(async move {
LL | |         let mut hc = hc;
LL | |         if !hc.check().await {
LL | |             log_health_check_failure().await;
LL | |     });
   | |______^ implementation of `Send` is not general enough
   |
   |
   = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'_>(..) }`, for any lifetime `'0`...
   = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'1>(..) }`, for some specific lifetime `'1`
error: aborting due to 2 previous errors
------------------------------------------



---- [ui] tests/ui/coroutine/auto-trait-regions.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coroutine/auto-trait-regions/auto-trait-regions.stderr"
diff of stderr:

47 LL |     assert_foo(gen);
48    |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
49    |
-    = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
+    = note: `Foo` would have to be implemented for the type `A<'_, '0>`, for any lifetime `'0`...
+    = note: ...but `Foo` is actually implemented for the type `A<'_, '1>`, for some specific lifetime `'1`
53 error: aborting due to 4 previous errors
54 



The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args coroutine/auto-trait-regions.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/auto-trait-regions.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/coroutine/auto-trait-regions" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:45:24
   |
   |
LL |         let a = A(&mut true, &mut true, No);
   |                        |
   |                        creates a temporary value which is freed while still in use
...
...
LL |         assert_foo(a);
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~         let binding = true;
LL ~         let binding = true;
LL ~         let a = A(&mut binding, &mut true, No);

error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:45:35
   |
   |
LL |         let a = A(&mut true, &mut true, No);
   |                                   |
   |                                   creates a temporary value which is freed while still in use
...
...
LL |         assert_foo(a);
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~         let binding = true;
LL ~         let binding = true;
LL ~         let a = A(&mut true, &mut binding, No);

error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:31:5
   |
   |
LL |     assert_foo(gen);
   |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
   = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:51:5
   |
   |
LL |     assert_foo(gen);
   |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `Foo` would have to be implemented for the type `A<'_, '0>`, for any lifetime `'0`...
   = note: ...but `Foo` is actually implemented for the type `A<'_, '1>`, for some specific lifetime `'1`
error: aborting due to 4 previous errors

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


---- [ui] tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/bugs/hrtb-implied-2/hrtb-implied-2.stderr"

+ error[E0310]: the parameter type `I` may not live long enough
+   --> $DIR/hrtb-implied-2.rs:18:17
+    |
+    |
+ LL |     let _next = iter2.next();
+    |                 |
+    |                 the parameter type `I` must be valid for the static lifetime...
+    |                 the parameter type `I` must be valid for the static lifetime...
+    |                 ...so that the type `I` will meet its required lifetime bounds
+ help: consider adding an explicit lifetime bound
+    |
+    |
+ LL | fn fails<I: LendingIterator + 'static, F>(iter: &mut I, f: F) -> bool
+ 
1 error[E0521]: borrowed data escapes outside of function
2   --> $DIR/hrtb-implied-2.rs:18:17
3    |
3    |

15    = note: requirement occurs because of a mutable reference to `Eat<&mut I, F>`
16    = note: mutable references are invariant over their type parameter
17    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-    = note: due to current limitations in the borrow checker, this implies a `'static` lifetime
- error: aborting due to 1 previous error
+ error: aborting due to 2 previous errors
21 
- For more information about this error, try `rustc --explain E0521`.
---
To only update this specific test, also pass `--test-args generic-associated-types/bugs/hrtb-implied-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/generic-associated-types/bugs/hrtb-implied-2.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/generic-associated-types/bugs/hrtb-implied-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `I` may not live long enough
##[error]  --> /checkout/tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs:18:17
   |
   |
LL |     let _next = iter2.next();
   |                 ^^^^^^^^^^^^
   |                 |
   |                 the parameter type `I` must be valid for the static lifetime...
   |                 ...so that the type `I` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
   |
   |
LL | fn fails<I: LendingIterator + 'static, F>(iter: &mut I, f: F) -> bool

error[E0521]: borrowed data escapes outside of function
##[error]  --> /checkout/tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs:18:17
   |
   |
LL | fn fails<I: LendingIterator, F>(iter: &mut I, f: F) -> bool
   |                                 ----  - let's call the lifetime of this reference `'1`
   |                                 `iter` is a reference that is only valid in the function body
...
LL |     let _next = iter2.next();
   |                 ^^^^^^^^^^^^
   |                 ^^^^^^^^^^^^
   |                 |
   |                 `iter` escapes the function body here
   |                 argument requires that `'1` must outlive `'static`
   |
   = note: requirement occurs because of a mutable reference to `Eat<&mut I, F>`
   = note: mutable references are invariant over their type parameter

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0310, E0521.
---
+    | |     |
+    | |_____the parameter type `T` must be valid for the static lifetime...
+    |       ...so that the type `T` will meet its required lifetime bounds
12    |
- note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ help: consider adding an explicit lifetime bound
15    |
15    |
- LL |     for<'a> T: Get<Value<'a> = ()>,
- help: consider restricting the type parameter to the `'static` lifetime
-    |
-    |
20 LL |     for<'a> T: Get<Value<'a> = ()> + 'static,
22 

23 error: aborting due to 1 previous error
24 
---
To only update this specific test, also pass `--test-args generic-associated-types/collectivity-regression.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/generic-associated-types/collectivity-regression.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/generic-associated-types/collectivity-regression" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error]  --> /checkout/tests/ui/generic-associated-types/collectivity-regression.rs:13:5
   |
   |
LL | /     || {
LL | |         //~^ `T` does not live long enough
LL | |         // FIXME(#98437). This regressed at some point and
LL | |         // probably should work.
LL | |         let _x = x;
LL | |     };
LL | |     };
   | |     ^
   | |     |
   | |_____the parameter type `T` must be valid for the static lifetime...
   |       ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL |     for<'a> T: Get<Value<'a> = ()> + 'static,

error: aborting due to 1 previous error

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


---- [ui] tests/ui/generic-associated-types/extended/lending_iterator.rs#base stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/extended/lending_iterator.base/lending_iterator.base.stderr"
diff of stderr:

7 LL |     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self {
8    |                                             ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
- error: `Self` does not live long enough
+ error[E0310]: the parameter type `Self` may not live long enough
11   --> $DIR/lending_iterator.rs:34:9
12    |
12    |
13 LL |         <B as FromLendingIterator<A>>::from_iter(self)
14    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |         |
+    |         the parameter type `Self` must be valid for the static lifetime...
+    |         ...so that the type `Self` will meet its required lifetime bounds
+    |         ...so that the type `Self` will meet its required lifetime bounds
+    |
+ help: consider adding an explicit lifetime bound
+    |
+ LL | pub trait LendingIterator where Self: 'static {
15 
16 error: aborting due to 2 previous errors
17 

---
To only update this specific test, also pass `--test-args generic-associated-types/extended/lending_iterator.rs`

error in revision `base`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/generic-associated-types/extended/lending_iterator.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "base" "--check-cfg" "cfg(FALSE,base,extended)" "--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/generic-associated-types/extended/lending_iterator.base" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0276]: impl has stricter requirements than trait
##[error]  --> /checkout/tests/ui/generic-associated-types/extended/lending_iterator.rs:13:45
   |
   |
LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
   |     ------------------------------------------------------------------------ definition of `from_iter` from trait
...
LL |     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self {
   |                                             ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
error[E0310]: the parameter type `Self` may not live long enough
##[error]  --> /checkout/tests/ui/generic-associated-types/extended/lending_iterator.rs:34:9
   |
   |
LL |         <B as FromLendingIterator<A>>::from_iter(self)
   |         |
   |         the parameter type `Self` must be valid for the static lifetime...
   |         ...so that the type `Self` will meet its required lifetime bounds
   |
---
- error: `T` does not live long enough
+ error[E0310]: the parameter type `T` may not live long enough
2   --> $DIR/issue-91139.rs:14:12
3    |
4 LL |     let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
5    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 
- error: `T` does not live long enough
-   --> $DIR/issue-91139.rs:14:12
-   --> $DIR/issue-91139.rs:14:12
+    |            |
+    |            the parameter type `T` must be valid for the static lifetime...
+    |            ...so that the type `T` will meet its required lifetime bounds
9    |
- LL |     let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
+ help: consider adding an explicit lifetime bound
12    |
12    |
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ LL | fn foo<T: 'static>() {
14 
- error: aborting due to 2 previous errors
+ error: aborting due to 1 previous error
16 
---
To only update this specific test, also pass `--test-args generic-associated-types/issue-91139.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/generic-associated-types/issue-91139.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/generic-associated-types/issue-91139" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error]  --> /checkout/tests/ui/generic-associated-types/issue-91139.rs:14:12
   |
   |
LL |     let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
   |            |
   |            the parameter type `T` must be valid for the static lifetime...
   |            ...so that the type `T` will meet its required lifetime bounds
   |
---
- error: `C` does not live long enough
+ error[E0310]: the parameter type `C` may not live long enough
2   --> $DIR/issue-92096.rs:17:5
3    |
4 LL |     async move { c.connect().await }
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |     |
+    |     the parameter type `C` must be valid for the static lifetime...
+    |     ...so that the type `C` will meet its required lifetime bounds
+    |     ...so that the type `C` will meet its required lifetime bounds
+    |
+ help: consider adding an explicit lifetime bound
+    |
+ LL |     C: Client + Send + Sync + 'static,
6 
7 error: aborting due to 1 previous error
8 

---
To only update this specific test, also pass `--test-args generic-associated-types/issue-92096.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/generic-associated-types/issue-92096.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/generic-associated-types/issue-92096" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018"
--- stderr -------------------------------
error[E0310]: the parameter type `C` may not live long enough
##[error]  --> /checkout/tests/ui/generic-associated-types/issue-92096.rs:17:5
   |
   |
LL |     async move { c.connect().await }
   |     |
   |     the parameter type `C` must be valid for the static lifetime...
   |     ...so that the type `C` will meet its required lifetime bounds
   |
---
diff of stderr:

2   --> $DIR/due-to-where-clause.rs:2:5
3    |
4 LL |     test::<FooS>(&mut 42);
-    |     ^^^^^^^^^^^^ implementation of `Foo` is not general enough
+    |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
6    |
7    = note: `FooS<'_>` must implement `Foo<'0>`, for any lifetime `'0`...
8    = note: ...but `FooS<'_>` actually implements `Foo<'1>`, for some specific lifetime `'1`

The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args higher-ranked/trait-bounds/due-to-where-clause.rs`
To only update this specific test, also pass `--test-args higher-ranked/trait-bounds/due-to-where-clause.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/higher-ranked/trait-bounds/due-to-where-clause" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.rs:2:5
   |
   |
LL |     test::<FooS>(&mut 42); //~ ERROR implementation of `Foo` is not general enough
   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `FooS<'_>` must implement `Foo<'0>`, for any lifetime `'0`...
   = note: ...but `FooS<'_>` actually implements `Foo<'1>`, for some specific lifetime `'1`
error: aborting due to 1 previous error
------------------------------------------



---- [ui] tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/higher-ranked/trait-bounds/hrtb-conflate-regions/hrtb-conflate-regions.stderr"
diff of stderr:

4 LL | fn b() { want_foo2::<SomeStruct>(); }
5    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
6    |
-    = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
+    = note: `SomeStruct` must implement `Foo<(&'0 isize, &'b isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `Foo<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
10 error: implementation of `Foo` is not general enough
11   --> $DIR/hrtb-conflate-regions.rs:27:10


13 LL | fn b() { want_foo2::<SomeStruct>(); }
14    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
15    |
-    = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
-    = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+    = note: `SomeStruct` must implement `Foo<(&'a isize, &'0 isize)>`, for any lifetime `'0`...
+    = note: ...but it actually implements `Foo<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
20 error: aborting due to 2 previous errors
21 



The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args higher-ranked/trait-bounds/hrtb-conflate-regions.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/higher-ranked/trait-bounds/hrtb-conflate-regions" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs:27:10
   |
   |
LL | fn b() { want_foo2::<SomeStruct>(); }
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `SomeStruct` must implement `Foo<(&'0 isize, &'b isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `Foo<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs:27:10
   |
   |
LL | fn b() { want_foo2::<SomeStruct>(); }
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `SomeStruct` must implement `Foo<(&'a isize, &'0 isize)>`, for any lifetime `'0`...
   = note: ...but it actually implements `Foo<(&'1 isize, &'1 isize)>`, for some specific lifetime `'1`
error: aborting due to 2 previous errors
------------------------------------------



---- [ui] tests/ui/impl-trait/nested-rpit-hrtb-2.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/nested-rpit-hrtb-2/nested-rpit-hrtb-2.stderr"

- error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
+ error: implementation of `Trait` is not general enough
2   --> $DIR/nested-rpit-hrtb-2.rs:6:57
---
-    |                       |                     opaque type defined here
-    |                       hidden type `&'a str` captures the lifetime `'a` as defined here
+    |                                                         ^^ implementation of `Trait` is not general enough
+    |
+    = note: `()` must implement `Trait<'a>`
+    = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
10 error: aborting due to 1 previous error
11 

- For more information about this error, try `rustc --explain E0700`.
---
To only update this specific test, also pass `--test-args impl-trait/nested-rpit-hrtb-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/nested-rpit-hrtb-2.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/impl-trait/nested-rpit-hrtb-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `Trait` is not general enough
##[error]  --> /checkout/tests/ui/impl-trait/nested-rpit-hrtb-2.rs:6:57
   |
   |
LL | fn test() -> impl for<'a> Trait<'a, Assoc = impl Sized> {}
   |                                                         ^^ implementation of `Trait` is not general enough
   |
   = note: `()` must implement `Trait<'a>`
   = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
error: aborting due to 1 previous error
------------------------------------------


---
+    |     |
+    |     the parameter type `T` must be valid for the static lifetime...
+    |     ...so that the type `T` will meet its required lifetime bounds
6    |
- note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ help: consider adding an explicit lifetime bound
9    |
9    |
- LL |         for<'a> T::Projected<'a>: MyTrait,
- help: consider restricting the type parameter to the `'static` lifetime
-    |
-    |
- LL | fn foo<T : MyTrait + 'static, U : MyTrait + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
-    |                    +++++++++              +++++++++
+ LL | fn foo<T : MyTrait + 'static, U : MyTrait>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
16 
- error: `U` does not live long enough
+ error[E0310]: the parameter type `U` may not live long enough
18   --> $DIR/issue-105507.rs:39:5
---
+    |     |
+    |     the parameter type `U` must be valid for the static lifetime...
+    |     ...so that the type `U` will meet its required lifetime bounds
22    |
- note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ help: consider adding an explicit lifetime bound
25    |
25    |
- LL |         for<'a> T::Projected<'a>: MyTrait,
- help: consider restricting the type parameter to the `'static` lifetime
-    |
-    |
- LL | fn foo<T : MyTrait + 'static, U : MyTrait + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
-    |                    +++++++++              +++++++++
+ LL | fn foo<T : MyTrait, U : MyTrait + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
32 
33 error: aborting due to 2 previous errors
34 

---
Saved the actual fixed to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lifetimes/issue-105507/issue-105507.fixed"
diff of fixed:

31 
32 fn require_trait<T: MyTrait>(_: T) {}
33 
- fn foo<T : MyTrait + 'static + 'static, U : MyTrait + 'static + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
+ fn foo<T : MyTrait + 'static, U : MyTrait + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
35     //~^ HELP consider restricting the type parameter to the `'static` lifetime
36     //~| HELP consider restricting the type parameter to the `'static` lifetime
37     require_trait(wrap);

The actual fixed differed from the expected fixed.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lifetimes/issue-105507.rs`
To only update this specific test, also pass `--test-args lifetimes/issue-105507.rs`

error: 2 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lifetimes/issue-105507.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/lifetimes/issue-105507" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error]  --> /checkout/tests/ui/lifetimes/issue-105507.rs:37:5
   |
---
   |     ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn foo<T : MyTrait + 'static, U : MyTrait>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {

error[E0310]: the parameter type `U` may not live long enough
##[error]  --> /checkout/tests/ui/lifetimes/issue-105507.rs:39:5
   |
---
   |     ...so that the type `U` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn foo<T : MyTrait, U : MyTrait + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {

error: aborting due to 2 previous errors

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


---- [ui] tests/ui/nll/ice-106874.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ice-106874/ice-106874.stderr"
diff of stderr:

17    = note: ...but it actually implements `FnOnce<(&'1 mut V,)>`, for some specific lifetime `'1`
18    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ error: implementation of `FnOnce` is not general enough
+   --> $DIR/ice-106874.rs:8:7
+    |
+    |
+ LL |     A(B(C::new(D::new(move |st| f(st)))))
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
+    |
+    = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
+    = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`
20 error: implementation of `Fn` is not general enough
21   --> $DIR/ice-106874.rs:8:7
22    |


34    |
35    = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
36    = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`
+    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
38 error: implementation of `Fn` is not general enough
39   --> $DIR/ice-106874.rs:8:7


46    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
48 error: implementation of `FnOnce` is not general enough
-   --> $DIR/ice-106874.rs:8:9
+   --> $DIR/ice-106874.rs:8:7
50    |
50    |
51 LL |     A(B(C::new(D::new(move |st| f(st)))))
-    |         ^^^^^^ implementation of `FnOnce` is not general enough
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
53    |
54    = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
55    = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`

+    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
57 error: implementation of `Fn` is not general enough
-   --> $DIR/ice-106874.rs:8:9
+   --> $DIR/ice-106874.rs:8:7
59    |
59    |
60 LL |     A(B(C::new(D::new(move |st| f(st)))))
-    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough
62    |
63    = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`...
64    = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2`

+    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
- error: implementation of `FnOnce` is not general enough
-   --> $DIR/ice-106874.rs:8:9
-    |
-    |
- LL |     A(B(C::new(D::new(move |st| f(st)))))
-    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
-    |
-    = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
-    = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`
75 error: higher-ranked subtype error
-   --> $DIR/ice-106874.rs:8:41
+   --> $DIR/ice-106874.rs:8:7
77    |
77    |
78 LL |     A(B(C::new(D::new(move |st| f(st)))))
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80 
81 error: higher-ranked subtype error
-   --> $DIR/ice-106874.rs:8:41
-   --> $DIR/ice-106874.rs:8:41
+   --> $DIR/ice-106874.rs:8:7
83    |
84 LL |     A(B(C::new(D::new(move |st| f(st)))))
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86    |
86    |
87    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`


The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args nll/ice-106874.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ice-106874.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/nll/ice-106874" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:5
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'0 mut V)` must implement `FnOnce<(&mut V,)>`, for some specific lifetime `'0`...
   = note: ...but it actually implements `FnOnce<(&'1 mut V,)>`, for some specific lifetime `'1`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:5
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'0 mut V)` must implement `FnOnce<(&mut V,)>`, for some specific lifetime `'0`...
   = note: ...but it actually implements `FnOnce<(&'1 mut V,)>`, for some specific lifetime `'1`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`
error: implementation of `Fn` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough
   |
   = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`...
   = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `Fn` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough
   |
   = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`...
   = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `Fn` is not general enough
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough
   |
   = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`...
   = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: higher-ranked subtype error
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))

error: higher-ranked subtype error
##[error]  --> /checkout/tests/ui/nll/ice-106874.rs:8:7
   |
   |
LL |     A(B(C::new(D::new(move |st| f(st)))))
   |
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 10 previous errors
------------------------------------------



---- [ui] tests/ui/nll/local-outlives-static-via-hrtb.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/local-outlives-static-via-hrtb/local-outlives-static-via-hrtb.stderr"
diff of stderr:

33    | - `local` dropped here while still borrowed
34    |
35 note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+   --> $DIR/local-outlives-static-via-hrtb.rs:19:30
37    |
37    |
38 LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,
+    |                              ^^^^^^^^^^^^^^^^^^^^^^^
40 
41 error: aborting due to 2 previous errors
42 
---
To only update this specific test, also pass `--test-args nll/local-outlives-static-via-hrtb.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/local-outlives-static-via-hrtb.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/nll/local-outlives-static-via-hrtb" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0597]: `local` does not live long enough
##[error]  --> /checkout/tests/ui/nll/local-outlives-static-via-hrtb.rs:24:28
   |
   |
LL |     let local = 0;
   |         ----- binding `local` declared here
LL |     assert_static_via_hrtb(&local); //~ ERROR `local` does not live long enough
   |     |                      |
   |     |                      borrowed value does not live long enough
   |     argument requires that `local` is borrowed for `'static`
   |     argument requires that `local` is borrowed for `'static`
LL |     assert_static_via_hrtb_with_assoc_type(&&local); //~ ERROR `local` does not live long enough
LL | }
   | - `local` dropped here while still borrowed
   |
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
   |
   |
LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}

error[E0597]: `local` does not live long enough
##[error]  --> /checkout/tests/ui/nll/local-outlives-static-via-hrtb.rs:25:45
   |
   |
LL |     let local = 0;
   |         ----- binding `local` declared here
LL |     assert_static_via_hrtb(&local); //~ ERROR `local` does not live long enough
LL |     assert_static_via_hrtb_with_assoc_type(&&local); //~ ERROR `local` does not live long enough
   |     |                                       |
   |     |                                       borrowed value does not live long enough
   |     argument requires that `local` is borrowed for `'static`
LL | }
LL | }
   | - `local` dropped here while still borrowed
   |
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
   |
   |
LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,

error: aborting due to 2 previous errors

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


---- [ui] tests/ui/nll/missing-universe-cause-issue-114907.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/missing-universe-cause-issue-114907/missing-universe-cause-issue-114907.stderr"
diff of stderr:

38    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
40 error: higher-ranked subtype error
-   --> $DIR/missing-universe-cause-issue-114907.rs:33:21
+   --> $DIR/missing-universe-cause-issue-114907.rs:33:5
42    |
---
49 LL |     accept(callback);
-    |                     ^
+    |     ^^^^^^^^^^^^^^^^
51    |
52    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`


The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args nll/missing-universe-cause-issue-114907.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/missing-universe-cause-issue-114907.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/nll/missing-universe-cause-issue-114907" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/missing-universe-cause-issue-114907.rs:33:5
   |
   |
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: implementation of `FnOnce` is not general enough
##[error]  --> /checkout/tests/ui/nll/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: higher-ranked subtype error
##[error]  --> /checkout/tests/ui/nll/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
---
   |
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 6 previous errors
------------------------------------------


---
10 LL | |     };
-    | |_____^
+    | |     ^
+    | |     |
+    | |_____the parameter type `S` must be valid for the static lifetime...
+    |       ...so that the type `S` will meet its required lifetime bounds
+ help: consider adding an explicit lifetime bound
+    |
+    |
+ LL | pub fn negotiate<S: 'static>(link: S)
12 
13 error: aborting due to 1 previous error
14 

---
To only update this specific test, also pass `--test-args nll/snocat-regression.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/snocat-regression.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/nll/snocat-regression" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `S` may not live long enough
##[error]  --> /checkout/tests/ui/nll/snocat-regression.rs:7:5
   |
---
LL | |         let _x = link;
LL | |     };
   | |     ^
   | |     |
   | |_____the parameter type `S` must be valid for the static lifetime...
   |       ...so that the type `S` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
   |
   |
LL | pub fn negotiate<S: 'static>(link: S)

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0310`.
---
4 LL |     outlives_forall::<S>();

5    |     ^^^^^^^^^^^^^^^^^^^^^^
+    |     |
+    |     the parameter type `S` must be valid for the static lifetime...
+    |     ...so that the type `S` will meet its required lifetime bounds
+ help: consider adding an explicit lifetime bound
+    |
+    |
+ LL | fn test1<S: 'static>() {
6 
7 error: lifetime may not live long enough
8   --> $DIR/type-test-universe.rs:17:5

---
To only update this specific test, also pass `--test-args nll/type-test-universe.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/type-test-universe.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/nll/type-test-universe" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `S` may not live long enough
##[error]  --> /checkout/tests/ui/nll/type-test-universe.rs:11:5
   |
   |
LL |     outlives_forall::<S>();
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     the parameter type `S` must be valid for the static lifetime...
   |     ...so that the type `S` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
   |
   |
LL | fn test1<S: 'static>() {

error: lifetime may not live long enough
##[error]  --> /checkout/tests/ui/nll/type-test-universe.rs:17:5
   |
   |
LL | fn test2<'a>() {
   |          -- lifetime `'a` defined here
LL |     outlives_forall::<Value<'a>>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
   |
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
   |
   |
LL |     for<'u> T: 'u,

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0310`.
---
- error: `T` does not live long enough
+ error[E0310]: the parameter type `T` may not live long enough
2   --> $DIR/forall-wf-ref-reflexive.rs:12:5
3    |
4 LL |     self_wf2::<T>();
5    |     ^^^^^^^^^^^^^^^
+    |     |
+    |     the parameter type `T` must be valid for the static lifetime...
+    |     ...so that the type `T` will meet its required lifetime bounds
+    |     ...so that the type `T` will meet its required lifetime bounds
+    |
+ help: consider adding an explicit lifetime bound
+    |
+ LL | fn self_wf2<T: 'static>()
6 
7 error: aborting due to 1 previous error
8 

---
To only update this specific test, also pass `--test-args regions/forall-wf-ref-reflexive.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/regions/forall-wf-ref-reflexive.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/regions/forall-wf-ref-reflexive" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error]  --> /checkout/tests/ui/regions/forall-wf-ref-reflexive.rs:12:5
   |
   |
LL |     self_wf2::<T>();
   |     |
   |     the parameter type `T` must be valid for the static lifetime...
   |     ...so that the type `T` will meet its required lifetime bounds
   |
   |
help: consider adding an explicit lifetime bound
   |
LL | fn self_wf2<T: 'static>()

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0310`.
---
- error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
+ error: implementation of `Trait` is not general enough
2   --> $DIR/higher-ranked-regions-diag.rs:19:5
3    |
- LL | fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
-    |                      --                        ---------- opaque type defined here
-    |                      |
-    |                      hidden type `<impl for<'a> Trait<&'a ()> as Trait<&'a ()>>::Assoc` captures the lifetime `'a` as defined here
-    |     ^^^^^
+    |     ^^^^^ implementation of `Trait` is not general enough
+    |
+    |
+    = note: `impl for<'a> Trait<&'a ()>` must implement `Trait<&'a ()>`
+    = note: ...but it actually implements `Trait<&'0 ()>`, for some specific lifetime `'0`
11 error: aborting due to 1 previous error
12 

- For more information about this error, try `rustc --explain E0700`.
---
To only update this specific test, also pass `--test-args rfcs/impl-trait/higher-ranked-regions-diag.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rfcs/impl-trait/higher-ranked-regions-diag.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/rfcs/impl-trait/higher-ranked-regions-diag" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `Trait` is not general enough
##[error]  --> /checkout/tests/ui/rfcs/impl-trait/higher-ranked-regions-diag.rs:19:5
   |
   |
LL |     foo()
   |     ^^^^^ implementation of `Trait` is not general enough
   |
   = note: `impl for<'a> Trait<&'a ()>` must implement `Trait<&'a ()>`
   = note: ...but it actually implements `Trait<&'0 ()>`, for some specific lifetime `'0`
error: aborting due to 1 previous error
------------------------------------------



---- [ui] tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic/higher-ranked-regions-basic.stderr"
diff of stderr:

6 LL |     fn test() -> impl for<'a> Trait<'a, Ty = Opq<'a>> {}
8 
- error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
+ error: implementation of `Trait` is not general enough
10   --> $DIR/higher-ranked-regions-basic.rs:21:58
10   --> $DIR/higher-ranked-regions-basic.rs:21:58
11    |
12 LL |     fn test() -> impl for<'a> Trait<'a, Ty = impl Sized> {}

-    |                           --                 ----------  ^^
-    |                           |                  |
-    |                           |                  opaque type defined here
-    |                           hidden type `&'a ()` captures the lifetime `'a` as defined here
+    |                                                          ^^ implementation of `Trait` is not general enough
+    = note: `()` must implement `Trait<'a>`
+    = note: `()` must implement `Trait<'a>`
+    = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
17 
- error[E0700]: hidden type for `capture_tait::Opq0` captures lifetime that does not appear in bounds
19   --> $DIR/higher-ranked-regions-basic.rs:30:23
20    |
20    |
- LL |     type Opq0 = impl Sized;
-    |                 ---------- opaque type defined here
- LL |     type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0>;
-    |                              -- hidden type `&'b ()` captures the lifetime `'b` as defined here
- LL |     type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>;
26 LL |     fn test() -> Opq2 {}
+    |                       ^^ implementation of `Trait` is not general enough
+    |
+    |
+    = note: `&'a ()` must implement `Trait<'b>`
+    = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
29 error[E0792]: expected generic lifetime parameter, found `'a`
30   --> $DIR/higher-ranked-regions-basic.rs:39:23

35 LL |     fn test() -> Opq2 {}
35 LL |     fn test() -> Opq2 {}
36    |                       ^^
37 
- error[E0700]: hidden type for `capture_tait_complex_fail::Opq0<'a>` captures lifetime that does not appear in bounds
39   --> $DIR/higher-ranked-regions-basic.rs:49:23
40    |
40    |
- LL |     type Opq0<'a> = impl Sized;
-    |                     ---------- opaque type defined here
- LL |     type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'a>>; // <- Note 'a
-    |                              -- hidden type `&'b ()` captures the lifetime `'b` as defined here
- LL |     type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>;
46 LL |     fn test() -> Opq2 {}
+    |                       ^^ implementation of `Trait` is not general enough
+    |
+    |
+    = note: `&'a ()` must implement `Trait<'b>`
+    = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
49 error[E0792]: non-defining opaque type use in defining scope
50   --> $DIR/higher-ranked-regions-basic.rs:57:41

97 
---
To only update this specific test, also pass `--test-args rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/rfcs/type-alias-impl-trait/higher-ranked-regions-basic" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0792]: expected generic lifetime parameter, found `'a`
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:15:55
   |
   |
LL |     type Opq<'a> = impl Sized + 'a;
   |              -- this generic parameter must be used with a generic lifetime parameter
LL |     fn test() -> impl for<'a> Trait<'a, Ty = Opq<'a>> {}

error: implementation of `Trait` is not general enough
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:21:58
   |
   |
LL |     fn test() -> impl for<'a> Trait<'a, Ty = impl Sized> {}
   |                                                          ^^ implementation of `Trait` is not general enough
   |
   = note: `()` must implement `Trait<'a>`
   = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
error: implementation of `Trait` is not general enough
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:30:23
   |
LL |     fn test() -> Opq2 {}
LL |     fn test() -> Opq2 {}
   |                       ^^ implementation of `Trait` is not general enough
   |
   = note: `&'a ()` must implement `Trait<'b>`
   = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
error[E0792]: expected generic lifetime parameter, found `'a`
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:39:23
   |
   |
LL |     type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'b>>; // <- Note 'b
   |               -- this generic parameter must be used with a generic lifetime parameter
LL |     type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>;
LL |     fn test() -> Opq2 {}

error: implementation of `Trait` is not general enough
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:49:23
   |
   |
LL |     fn test() -> Opq2 {}
   |                       ^^ implementation of `Trait` is not general enough
   |
   = note: `&'a ()` must implement `Trait<'b>`
   = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
error[E0792]: non-defining opaque type use in defining scope
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:57:41
   |
   |
LL |     fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {}
   |                                         ^^^^^^^^^^^^^^^^^^^^^^ argument `'static` is not a generic parameter
note: for this opaque type
  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:56:25
   |
   |
LL |     type Opq0<'a, 'b> = impl Sized;

error[E0792]: expected generic lifetime parameter, found `'a`
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:57:65
   |
   |
LL |     type Opq0<'a, 'b> = impl Sized;
   |               -- this generic parameter must be used with a generic lifetime parameter
LL |     fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {}

error: non-defining opaque type use in defining scope
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:66:41
   |
   |
LL |     fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {}
   |                                         ^^^^^^^^^^^^^^^^^ generic argument `'a` used twice
note: for this opaque type
  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:65:25
   |
   |
LL |     type Opq0<'a, 'b> = impl Sized;

error[E0792]: expected generic lifetime parameter, found `'a`
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:66:60
   |
   |
LL |     type Opq0<'a, 'b> = impl Sized;
   |               -- this generic parameter must be used with a generic lifetime parameter
LL |     fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {}

error[E0792]: expected generic lifetime parameter, found `'a`
##[error]  --> /checkout/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs:76:23
   |
   |
LL |     type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'a, 'b>>;
   |               -- this generic parameter must be used with a generic lifetime parameter
LL |     type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>;
LL |     fn test() -> Opq2 {}

error: aborting due to 10 previous errors

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


---- [ui] tests/ui/type-alias-impl-trait/nested-tait-hrtb.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/type-alias-impl-trait/nested-tait-hrtb/nested-tait-hrtb.stderr"


- error[E0700]: hidden type for `WithoutLt` captures lifetime that does not appear in bounds
2   --> $DIR/nested-tait-hrtb.rs:7:62
3    |
- LL | type WithoutLt = impl Sized;
-    |                  ---------- opaque type defined here
-    |                  ---------- opaque type defined here
6 LL | fn without_lt() -> impl for<'a> Trait<'a, Assoc = WithoutLt> {}
-    |                             |
-    |                             hidden type `&'a str` captures the lifetime `'a` as defined here
+    |                                                              ^^ implementation of `Trait` is not general enough
+    |
+    |
+    = note: `()` must implement `Trait<'a>`
+    = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
11 error[E0792]: expected generic lifetime parameter, found `'a`
12   --> $DIR/nested-tait-hrtb.rs:12:60

19 
---
To only update this specific test, also pass `--test-args type-alias-impl-trait/nested-tait-hrtb.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/type-alias-impl-trait/nested-tait-hrtb.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--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/type-alias-impl-trait/nested-tait-hrtb" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error: implementation of `Trait` is not general enough
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/nested-tait-hrtb.rs:7:62
   |
   |
LL | fn without_lt() -> impl for<'a> Trait<'a, Assoc = WithoutLt> {}
   |                                                              ^^ implementation of `Trait` is not general enough
   = note: `()` must implement `Trait<'a>`
   = note: `()` must implement `Trait<'a>`
   = note: ...but it actually implements `Trait<'0>`, for some specific lifetime `'0`
error[E0792]: expected generic lifetime parameter, found `'a`
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/nested-tait-hrtb.rs:12:60
   |
LL | type WithLt<'a> = impl Sized + 'a;
LL | type WithLt<'a> = impl Sized + 'a;
   |             -- this generic parameter must be used with a generic lifetime parameter
LL |
LL | fn with_lt() -> impl for<'a> Trait<'a, Assoc = WithLt<'a>> {}

error: aborting due to 2 previous errors

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

@lqd
Copy link
Member

lqd commented Nov 6, 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 Nov 6, 2024
@bors
Copy link
Contributor

bors commented Nov 6, 2024

⌛ Trying commit 372912b with merge f258cb4...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 6, 2024
…mpletely, r=<try>

[WIP] Remove placeholders completely

This PR does shotgun surgery on borrowck to remove all special handling of placeholders, completely replacing them with a preprocessing step that rewrites placeholder leaks into constraints, removing constraint propagation of placeholders and all logic used to detect placeholder violations during error reporting. This finishes what rust-lang#123720 started.

The new method works like this:
1. during SCC construction, some information about SCC membership and reachability is retained
2. just after SCC construction, a constraint `r - (from: to_invalid) - > 'static` is added when `r` is the representative of an SCC and
   1. that SCC either has had its universe shrunk because it reaches a region with a smaller one (in which case `to_invalid` is the smallest-universed region it reaches), or if it reaches a region with a too large universe that isn't part of the SCC (in which case `to_invalid` is the region with a too large universe). In either case, `from` is also `r`.
 2.  some region `reaches` in `r`'s SCC reaches another placeholder, `reached`, in which case the added constraint is `r -> (reaches: reached) 'static`. Through clever choice of defaults (chosing minimum elements), `reached` will be `r` if at all possible.

When tracing errors for diagnostics one of these special constraints along a path are treated much like a HTTP redirect: if we are explaining `from: to` and reach an edge with `reaches: invalid` we stop the search and start following `reaches: invalid` instead. When doing this the implicit edges `x: 'static` for every region `x` are ignored, since the search would otherwise be able to cheat by going through 'static and re-find the same edge again.

A bunch of optimisations are possible:
- ~~Conservatively add constraints, e.g. one per SCC. May worsen error tracing!~~
- as a final pass, allow fusing the annotations for the SCC after adding the extra constraints to remove unnecessary information and save memory. This could be done cheaply since we already iterate over the entire set of SCCs.
- currently, if constraints are added the entire set of SCCs are recomputed. This is of course rather wasteful, and we could do better. Especially since SCCs are added in dependency order. This would require a fully separate SCC module since the dynamic SCC combo we'd need now shares almost no properties with regular SCC computation. Given that this is meant to be a temporary work-around, that seems like too much work.

There are a bunch of rather nice bonuses:
- We now don't need to expose region indices in `MirTypeckRegionConstraints` to the entire crate. The only entry point is `placeholder_region()` so correctness of the indices is now guaranteed
- A lot of things that were previously iterations over lists is now a single lookup
- The constraint graph search functions are simple and at least one of them can now take a proper region as target rather than a predicate function. The only case that needs the predicate argument  to `find_constraint_path_to()` is `find_sub_region_live_at()`, which may or may not be possible to work around.

 r​? nikomatsakis
@bors
Copy link
Contributor

bors commented Nov 7, 2024

☀️ Try build successful - checks-actions
Build commit: f258cb4 (f258cb4ee077baf55eeeeeb97c1e687107a2cc64)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f258cb4): comparison URL.

Overall result: ✅ improvements - BENCHMARK(S) FAILED

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

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

  • image-0.24.1

❗ ❗ ❗ ❗ ❗

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.2%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-2.6% [-3.7%, -1.5%] 2
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Cycles

Results (secondary -6.9%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.9% [-7.7%, -5.9%] 6
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 781.244s -> 779.734s (-0.19%)
Artifact size: 335.32 MiB -> 335.31 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

8 participants