Wrap dyn type with parentheses in suggestion
Close #120223
Fix wrong suggestion that is grammatically incorrect. Specifically, I added parentheses to dyn types that need lifetime bound.
help: consider adding an explicit lifetime bound
|
4 | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
| + +++++++++++
r? @fmease
rustbot has assigned @fmease. 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
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_9e4bd9cd-e473-43ff-8e67-3695ef0efbee
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=wrap-dyn-in-suggestion
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_9e4bd9cd-e473-43ff-8e67-3695ef0efbee
GITHUB_REF=refs/pull/120929/merge
GITHUB_REF_NAME=120929/merge
GITHUB_REF_PROTECTED=false
---
#12 writing image sha256:658257e60ca840af085cd5e32da6d43a138e1a8803ee9583a39bbc5c07673b93 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.1s
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Sun Feb 11 12:23:05 UTC 2024
network time: Sun, 11 Feb 2024 12:23:06 GMT
network time: Sun, 11 Feb 2024 12:23:06 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
.......................ii.................i......i..i................................... 9592/16136
............................................i........................................... 9680/16136
......................................................................F................. 9768/16136
........................................................................................ 9856/16136
.............................................................F.......................... 9944/16136
.........................F....F.FF...........F.F....F................................... 10032/16136
......................ii................................................................ 10208/16136
........................................................................................ 10296/16136
........................................................................................ 10384/16136
..........................i.............................................i............... 10472/16136
---
........................................................................................ 11704/16136
......................ii................i.....iii....................................... 11792/16136
........................................................................................ 11880/16136
........................................................................................ 11968/16136
....................................FF......................................F........... 12056/16136
.F...................................................................................... 12144/16136
........................................................................................ 12320/16136
........................................................................................ 12408/16136
........................................................................................ 12496/16136
........................................................................................ 12584/16136
---
..................................................................................i..... 13464/16136
........................................................................................ 13552/16136
........................................................................................ 13640/16136
........................................................................................ 13728/16136
..................................................................F..................... 13816/16136
.....................................FF......F.......................................... 13904/16136
..........................................................F............................. 13992/16136
.....i..........................i....................................................... 14168/16136
........................................................................................ 14256/16136
........................................................................................ 14344/16136
........................................................................................ 14432/16136
---
14 | ^^^^^^^
15 help: consider adding an explicit lifetime bound
16 |
- LL | impl <T: Sync + 'static> Foo for T { }
- | +++++++++
+ LL | impl <T: Sync+ 'static> Foo for T { }
19
20 error: aborting due to 1 previous error
21
---
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs:10:16
|
LL | impl <T: Sync> Foo for T { }
| |
| the parameter type `T` must be valid for the static lifetime...
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds...
note: ...that is required by this bound
--> /checkout/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs:6:24
|
|
LL | trait Foo : Sized+Sync+'static {
| ^^^^^^^
help: consider adding an explicit lifetime bound
|
|
LL | impl <T: Sync+ 'static> Foo for T { }
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
---
124 |
125 help: consider adding an explicit lifetime bound
126 |
- LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {
- | +++++++++
+ LL | fn ty_param_wont_outlive_static<T:Debug+ 'static>(x: T) -> impl Debug + 'static {
129
130 error: lifetime may not live long enough
131 --> $DIR/must_outlive_least_region_or_bound.rs:18:41
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
|
|
LL | fn elided(x: &i32) -> impl Copy { x }
| | |
| | opaque type defined here
| | opaque type defined here
| hidden type `&i32` captures the anonymous lifetime defined here
|
help: to declare that `impl Copy` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
|
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
| | |
| | opaque type defined here
| | opaque type defined here
| hidden type `&'a i32` captures the lifetime `'a` as defined here
|
help: to declare that `impl Copy` captures `'a`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:9:46
|
|
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
| - ^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:12:55
|
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
|
help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
error[E0621]: explicit lifetime required in the type of `x`
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:15:41
|
|
LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
| ---- ^ lifetime `'a` required
| |
| help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:30:55
|
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
| - ^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
| ++++
help: to declare that `impl Debug` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:36:69
|
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
|
help: consider changing `impl LifetimeTrait<'a> + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x }
error[E0700]: hidden type for `impl Fn(&'a u32)` captures lifetime that does not appear in bounds
|
|
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
| -- ---------------- opaque type defined here
| |
| hidden type `{closure@/checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:42:5: 42:13}` captures the lifetime `'b` as defined here
LL | move |_| println!("{}", y)
|
|
help: to declare that `impl Fn(&'a u32)` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b {
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:47:5
|
|
LL | x
| ^
| |
| 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 ty_param_wont_outlive_static<T:Debug+ 'static>(x: T) -> impl Debug + 'static {
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:18:41
|
|
LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
| - ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:21:50
|
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
| -- lifetime `'a` defined here ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:24:51
|
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| - ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:27:60
|
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| -- lifetime `'a` defined here ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
|
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit4<'a>(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
error: aborting due to 13 previous errors
Some errors have detailed explanations: E0310, E0621, E0700.
---
35 |
36 help: consider adding an explicit lifetime bound
37 |
- LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b + 'a>() {
- | ++++
+ LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b+ 'a>() {
40
40
41 error[E0309]: the parameter type `K` may not live long enough
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lifetimes/lifetime-doesnt-live-long-enough/lifetime-doesnt-live-long-enough.stderr
---
|
LL | foo: &'static T
| ^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the reference type `&'static T` does not outlive the data it points at
help: consider adding an explicit lifetime bound
|
LL | struct Foo<T: 'static> {
| +++++++++
| +++++++++
error[E0309]: the parameter type `K` may not live long enough
|
|
LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
| -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
| |
| the parameter type `K` must be valid for the lifetime `'a` as defined here...
help: consider adding an explicit lifetime bound
|
|
LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() where K: 'a {
error[E0309]: the parameter type `M` may not live long enough
##[error] --> /checkout/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.rs:44:36
|
|
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
| -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
| |
| the parameter type `M` must be valid for the lifetime `'a` as defined here...
help: consider adding an explicit lifetime bound
|
|
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b+ 'a>() {
error[E0309]: the parameter type `K` may not live long enough
|
|
LL | fn foo<'a, L: X<&'a Nested<K>>>();
| -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
| |
| the parameter type `K` must be valid for the lifetime `'a` as defined here...
help: consider adding an explicit lifetime bound
|
|
LL | fn foo<'a, L: X<&'a Nested<K>>>() where K: 'a;
error[E0309]: the parameter type `Self` may not live long enough
##[error] --> /checkout/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.rs:28:19
|
|
LL | fn bar<'a, L: X<&'a Nested<Self>>>();
| -- ^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
| |
| the parameter type `Self` must be valid for the lifetime `'a` as defined here...
help: consider adding an explicit lifetime bound
|
|
LL | fn bar<'a, L: X<&'a Nested<Self>>>() where Self: 'a;
error[E0309]: the parameter type `L` may not live long enough
##[error] --> /checkout/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.rs:32:22
|
|
LL | fn baz<'a, L, M: X<&'a Nested<L>>>() {
| -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
| |
| the parameter type `L` must be valid for the lifetime `'a` as defined here...
help: consider adding an explicit lifetime bound
|
|
LL | fn baz<'a, L: 'a, M: X<&'a Nested<L>>>() {
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0309, E0310.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | impl<T: Copy + 'static> F for T {}
- | +++++++++
+ LL | impl<T: Copy+ 'static> F for T {}
14
15 error: aborting due to 1 previous error
16
---
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs:14:21
|
LL | impl<T: Copy> F for T {}
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 | impl<T: Copy+ 'static> F for T {}
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
---
33 |
34 help: consider adding an explicit lifetime bound
35 |
- LL | T: Trait<'a> + 'a,
- | ++++
+ LL | T: Trait<'a>+ 'a,
38
39 error: aborting due to 1 previous error
40
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match/propagate-from-trait-match.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-from-trait-match.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs:32:36
|
|
LL | establish_relationships(value, |value| {
|
|
= note: defining type: supply::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((T,)),
(),
]
= note: number of external vids: 2
= note: where T: '?1
note: no external requirements
--> /checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs:28:1
|
|
LL | / fn supply<'a, T>(value: T)
LL | | T: Trait<'a>,
| |_________________^
|
|
= note: defining type: supply::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs:43:9
|
|
LL | fn supply<'a, T>(value: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | require(value);
LL | require(value);
| ^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: Trait<'a>+ 'a,
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0309`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: 'b + 'a,
- | ++++
+ LL | T: 'b+ 'a,
14
15 error[E0309]: the parameter type `T` may not live long enough
16 --> $DIR/min-choice-reject-ambiguous.rs:28:5
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | T: 'c + 'a,
- | ++++
+ LL | T: 'c+ 'a,
28
28
29 error[E0700]: hidden type for `impl Cap<'b> + Cap<'c>` captures lifetime that does not appear in bounds
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/member-constraints/min-choice-reject-ambiguous/min-choice-reject-ambiguous.stderr
---
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.rs:17:5
|
LL | fn test_b<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | type_test::<'_, T>() // This should pass if we pick 'b.
| ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b+ 'a,
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.rs:28:5
|
|
LL | fn test_c<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | type_test::<'_, T>() // This should pass if we pick 'c.
| ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'c+ 'a,
error[E0700]: hidden type for `impl Cap<'b> + Cap<'c>` captures lifetime that does not appear in bounds
|
|
LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c>
| -- ---------------------- opaque type defined here
| |
| hidden type `&'a u8` captures the lifetime `'a` as defined here
LL | s
| ^
|
|
help: to declare that `impl Cap<'b> + Cap<'c>` captures `'a`, you can add an explicit `'a` lifetime bound
|
LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> + 'a
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0309, E0700.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: Debug + 'a,
- | ++++
+ LL | T: Debug+ 'a,
14
15 error[E0309]: the parameter type `T` may not live long enough
16 --> $DIR/impl-trait-outlives.rs:26:5
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | T: 'b + Debug + 'a,
- | ++++
+ LL | T: 'b + Debug+ 'a,
28
29 error: aborting due to 2 previous errors
30
---
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/impl-trait-outlives.rs:11:5
|
LL | fn no_region<'a, T>(x: Box<T>) -> impl Debug + 'a
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: Debug+ 'a,
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/impl-trait-outlives.rs:26:5
|
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> impl Debug + 'a
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b + Debug+ 'a,
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn generic2<T: Iterator + 'static>(value: T) {
- | +++++++++
+ LL | fn generic2<T: Iterator+ 'static>(value: T) {
14
15 error: aborting due to 1 previous error
16
---
To only update this specific test, also pass `--test-args nll/ty-outlives/projection-implied-bounds.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/projection-implied-bounds.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-implied-bounds" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-implied-bounds/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-implied-bounds.rs:30:36
|
|
LL | twice(value, |value_ref, item| invoke2(value_ref, item));
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 generic2<T: Iterator+ 'static>(value: T) {
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
---
35 |
36 help: consider adding an explicit lifetime bound
37 |
- LL | T: Anything<'b> + 'a,
- | ++++
+ LL | T: Anything<'b>+ 'a,
40
41 error: lifetime may not live long enough
42 --> $DIR/projection-one-region-closure.rs:45:39
88 |
89 help: consider adding an explicit lifetime bound
90 |
- LL | T: Anything<'b> + 'a,
- | ++++
+ LL | T: Anything<'b>+ 'a,
93
94 error: lifetime may not live long enough
95 --> $DIR/projection-one-region-closure.rs:56:39
---
To only update this specific test, also pass `--test-args nll/ty-outlives/projection-one-region-closure.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:45:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: no_relationships_late::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
= note: late-bound region is '?3
= note: late-bound region is '?3
= note: number of external vids: 4
= note: where T: '?2
= note: where '?1: '?2
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:41:1
|
|
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
|
|
= note: defining type: no_relationships_late::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:45:39
|
|
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: Anything<'b>+ 'a,
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:45:39
|
|
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:56:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: no_relationships_early::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where T: '?3
= note: where '?2: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:51:1
|
|
LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
|
|
= note: defining type: no_relationships_early::<'?1, '?2, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:56:39
|
|
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: Anything<'b>+ 'a,
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:56:39
|
|
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:70:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: projection_outlives::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where <T as Anything<'?2>>::AssocType: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:62:1
|
|
LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
|
|
= note: defining type: projection_outlives::<'?1, '?2, T>
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:80:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: elements_outlive::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where T: '?3
= note: where '?2: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:74:1
|
|
LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T: 'a,
LL | | 'b: 'a,
|
|
= note: defining type: elements_outlive::<'?1, '?2, T>
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0309`.
------------------------------------------
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: MyTrait<'a> + 'a,
- | ++++
+ LL | T: MyTrait<'a>+ 'a,
14
15 error: aborting due to 1 previous error
16
---
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-where-clause-none.rs:14:5
|
LL | fn foo<'a, T>() -> &'a ()
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | bar::<T::Output>() //~ ERROR the parameter type `T` may not live long enough
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: MyTrait<'a>+ 'a,
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0309`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: Debug + 'a,
- | ++++
+ LL | T: Debug+ 'a,
14
15 error[E0309]: the parameter type `T` may not live long enough
16 --> $DIR/ty-param-fn.rs:24:5
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | T: 'b + Debug + 'a,
- | ++++
+ LL | T: 'b + Debug+ 'a,
28
29 error: aborting due to 2 previous errors
30
---
To only update this specific test, also pass `--test-args nll/ty-outlives/ty-param-fn.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/ty-param-fn.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-fn" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-fn/auxiliary"
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-fn.rs:9:5
|
|
LL | fn no_region<'a, T>(x: Box<T>) -> Box<Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: Debug+ 'a,
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-fn.rs:24:5
|
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b + Debug+ 'a,
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
33 |
34 help: consider adding an explicit lifetime bound
35 |
- LL | T: Debug + 'a,
- | ++++
+ LL | T: Debug+ 'a,
38
39 error[E0309]: the parameter type `T` may not live long enough
40 --> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5
47 |
48 help: consider adding an explicit lifetime bound
49 |
- LL | T: 'b + Debug + 'a,
- | ++++
+ LL | T: 'b + Debug+ 'a,
52
53 error: aborting due to 2 previous errors
54
---
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:26:23
|
LL | with_signature(x, |y| y)
|
|
= note: defining type: no_region::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '?2)>,
(),
]
= note: number of external vids: 3
= note: where T: '?2
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:15:1
|
|
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
LL | | T: Debug,
| |_____________^
|
|
= note: defining type: no_region::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:26:27
|
|
LL | fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | with_signature(x, |y| y)
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: Debug+ 'a,
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:41:5
|
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b + Debug+ 'a,
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
95 |
96 help: consider adding an explicit lifetime bound
97 |
- LL | T: 'b + 'a,
- | ++++
+ LL | T: 'b+ 'a,
100
101 note: external requirements
102 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
---
To only update this specific test, also pass `--test-args nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:27:26
|
|
LL | with_signature(a, b, |x, y| {
|
|
= note: defining type: no_region::<T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?1 ()>, T)),
(),
= note: late-bound region is '?2
= note: late-bound region is '?2
= note: number of external vids: 3
= note: where T: '?1
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:26:1
|
|
LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
|
= note: defining type: no_region::<T>
error[E0309]: the parameter type `T` may not live long enough
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:32:9
|
LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | require(&x, &y)
| ^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn no_region<'a, T: 'a>(a: Cell<&'a ()>, b: T) {
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:42:26
|
|
LL | with_signature(a, b, |x, y| {
|
|
= note: defining type: correct_region::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
]
= note: number of external vids: 3
= note: where T: '?2
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:38:1
|
|
LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
LL | | T: 'a,
| |__________^
|
|
= note: defining type: correct_region::<'?1, T>
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:63:26
|
|
LL | with_signature(a, b, |x, y| {
|
|
= note: defining type: wrong_region::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
= note: late-bound region is '?3
= note: late-bound region is '?3
= note: number of external vids: 4
= note: where T: '?2
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:59:1
|
|
LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
|
|
= note: defining type: wrong_region::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:65:9
|
|
LL | fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | require(&x, &y)
| ^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b+ 'a,
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:76:26
|
|
LL | with_signature(a, b, |x, y| {
|
|
= note: defining type: outlives_region::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where T: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:71:1
|
|
LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
LL | | 'b: 'a,
|
|
= note: defining type: outlives_region::<'?1, '?2, T>
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
------------------------------------------
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn make_object1<A: SomeTrait + 'static>(v: A) -> Box<dyn SomeTrait + 'static> {
- | +++++++++
+ LL | fn make_object1<A: SomeTrait+ 'static>(v: A) -> Box<dyn SomeTrait + 'static> {
14
15 error[E0309]: the parameter type `A` may not live long enough
16 --> $DIR/regions-close-over-type-parameter-1.rs:20:5
22 |
23 help: consider adding an explicit lifetime bound
24 |
- LL | fn make_object3<'a, 'b, A: SomeTrait + 'a + 'b>(v: A) -> Box<dyn SomeTrait + 'b> {
- | ++++
+ LL | fn make_object3<'a, 'b, A: SomeTrait + 'a+ 'b>(v: A) -> Box<dyn SomeTrait + 'b> {
27
28 error: aborting due to 2 previous errors
29
---
To only update this specific test, also pass `--test-args regions/regions-close-over-type-parameter-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/regions/regions-close-over-type-parameter-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-close-over-type-parameter-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-close-over-type-parameter-1/auxiliary"
--- stderr -------------------------------
error[E0310]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-over-type-parameter-1.rs:11:5
|
|
LL | Box::new(v) as Box<dyn SomeTrait + 'static>
| |
| the parameter type `A` must be valid for the static lifetime...
| the parameter type `A` must be valid for the static lifetime...
| ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn make_object1<A: SomeTrait+ 'static>(v: A) -> Box<dyn SomeTrait + 'static> {
error[E0309]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-over-type-parameter-1.rs:20:5
|
|
LL | fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box<dyn SomeTrait + 'b> {
| -- the parameter type `A` must be valid for the lifetime `'b` as defined here...
LL | Box::new(v) as Box<dyn SomeTrait + 'b>
| ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn make_object3<'a, 'b, A: SomeTrait + 'a+ 'b>(v: A) -> Box<dyn SomeTrait + 'b> {
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0309, E0310.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | where T : X + 'static
- | +++++++++
+ LL | where T : X+ 'static
14
15 error[E0310]: the parameter type `T` may not live long enough
16 --> $DIR/regions-close-param-into-object.rs:12:5
37 |
38 help: consider adding an explicit lifetime bound
39 |
- LL | where T : X + 'a
- | ++++
+ LL | where T : X+ 'a
42
43 error[E0309]: the parameter type `T` may not live long enough
44 --> $DIR/regions-close-param-into-object.rs:24:5
---
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:6:5
|
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 | where T : X+ 'static
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:12:5
|
|
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 p2<T: 'static>(v: Box<T>) -> Box<dyn X + 'static>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:18:5
|
|
LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | where T : X+ 'a
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:24:5
|
|
LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn p4<'a,T: 'a>(v: Box<T>) -> Box<dyn X + 'a>
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0309, E0310.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn func<'x, T:Trait1<'x> + 'x>(t: &'x T::Foo)
- | ++++
+ LL | fn func<'x, T:Trait1<'x>+ 'x>(t: &'x T::Foo)
14
15 error: aborting due to 1 previous error
16
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-implied-bounds-projection-gap-1/regions-implied-bounds-projection-gap-1.stderr
To only update this specific test, also pass `--test-args regions/regions-implied-bounds-projection-gap-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/regions/regions-implied-bounds-projection-gap-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-implied-bounds-projection-gap-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-implied-bounds-projection-gap-1/auxiliary"
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-implied-bounds-projection-gap-1.rs:16:5
|
|
LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo)
| -- the parameter type `T` must be valid for the lifetime `'x` as defined here...
LL | {
LL | wf::<&'x T>();
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn func<'x, T:Trait1<'x>+ 'x>(t: &'x T::Foo)
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0309`.
---
21 |
22 help: consider adding an explicit lifetime bound
23 |
- LL | fn bar2<'a,'b,A:Is<'b> + 'a>(x: Inv<'a>, y: Inv<'b>, a: A) {
- | ++++
+ LL | fn bar2<'a,'b,A:Is<'b>+ 'a>(x: Inv<'a>, y: Inv<'b>, a: A) {
26
27 error: aborting due to 2 previous errors
28
---
--- stderr -------------------------------
error[E0309]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-infer-bound-from-trait.rs:33:5
|
LL | fn bar1<'a,A>(x: Inv<'a>, a: A) {
| -- the parameter type `A` must be valid for the lifetime `'a` as defined here...
LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) {
error[E0309]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-infer-bound-from-trait.rs:37:5
|
|
LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
| -- the parameter type `A` must be valid for the lifetime `'a` as defined here...
LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar2<'a,'b,A:Is<'b>+ 'a>(x: Inv<'a>, y: Inv<'b>, a: A) {
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
+ LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
14
15 error: aborting due to 1 previous error
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-120223/issue-120223.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/issue-120223.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/issue-120223.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-120223" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-120223/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0310]: the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` may not live long enough
|
|
LL | Box::new(executor) //~ ERROR the parameter type
| |
| |
| the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` must be valid for the static lifetime...
| ...so that the type `impl FnOnce(T) -> dyn Future<Output = ()>` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + 'a {
- | ++++ ++++ ++ ~~
+ LL | fn foo<'a>(d: impl Sized+ 'a, p: &'a mut ()) -> impl Sized + 'a {
+ | ++++ ++++ ++ ~~
15 error[E0309]: the parameter type `impl Sized` may not live long enough
16 --> $DIR/issue-105544.rs:15:5
23 |
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ {
- | ++++
+ LL | fn foo1<'b>(d: impl Sized+ 'b, p: &'b mut ()) -> impl Sized + '_ {
28
29 error[E0311]: the parameter type `impl Sized + 'a` may not live long enough
30 --> $DIR/issue-105544.rs:21:5
37 |
38 help: consider adding an explicit lifetime bound
39 |
- LL | fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + 'b {
- | +++ ++++ ++ ~~
+ LL | fn foo2<'b, 'a>(d: impl Sized + 'a+ 'b, p: &'b mut ()) -> impl Sized + 'b {
+ | +++ ++++ ++ ~~
43 error[E0311]: the parameter type `T` may not live long enough
44 --> $DIR/issue-105544.rs:28:5
51 |
51 |
52 help: consider adding an explicit lifetime bound
53 |
- LL | fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a {
- | +++ ++++ ++ ~~
+ LL | fn bar<'a, T : Sized+ 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a {
+ | +++ ++++ ++ ~~
57 error[E0309]: the parameter type `T` may not live long enough
58 --> $DIR/issue-105544.rs:36:5
65 |
65 |
66 help: consider adding an explicit lifetime bound
67 |
- LL | fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
- | ++++
+ LL | fn bar1<'b, T : Sized+ 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
70
71 error[E0311]: the parameter type `T` may not live long enough
72 --> $DIR/issue-105544.rs:42:5
79 |
80 help: consider adding an explicit lifetime bound
81 |
- LL | fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b {
- | +++ ++++ ++ ~~
+ LL | fn bar2<'b, 'a, T : Sized + 'a+ 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b {
+ | +++ ++++ ++ ~~
85 error: aborting due to 6 previous errors
86
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544/issue-105544.stderr
diff of fixed:
2
3 #![allow(warnings)]
4
- fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
+ fn foo<'a>(d: impl Sized+ 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
6 //~^ HELP consider adding an explicit lifetime bound
7 (d, p)
8 //~^ ERROR the parameter type `impl Sized` may not live long enough
9 //~| NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
11
11
- fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ {
+ fn foo1<'b>(d: impl Sized+ 'b, p: &'b mut ()) -> impl Sized + '_ {
13 //~^ NOTE the parameter type `impl Sized` must be valid for the lifetime `'b` as defined here...
14 //~| HELP consider adding an explicit lifetime bound
15 (d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
16 //~^ ERROR the parameter type `impl Sized` may not live long enough
18
18
- fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
+ fn foo2<'b, 'a>(d: impl Sized + 'a+ 'b, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
20 //~^ HELP consider adding an explicit lifetime bound
21 (d, p)
22 //~^ ERROR the parameter type `impl Sized + 'a` may not live long enough
23 //~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
25
25
- fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
+ fn bar<'a, T : Sized+ 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
27 //~^ HELP consider adding an explicit lifetime bound
28 (d, p)
29 //~^ ERROR the parameter type `T` may not live long enough
30 //~| NOTE ...so that the type `T` will meet its required lifetime bounds
32
32
- fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
+ fn bar1<'b, T : Sized+ 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
34 //~^ NOTE the parameter type `T` must be valid for the lifetime `'b` as defined here...
35 //~| HELP consider adding an explicit lifetime bound
36 (d, p) //~ NOTE ...so that the type `T` will meet its required lifetime bounds
37 //~^ ERROR the parameter type `T` may not live long enough
39
39
- fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
+ fn bar2<'b, 'a, T : Sized + 'a+ 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
41 //~^ HELP consider adding an explicit lifetime bound
42 (d, p)
43 //~^ ERROR the parameter type `T` may not live long enough
The actual fixed differed from the expected fixed.
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544/issue-105544.fixed
To only update this specific test, also pass `--test-args suggestions/lifetimes/issue-105544.rs`
error: 2 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/lifetimes/issue-105544.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544/auxiliary"
--- stderr -------------------------------
error[E0311]: the parameter type `impl Sized` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:7:5
|
|
LL | fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime ...
| ------- the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo<'a>(d: impl Sized+ 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
| ++++ ++++ ++ ~~
error[E0309]: the parameter type `impl Sized` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:15:5
|
|
LL | fn foo1<'b>(d: impl Sized, p: &'b mut ()) -> impl Sized + '_ {
| -- the parameter type `impl Sized` must be valid for the lifetime `'b` as defined here...
...
LL | (d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
| ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo1<'b>(d: impl Sized+ 'b, p: &'b mut ()) -> impl Sized + '_ {
error[E0311]: the parameter type `impl Sized + 'a` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:21:5
|
|
LL | fn foo2<'a>(d: impl Sized + 'a, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anon...
| ------- the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo2<'b, 'a>(d: impl Sized + 'a+ 'b, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
| +++ ++++ ++ ~~
error[E0311]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:28:5
|
|
LL | fn bar<T : Sized>(d: T, p: & mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime define...
| -------- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar<'a, T : Sized+ 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
| +++ ++++ ++ ~~
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:36:5
|
|
LL | fn bar1<'b, T : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ {
| -- the parameter type `T` must be valid for the lifetime `'b` as defined here...
...
LL | (d, p) //~ NOTE ...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 bar1<'b, T : Sized+ 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
error[E0311]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:42:5
|
|
LL | fn bar2<'a, T : Sized + 'a>(d: T, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifeti...
| ------- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar2<'b, 'a, T : Sized + 'a+ 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
| +++ ++++ ++ ~~
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0309, E0311.
For more information about an error, try `rustc --explain E0309`.
---
11 |
12 help: consider adding an explicit lifetime bound
13 |
- LL | fn func<'a, T: Test + 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
- | +++ ++++ ++++
+ LL | fn func<'a, T: Test+ 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
16
17 error: aborting due to 1 previous error
18
---
19 fn test(&self);
20 }
21
- fn func<'a, T: Test + 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
+ fn func<'a, T: Test+ 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
23 foo.bar(move |_| {
24 //~^ ERROR the parameter type `T` may not live long enough
25 t.test();
The actual fixed differed from the expected fixed.
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2/missing-lifetimes-in-signature-2.fixed
To only update this specific test, also pass `--test-args suggestions/lifetimes/missing-lifetimes-in-signature-2.rs`
error: 2 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2/auxiliary"
--- stderr -------------------------------
error[E0311]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs:23:5
|
|
LL | fn func<T: Test>(_dummy: &Foo, foo: &Foo, t: T) {
| --- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL | / foo.bar(move |_| {
LL | | //~^ ERROR the parameter type `T` may not live long enough
LL | | t.test();
LL | | });
| |______^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn func<'a, T: Test+ 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0311`.
For more information about this error, try `rustc --explain E0311`.
------------------------------------------
---- [ui] tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs stdout ----
diff of stderr:
41 |
42 LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
43 LL | where
- LL ~ G: Get<T> + 'a,
+ LL ~ G: Get<T>+ 'a,
46
46
47 error[E0311]: the parameter type `G` may not live long enough
58 |
59 help: consider adding an explicit lifetime bound
60 |
60 |
- LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b
- | +++ ++++ ++ ~~
+ LL | fn qux<'b, 'a, G: 'a+ 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b
+ | +++ ++++ ++ ~~
63
64 error[E0311]: the parameter type `G` may not live long enough
74 |
75 help: consider adding an explicit lifetime bound
76 |
76 |
- LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + 'c {
- | +++ ++++ ++ ~~
+ LL | fn qux<'c, 'b, G: Get<T> + 'b+ 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + 'c {
+ | +++ ++++ ++ ~~
79
80 error[E0311]: the parameter type `G` may not live long enough
92 |
93 help: consider adding an explicit lifetime bound
94 |
94 |
- LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b + 'a
- | +++ ++++ ++ ~~
+ LL | fn bat<'b, 'a, G: 'a+ 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b + 'a
+ | +++ ++++ ++ ~~
98 error[E0621]: explicit lifetime required in the type of `dest`
99 --> $DIR/missing-lifetimes-in-signature.rs:73:5
122 |
122 |
123 help: consider adding an explicit lifetime bound
124 |
- LL | G: Get<T> + 'a,
- | ++++
+ LL | G: Get<T>+ 'a,
127
128 error: aborting due to 8 previous errors
129
---
--- stderr -------------------------------
error[E0261]: use of undeclared lifetime name `'a`
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:37:11
|
LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `'a,`
error[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds
|
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
| ------ ------------- opaque type defined here
| |
| hidden type `{closure@/checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:19:5: 19:12}` captures the anonymous lifetime defined here
LL | / move || {
LL | / move || {
LL | | //~^ ERROR hidden type for `impl FnOnce()` captures lifetime
LL | | *dest = g.get();
| |_____^
|
|
help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
error[E0311]: the parameter type `G` may not live long enough
|
|
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
LL | where
LL ~ G: Get<T>+ 'a,
error[E0311]: the parameter type `G` may not live long enough
|
|
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn qux<'b, 'a, G: 'a+ 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b
| +++ ++++ ++ ~~
error[E0311]: the parameter type `G` may not live long enough
|
|
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_________^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn qux<'c, 'b, G: Get<T> + 'b+ 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + 'c {
| +++ ++++ ++ ~~
error[E0311]: the parameter type `G` may not live long enough
|
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | //~| ERROR explicit lifetime required
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bat<'b, 'a, G: 'a+ 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b + 'a
| +++ ++++ ++ ~~
error[E0621]: explicit lifetime required in the type of `dest`
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:73:5
|
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | //~| ERROR explicit lifetime required
LL | | *dest = g.get();
LL | | }
| |_____^ lifetime `'a` required
error[E0309]: the parameter type `G` may not live long enough
|
|
LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
| -- the parameter type `G` must be valid for the lifetime `'a` as defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | G: Get<T>+ 'a,
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0261, E0309, E0311, E0621, E0700.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn foo(d: impl Debug + 'static) {
- | +++++++++
+ LL | fn foo(d: impl Debug+ 'static) {
14
15 error: aborting due to 1 previous error
16
---
2
3 use std::fmt::Debug;
4
- fn foo(d: impl Debug + 'static) {
+ fn foo(d: impl Debug+ 'static) {
6 //~^ HELP consider adding an explicit lifetime bound
7 bar(d);
8 //~^ ERROR the parameter type `impl Debug` may not live long enough
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-impl-trait-lifetime/suggest-impl-trait-lifetime.fixed
To update references, rerun the tests and pass the `--bless` flag
---
|
LL | bar(d);
| ^^^^^^
| |
| the parameter type `impl Debug` must be valid for the static lifetime...
| ...so that the type `impl Debug` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo(d: impl Debug+ 'static) {
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_09a56a7e-f37e-4c25-8398-c0b1cdc18414
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=wrap-dyn-in-suggestion
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_09a56a7e-f37e-4c25-8398-c0b1cdc18414
GITHUB_REF=refs/pull/120929/merge
GITHUB_REF_NAME=120929/merge
GITHUB_REF_PROTECTED=false
---
#12 writing image sha256:efda136f136653b600ecf3e296f70c01630523e3728c6ed9891611d7640c687d done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Sun Feb 11 13:52:35 UTC 2024
network time: Sun, 11 Feb 2024 13:52:35 GMT
network time: Sun, 11 Feb 2024 13:52:35 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
+ LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
14
15 error: aborting due to 1 previous error
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-120223/issue-120223.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/issue-120223.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/issue-120223.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-120223" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-120223/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0310]: the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` may not live long enough
|
|
LL | Box::new(executor) //~ ERROR the parameter type
| |
| |
| the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` must be valid for the static lifetime...
| ...so that the type `impl FnOnce(T) -> dyn Future<Output = ()>` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
@fmease Could you review this PR? Thank you.
Sure, I plan on reviewing this later today. Sorry for taking a bit, I'm assigned to several PRs and I continuously work on PRs myself ^^'
:umbrella: The latest upstream changes (presumably #121549) made this pull request unmergeable. Please resolve the merge conflicts.
@fmease Thank you for detailed review! I will fix them and check for more patterns in a couple of days.
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_0acfceb2-cec5-4c32-b517-5dd149928682
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=wrap-dyn-in-suggestion
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_0acfceb2-cec5-4c32-b517-5dd149928682
GITHUB_REF=refs/pull/120929/merge
GITHUB_REF_NAME=120929/merge
GITHUB_REF_PROTECTED=false
---
#17 exporting to docker image format
#17 sending tarball 43.6s done
#17 DONE 48.8s
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Sun Mar 17 06:39:25 UTC 2024
network time: Sun, 17 Mar 2024 06:39:25 GMT
network time: Sun, 17 Mar 2024 06:39:25 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
14 | ^^^^^^^
15 help: consider adding an explicit lifetime bound
16 |
- LL | impl <T: Sync + 'static> Foo for T { }
- | +++++++++
+ LL | impl <T: 'static: Sync> Foo for T { }
19
20 error[E0308]: mismatched types
21 --> $DIR/builtin-superkinds-self-type.rs:16:27
---
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs:10:16
|
LL | impl <T: Sync> Foo for T { }
| |
| the parameter type `T` must be valid for the static lifetime...
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds...
note: ...that is required by this bound
--> /checkout/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs:6:24
|
|
LL | trait Foo : Sized+Sync+'static {
help: consider adding an explicit lifetime bound
|
|
LL | impl <T: 'static: Sync> Foo for T { }
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs:16:27
|
|
LL | assert_eq!(rx.recv(), 1193182);
| ^^^^^^^ expected `Result<{integer}, RecvError>`, found integer
|
= note: expected enum `Result<{integer}, RecvError>`
found type `{integer}`
help: try wrapping the expression in `Ok`
|
LL | assert_eq!(rx.recv(), Ok(1193182));
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0308, E0310.
---
124 |
125 help: consider adding an explicit lifetime bound
126 |
- LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {
- | +++++++++
+ LL | fn ty_param_wont_outlive_static<T: 'static:Debug>(x: T) -> impl Debug + 'static {
129
130 error: lifetime may not live long enough
131 --> $DIR/must_outlive_least_region_or_bound.rs:18:41
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
|
|
LL | fn elided(x: &i32) -> impl Copy { x }
| | |
| | opaque type defined here
| | opaque type defined here
| hidden type `&i32` captures the anonymous lifetime defined here
|
help: to declare that `impl Copy` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
|
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
| | |
| | opaque type defined here
| | opaque type defined here
| hidden type `&'a i32` captures the lifetime `'a` as defined here
|
help: to declare that `impl Copy` captures `'a`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:9:46
|
|
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
| - ^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:12:55
|
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
|
help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
error[E0621]: explicit lifetime required in the type of `x`
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:15:41
|
|
LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
| ---- ^ lifetime `'a` required
| |
| help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:30:55
|
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
| - ^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
| ++++
help: to declare that `impl Debug` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:36:69
|
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
|
help: consider changing `impl LifetimeTrait<'a> + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x }
error[E0700]: hidden type for `impl Fn(&'a u32)` captures lifetime that does not appear in bounds
|
|
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
| -- ---------------- opaque type defined here
| |
| hidden type `{closure@/checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:42:5: 42:13}` captures the lifetime `'b` as defined here
LL | move |_| println!("{}", y)
|
|
help: to declare that `impl Fn(&'a u32)` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b {
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:47:5
|
|
LL | x
| ^
| |
| 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 ty_param_wont_outlive_static<T: 'static:Debug>(x: T) -> impl Debug + 'static {
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:18:41
|
|
LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
| - ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:21:50
|
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
| -- lifetime `'a` defined here ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:24:51
|
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| - ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs:27:60
|
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| -- lifetime `'a` defined here ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
|
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
| ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit4<'a>(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
error: aborting due to 13 previous errors
Some errors have detailed explanations: E0310, E0621, E0700.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | impl<T: Copy + 'static> F for T {}
- | +++++++++
+ LL | impl<T: 'static: Copy> F for T {}
14
15 error: aborting due to 1 previous error
16
---
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs:14:21
|
LL | impl<T: Copy> F for T {}
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 | impl<T: 'static: Copy> F for T {}
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
---
34 help: consider adding an explicit lifetime bound
35 |
- LL | T: Trait<'a> + 'a,
- | ++++
+ LL | fn supply<'a, T: 'a>(value: T)
38
39 error: aborting due to 1 previous error
40
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match/propagate-from-trait-match.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-from-trait-match.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs:32:36
|
|
LL | establish_relationships(value, |value| {
|
|
= note: defining type: supply::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((T,)),
(),
]
= note: number of external vids: 2
= note: where T: '?1
note: no external requirements
--> /checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs:28:1
|
|
LL | / fn supply<'a, T>(value: T)
LL | | T: Trait<'a>,
| |_________________^
|
|
= note: defining type: supply::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/closure-requirements/propagate-from-trait-match.rs:43:9
|
|
LL | fn supply<'a, T>(value: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | require(value);
LL | require(value);
| ^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn supply<'a, T: 'a>(value: T)
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0309`.
---
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: Debug + 'a,
- | ++++
+ LL | fn no_region<'a, T: 'a>(x: Box<T>) -> impl Debug + 'a
14
15 error[E0309]: the parameter type `T` may not live long enough
16 --> $DIR/impl-trait-outlives.rs:26:5
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | T: 'b + Debug + 'a,
- | ++++
+ LL | T: 'b + 'a + Debug,
28
29 error: aborting due to 2 previous errors
30
---
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/impl-trait-outlives.rs:11:5
|
LL | fn no_region<'a, T>(x: Box<T>) -> impl Debug + 'a
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn no_region<'a, T: 'a>(x: Box<T>) -> impl Debug + 'a
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/impl-trait-outlives.rs:26:5
|
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> impl Debug + 'a
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b + 'a + Debug,
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn generic2<T: Iterator + 'static>(value: T) {
- | +++++++++
+ LL | fn generic2<T: 'static: Iterator>(value: T) {
14
15 error: aborting due to 1 previous error
16
---
To only update this specific test, also pass `--test-args nll/ty-outlives/projection-implied-bounds.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/projection-implied-bounds.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-implied-bounds" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-implied-bounds/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-implied-bounds.rs:30:36
|
|
LL | twice(value, |value_ref, item| invoke2(value_ref, item));
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 generic2<T: 'static: Iterator>(value: T) {
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
---
35 |
36 help: consider adding an explicit lifetime bound
37 |
- LL | T: Anything<'b> + 'a,
- | ++++
+ LL | fn no_relationships_late<'a, 'b, T: 'a>(cell: Cell<&'a ()>, t: T)
40
41 error: lifetime may not live long enough
42 --> $DIR/projection-one-region-closure.rs:45:39
88 |
89 help: consider adding an explicit lifetime bound
90 |
- LL | T: Anything<'b> + 'a,
- | ++++
+ LL | fn no_relationships_early<'a, 'b, T: 'a>(cell: Cell<&'a ()>, t: T)
93
94 error: lifetime may not live long enough
95 --> $DIR/projection-one-region-closure.rs:56:39
---
To only update this specific test, also pass `--test-args nll/ty-outlives/projection-one-region-closure.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:45:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: no_relationships_late::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?2 ()>, T)),
(),
= note: late-bound region is '?3
= note: late-bound region is '?3
= note: number of external vids: 4
= note: where T: '?2
= note: where '?1: '?2
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:41:1
|
|
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
|
|
= note: defining type: no_relationships_late::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:45:39
|
|
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn no_relationships_late<'a, 'b, T: 'a>(cell: Cell<&'a ()>, t: T)
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:45:39
|
|
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:56:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: no_relationships_early::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where T: '?3
= note: where '?2: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:51:1
|
|
LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
|
|
= note: defining type: no_relationships_early::<'?1, '?2, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:56:39
|
|
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn no_relationships_early<'a, 'b, T: 'a>(cell: Cell<&'a ()>, t: T)
error: lifetime may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:56:39
|
|
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:70:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: projection_outlives::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where <T as Anything<'?2>>::AssocType: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:62:1
|
|
LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
|
|
= note: defining type: projection_outlives::<'?1, '?2, T>
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:80:29
|
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
|
= note: defining type: elements_outlive::<'?1, '?2, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::cell::Cell<&'?3 ()>, T)),
(),
]
= note: number of external vids: 4
= note: where T: '?3
= note: where '?2: '?3
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/projection-one-region-closure.rs:74:1
|
|
LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T: 'a,
LL | | 'b: 'a,
|
|
= note: defining type: elements_outlive::<'?1, '?2, T>
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0309`.
------------------------------------------
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: MyTrait<'a> + 'a,
- | ++++
+ LL | fn foo<'a, T: 'a>() -> &'a ()
14
15 error: aborting due to 1 previous error
16
---
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/projection-where-clause-none.rs:14:5
|
LL | fn foo<'a, T>() -> &'a ()
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | bar::<T::Output>() //~ ERROR the parameter type `T` may not live long enough
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo<'a, T: 'a>() -> &'a ()
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0309`.
---
10 help: consider adding an explicit lifetime bound
11 |
- LL | T: Debug + 'a,
- | ++++
+ LL | fn no_region<'a, T: 'a>(x: Box<T>) -> Box<Debug + 'a>
14
15 error[E0309]: the parameter type `T` may not live long enough
16 --> $DIR/ty-param-fn.rs:24:5
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | T: 'b + Debug + 'a,
- | ++++
+ LL | T: 'b + 'a + Debug,
28
29 error: aborting due to 2 previous errors
30
---
To only update this specific test, also pass `--test-args nll/ty-outlives/ty-param-fn.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/ty-outlives/ty-param-fn.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-fn" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-fn/auxiliary"
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-fn.rs:9:5
|
|
LL | fn no_region<'a, T>(x: Box<T>) -> Box<Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn no_region<'a, T: 'a>(x: Box<T>) -> Box<Debug + 'a>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-fn.rs:24:5
|
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b + 'a + Debug,
error: aborting due to 2 previous errors
Build completed unsuccessfully in 0:14:17
---
34 help: consider adding an explicit lifetime bound
35 |
- LL | T: Debug + 'a,
- | ++++
+ LL | fn no_region<'a, T: 'a>(x: Box<T>) -> Box<dyn Debug + 'a>
38
39 error[E0309]: the parameter type `T` may not live long enough
40 --> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5
47 |
48 help: consider adding an explicit lifetime bound
49 |
- LL | T: 'b + Debug + 'a,
- | ++++
+ LL | T: 'b + 'a + Debug,
52
53 error: aborting due to 2 previous errors
54
---
--- stderr -------------------------------
note: external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:26:23
|
LL | with_signature(x, |y| y)
|
|
= note: defining type: no_region::<'?1, T>::{closure#0} with closure args [
i32,
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '?2)>,
(),
]
= note: number of external vids: 3
= note: where T: '?2
note: no external requirements
--> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:15:1
|
|
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
LL | | T: Debug,
| |_____________^
|
|
= note: defining type: no_region::<'?1, T>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:26:27
|
|
LL | fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | with_signature(x, |y| y)
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn no_region<'a, T: 'a>(x: Box<T>) -> Box<dyn Debug + 'a>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:41:5
|
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
LL | x
LL | x
| ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | T: 'b + 'a + Debug,
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn make_object1<A: SomeTrait + 'static>(v: A) -> Box<dyn SomeTrait + 'static> {
- | +++++++++
+ LL | fn make_object1<A: 'static: SomeTrait>(v: A) -> Box<dyn SomeTrait + 'static> {
14
15 error[E0309]: the parameter type `A` may not live long enough
16 --> $DIR/regions-close-over-type-parameter-1.rs:20:5
---
To only update this specific test, also pass `--test-args regions/regions-close-over-type-parameter-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/regions/regions-close-over-type-parameter-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-close-over-type-parameter-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-close-over-type-parameter-1/auxiliary"
--- stderr -------------------------------
error[E0310]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-over-type-parameter-1.rs:11:5
|
|
LL | Box::new(v) as Box<dyn SomeTrait + 'static>
| |
| the parameter type `A` must be valid for the static lifetime...
| the parameter type `A` must be valid for the static lifetime...
| ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn make_object1<A: 'static: SomeTrait>(v: A) -> Box<dyn SomeTrait + 'static> {
error[E0309]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-over-type-parameter-1.rs:20:5
|
|
LL | fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box<dyn SomeTrait + 'b> {
| -- the parameter type `A` must be valid for the lifetime `'b` as defined here...
LL | Box::new(v) as Box<dyn SomeTrait + 'b>
| ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn make_object3<'a, 'b, A: SomeTrait + 'a + 'b>(v: A) -> Box<dyn SomeTrait + 'b> {
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0309, E0310.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | where T : X + 'static
- | +++++++++
+ LL | fn p1<T: 'static>(v: T) -> Box<dyn X + 'static>
14
15 error[E0310]: the parameter type `T` may not live long enough
16 --> $DIR/regions-close-param-into-object.rs:12:5
37 |
38 help: consider adding an explicit lifetime bound
39 |
- LL | where T : X + 'a
- | ++++
+ LL | fn p3<'a,T: 'a>(v: T) -> Box<dyn X + 'a>
42
43 error[E0309]: the parameter type `T` may not live long enough
44 --> $DIR/regions-close-param-into-object.rs:24:5
---
--- stderr -------------------------------
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:6:5
|
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 p1<T: 'static>(v: T) -> Box<dyn X + 'static>
error[E0310]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:12:5
|
|
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| |
| the parameter type `T` must be valid for the static lifetime...
| 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 p2<T: 'static>(v: Box<T>) -> Box<dyn X + 'static>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:18:5
|
|
LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn p3<'a,T: 'a>(v: T) -> Box<dyn X + 'a>
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-close-param-into-object.rs:24:5
|
|
LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn p4<'a,T: 'a>(v: Box<T>) -> Box<dyn X + 'a>
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0309, E0310.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn func<'x, T:Trait1<'x> + 'x>(t: &'x T::Foo)
- | ++++
+ LL | fn func<'x, T: 'x:Trait1<'x>>(t: &'x T::Foo)
14
15 error: aborting due to 1 previous error
16
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-implied-bounds-projection-gap-1/regions-implied-bounds-projection-gap-1.stderr
To only update this specific test, also pass `--test-args regions/regions-implied-bounds-projection-gap-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/regions/regions-implied-bounds-projection-gap-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-implied-bounds-projection-gap-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-implied-bounds-projection-gap-1/auxiliary"
--- stderr -------------------------------
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-implied-bounds-projection-gap-1.rs:16:5
|
|
LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo)
| -- the parameter type `T` must be valid for the lifetime `'x` as defined here...
LL | {
LL | wf::<&'x T>();
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn func<'x, T: 'x:Trait1<'x>>(t: &'x T::Foo)
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0309`.
---
21 |
22 help: consider adding an explicit lifetime bound
23 |
- LL | fn bar2<'a,'b,A:Is<'b> + 'a>(x: Inv<'a>, y: Inv<'b>, a: A) {
- | ++++
+ LL | fn bar2<'a,'b,A: 'a:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
26
27 error: aborting due to 2 previous errors
28
---
--- stderr -------------------------------
error[E0309]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-infer-bound-from-trait.rs:33:5
|
LL | fn bar1<'a,A>(x: Inv<'a>, a: A) {
| -- the parameter type `A` must be valid for the lifetime `'a` as defined here...
LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) {
error[E0309]: the parameter type `A` may not live long enough
##[error] --> /checkout/tests/ui/regions/regions-infer-bound-from-trait.rs:37:5
|
|
LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
| -- the parameter type `A` must be valid for the lifetime `'a` as defined here...
LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar2<'a,'b,A: 'a:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
---
11 |
12 help: consider adding an explicit lifetime bound
13 |
- LL | fn func<'a, T: Test + 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
- | +++ ++++ ++++
+ LL | fn func<'a, T: 'a: Test>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
+ | +++ ++++ ++++
17 error: aborting due to 1 previous error
18
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2/missing-lifetimes-in-signature-2.stderr
diff of fixed:
19 fn test(&self);
20 }
21
- fn func<'a, T: Test + 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
+ fn func<'a, T: 'a: Test>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
23 foo.bar(move |_| {
24 //~^ ERROR the parameter type `T` may not live long enough
25 t.test();
The actual fixed differed from the expected fixed.
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2/missing-lifetimes-in-signature-2.fixed
To only update this specific test, also pass `--test-args suggestions/lifetimes/missing-lifetimes-in-signature-2.rs`
error: 2 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2/auxiliary"
--- stderr -------------------------------
error[E0311]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs:23:5
|
|
LL | fn func<T: Test>(_dummy: &Foo, foo: &Foo, t: T) {
| --- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL | / foo.bar(move |_| {
LL | | //~^ ERROR the parameter type `T` may not live long enough
LL | | t.test();
LL | | });
| |______^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn func<'a, T: 'a: Test>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
| +++ ++++ ++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0311`.
------------------------------------------
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + 'a {
- | ++++ ++++ ++ ~~
+ LL | fn foo<'a>(d: impl Sized: 'a, p: &'a mut ()) -> impl Sized + 'a {
+ | ++++ ++++ ++ ~~
15 error[E0309]: the parameter type `impl Sized` may not live long enough
16 --> $DIR/issue-105544.rs:15:5
23 |
23 |
24 help: consider adding an explicit lifetime bound
25 |
- LL | fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ {
- | ++++
+ LL | fn foo1<'b>(d: impl Sized: 'b, p: &'b mut ()) -> impl Sized + '_ {
28
29 error[E0311]: the parameter type `impl Sized + 'a` may not live long enough
30 --> $DIR/issue-105544.rs:21:5
51 |
52 help: consider adding an explicit lifetime bound
53 |
- LL | fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a {
- | +++ ++++ ++ ~~
+ LL | fn bar<'a, T: 'a : Sized>(d: T, p: &'a mut ()) -> impl Sized + 'a {
+ | +++ ++++ ++ ~~
57 error[E0309]: the parameter type `T` may not live long enough
58 --> $DIR/issue-105544.rs:36:5
65 |
65 |
66 help: consider adding an explicit lifetime bound
67 |
- LL | fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
- | ++++
+ LL | fn bar1<'b, T: 'b : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ {
70
71 error[E0311]: the parameter type `T` may not live long enough
72 --> $DIR/issue-105544.rs:42:5
---
2
3 #![allow(warnings)]
4
- fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
+ fn foo<'a>(d: impl Sized: 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
6 //~^ HELP consider adding an explicit lifetime bound
7 (d, p)
8 //~^ ERROR the parameter type `impl Sized` may not live long enough
9 //~| NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
11
11
- fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ {
+ fn foo1<'b>(d: impl Sized: 'b, p: &'b mut ()) -> impl Sized + '_ {
13 //~^ NOTE the parameter type `impl Sized` must be valid for the lifetime `'b` as defined here...
14 //~| HELP consider adding an explicit lifetime bound
15 (d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
23 //~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
25
25
- fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
+ fn bar<'a, T: 'a : Sized>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
27 //~^ HELP consider adding an explicit lifetime bound
28 (d, p)
29 //~^ ERROR the parameter type `T` may not live long enough
30 //~| NOTE ...so that the type `T` will meet its required lifetime bounds
32
32
- fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
+ fn bar1<'b, T: 'b : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ {
34 //~^ NOTE the parameter type `T` must be valid for the lifetime `'b` as defined here...
35 //~| HELP consider adding an explicit lifetime bound
36 (d, p) //~ NOTE ...so that the type `T` will meet its required lifetime bounds
The actual fixed differed from the expected fixed.
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544/issue-105544.fixed
To only update this specific test, also pass `--test-args suggestions/lifetimes/issue-105544.rs`
error: 2 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/lifetimes/issue-105544.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/lifetimes/issue-105544/auxiliary"
--- stderr -------------------------------
error[E0311]: the parameter type `impl Sized` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:7:5
|
|
LL | fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime ...
| ------- the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo<'a>(d: impl Sized: 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
| ++++ ++++ ++ ~~
error[E0309]: the parameter type `impl Sized` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:15:5
|
|
LL | fn foo1<'b>(d: impl Sized, p: &'b mut ()) -> impl Sized + '_ {
| -- the parameter type `impl Sized` must be valid for the lifetime `'b` as defined here...
...
LL | (d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
| ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo1<'b>(d: impl Sized: 'b, p: &'b mut ()) -> impl Sized + '_ {
error[E0311]: the parameter type `impl Sized + 'a` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:21:5
|
|
LL | fn foo2<'a>(d: impl Sized + 'a, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anon...
| ------- the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
| +++ ++++ ++ ~~
error[E0311]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:28:5
|
|
LL | fn bar<T : Sized>(d: T, p: & mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime define...
| -------- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar<'a, T: 'a : Sized>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
| +++ ++++ ++ ~~
error[E0309]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:36:5
|
|
LL | fn bar1<'b, T : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ {
| -- the parameter type `T` must be valid for the lifetime `'b` as defined here...
...
LL | (d, p) //~ NOTE ...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 bar1<'b, T: 'b : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ {
error[E0311]: the parameter type `T` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/issue-105544.rs:42:5
|
|
LL | fn bar2<'a, T : Sized + 'a>(d: T, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifeti...
| ------- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL | //~^ HELP consider adding an explicit lifetime bound
LL | (d, p)
| ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
| +++ ++++ ++ ~~
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0309, E0311.
For more information about an error, try `rustc --explain E0309`.
---
39 |
40 help: consider adding an explicit lifetime bound
41 |
- LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
- LL | where
- LL ~ G: Get<T> + 'a,
- |
+ LL | fn bar<'a, G: 'a, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
+ | +++ ++++ ++ ~~
47 error[E0311]: the parameter type `G` may not live long enough
48 --> $DIR/missing-lifetimes-in-signature.rs:52:5
122 |
122 |
123 help: consider adding an explicit lifetime bound
124 |
- LL | G: Get<T> + 'a,
- | ++++
+ LL | fn bak<'a, G: 'a, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
127
128 error: aborting due to 8 previous errors
129
---
--- stderr -------------------------------
error[E0261]: use of undeclared lifetime name `'a`
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:37:11
|
LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `'a,`
error[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds
|
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
| ------ ------------- opaque type defined here
| |
| hidden type `{closure@/checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:19:5: 19:12}` captures the anonymous lifetime defined here
LL | / move || {
LL | / move || {
LL | | //~^ ERROR hidden type for `impl FnOnce()` captures lifetime
LL | | *dest = g.get();
| |_____^
|
|
help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
error[E0311]: the parameter type `G` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:30:5
|
|
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bar<'a, G: 'a, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
| +++ ++++ ++ ~~
error[E0311]: the parameter type `G` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:52:5
|
|
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b
| +++ ++++ ++ ~~
error[E0311]: the parameter type `G` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:61:9
|
|
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_________^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + 'c {
| +++ ++++ ++ ~~
error[E0311]: the parameter type `G` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:73:5
|
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | //~| ERROR explicit lifetime required
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b + 'a
| +++ ++++ ++ ~~
error[E0621]: explicit lifetime required in the type of `dest`
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:73:5
|
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | //~| ERROR explicit lifetime required
LL | | *dest = g.get();
LL | | }
| |_____^ lifetime `'a` required
error[E0309]: the parameter type `G` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs:85:5
|
|
LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
| -- the parameter type `G` must be valid for the lifetime `'a` as defined here...
LL | / move || {
LL | / move || {
LL | | //~^ ERROR the parameter type `G` may not live long enough
LL | | *dest = g.get();
LL | | }
| |_____^ ...so that the type `G` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn bak<'a, G: 'a, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0261, E0309, E0311, E0621, E0700.
---
9 |
10 help: consider adding an explicit lifetime bound
11 |
- LL | fn foo(d: impl Debug + 'static) {
- | +++++++++
+ LL | fn foo(d: impl Debug: 'static) {
14
15 error: aborting due to 1 previous error
16
---
2
3 use std::fmt::Debug;
4
- fn foo(d: impl Debug + 'static) {
+ fn foo(d: impl Debug: 'static) {
6 //~^ HELP consider adding an explicit lifetime bound
7 bar(d);
8 //~^ ERROR the parameter type `impl Debug` may not live long enough
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-impl-trait-lifetime/suggest-impl-trait-lifetime.fixed
To update references, rerun the tests and pass the `--bless` flag
---
|
LL | bar(d);
| ^^^^^^
| |
| the parameter type `impl Debug` must be valid for the static lifetime...
| ...so that the type `impl Debug` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | fn foo(d: impl Debug: '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/suggestions/wrap-dyn-in-suggestion-issue-120223.rs stdout ----
diff of stderr:
1 error[E0310]: the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` may not live long enough
+ --> $DIR/wrap-dyn-in-suggestion-issue-120223.rs:6:5
3 |
4 LL | Box::new(executor)
5 | ^^^^^^^^^^^^^^^^^^
5 | ^^^^^^^^^^^^^^^^^^
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/wrap-dyn-in-suggestion-issue-120223/wrap-dyn-in-suggestion-issue-120223.stderr
To only update this specific test, also pass `--test-args suggestions/wrap-dyn-in-suggestion-issue-120223.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/wrap-dyn-in-suggestion-issue-120223" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/wrap-dyn-in-suggestion-issue-120223/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0310]: the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:6:5
|
LL | Box::new(executor) //~ ERROR the parameter type
| |
| |
| the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` must be valid for the static lifetime...
| ...so that the type `impl FnOnce(T) -> dyn Future<Output = ()>` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0310`.
I will fix testing failure at first.
@rustbot review
@fmease
First and foremost, I would check the other 3 usage sites
bounds_span_for_suggestionwhether they could benefit from this, too.
I checked them:
-
compiler/rustc_hir_typeck/src/method/suggest.rs-
tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs- The impl Trait accepts
impl Foo + Barso we don't need parenthesis. - I think this suggestion is for type parameters (impl Trait in arguments), not
dyn.
- The impl Trait accepts
-
-
compiler/rustc_middle/src/ty/diagnostics.rs- Same as above?
-
compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs-
?Sizedcannot be used in trait object types (dyn).
-
You could even consider grep'ing through
tests/ui/to check if there are any other incorrect consider adding an explicit lifetime bound suggestions.
I searched consider adding an explicit lifetime bound under tests/ui and couldn't find any incorrect suggestions.
I think incorrect suggestions which need parentheses happen with only dyn (I'm not familiar with Rust, so it may incorrect).
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 29.3s done
#16 DONE 34.3s
##[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-17]
---
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-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--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-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
Compiling rustc_hir v0.0.0 (/checkout/compiler/rustc_hir)
error: expected `;`, found `span`
--> compiler/rustc_hir/src/hir.rs:678:81
|
678 | ty.span.can_be_used_for_suggestions().then_some(ty.span)
| ^ help: add `;` here
679 | span.can_be_used_for_suggestions().then(|| span)
| ---- unexpected token
error[E0423]: expected value, found macro `span`
--> compiler/rustc_hir/src/hir.rs:679:25
|
|
679 | span.can_be_used_for_suggestions().then(|| span)
|
help: you might have meant to use the available field
|
|
679 | self.span.can_be_used_for_suggestions().then(|| span)
error[E0423]: expected value, found macro `span`
--> compiler/rustc_hir/src/hir.rs:679:68
|
|
679 | span.can_be_used_for_suggestions().then(|| span)
|
help: you might have meant to use the available field
|
|
679 | span.can_be_used_for_suggestions().then(|| self.span)
For more information about this error, try `rustc --explain E0423`.
error: could not compile `rustc_hir` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
@fmease
Thank you for reviewing! I fixed to use open_paren_sp in all sites, added tests, and squashed commits. Could you check them?
@rustbot ready
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 28.0s done
#16 DONE 32.9s
##[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-17]
---
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-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--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-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
---- [ui] tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs stdout ----
diff of stderr:
12 |
13 LL | fn with_sized<T: Fn() -> &'static (dyn std::fmt::Debug) + ?Sized>() {
14 | - this type parameter needs to be `Sized`
- LL | without_sized::<T>();
+ LL | without_sized::<T>();
17 |
18 note: required by an implicit `Sized` bound in `without_sized`
68 LL | f();
68 LL | f();
69 | ^ value used here after move
70 |
- note: this value implements `FnOnce`, which causes it to be moved when called
- --> $DIR/wrap-dyn-in-suggestion-issue-120223.rs:18:5
+ note: `FnOnce` closures can only be called once
+ --> $DIR/wrap-dyn-in-suggestion-issue-120223.rs:17:23
73 |
+ LL | pub fn in_ty_param<F: FnOnce() -> &'static dyn std::fmt::Debug>(f: F) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `F` is made to be an `FnOnce` closure here
74 LL | f();
- help: consider restricting type parameters
- |
- |
- LL | pub fn in_ty_param<F: FnOnce() -> &'static (dyn std::fmt::Debug) + Copy>(f: F) {
- | + ++++++++
+ | --- this value implements `FnOnce`, which causes it to be moved when called
81 error: aborting due to 4 previous errors; 1 warning emitted
82
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/wrap-dyn-in-suggestion-issue-120223/wrap-dyn-in-suggestion-issue-120223.stderr
To only update this specific test, also pass `--test-args suggestions/wrap-dyn-in-suggestion-issue-120223.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
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/suggestions/wrap-dyn-in-suggestion-issue-120223.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" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/wrap-dyn-in-suggestion-issue-120223" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/wrap-dyn-in-suggestion-issue-120223/auxiliary"
--- stderr -------------------------------
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
##[warning] --> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:1:12
|
|
LL | #![feature(dyn_star)] //~ WARNING the feature `dyn_star` is incomplete
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= note: `#[warn(incomplete_features)]` on by default
error[E0277]: the size for values of type `T` cannot be known at compilation time
##[error] --> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:23:21
|
LL | fn with_sized<T: Fn() -> &'static (dyn std::fmt::Debug) + ?Sized>() {
| - this type parameter needs to be `Sized`
LL | without_sized::<T>();
|
note: required by an implicit `Sized` bound in `without_sized`
--> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:27:18
|
|
LL | fn without_sized<T: Fn() -> &'static dyn std::fmt::Debug>() {}
| ^ required by the implicit `Sized` requirement on this type parameter in `without_sized`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn with_sized<T: Fn() -> &'static (dyn std::fmt::Debug) + ?Sized>() {
LL + fn with_sized<T: Fn() -> &'static (dyn std::fmt::Debug)>() {
|
help: consider relaxing the implicit `Sized` restriction
|
LL | fn without_sized<T: Fn() -> &'static (dyn std::fmt::Debug) + ?Sized>() {}
error[E0310]: the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:8:5
|
LL | Box::new(executor) //~ ERROR may not live long enough
| |
| |
| the parameter type `impl FnOnce(T) -> dyn Future<Output = ()>` must be valid for the static lifetime...
| ...so that the type `impl FnOnce(T) -> dyn Future<Output = ()>` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
error[E0310]: the parameter type `impl FnOnce(T) -> Future<Output = ()>` may not live long enough
##[error] --> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:14:5
|
LL | Box::new(executor) //~ ERROR may not live long enough
| |
| |
| the parameter type `impl FnOnce(T) -> Future<Output = ()>` must be valid for the static lifetime...
| ...so that the type `impl FnOnce(T) -> Future<Output = ()>` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound
|
|
LL | executor: impl FnOnce(T) -> (dyn* Future<Output = ()>) + 'static,
error[E0382]: use of moved value: `f`
##[error] --> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:19:5
|
|
LL | pub fn in_ty_param<F: FnOnce() -> &'static dyn std::fmt::Debug>(f: F) {
| - move occurs because `f` has type `F`, which does not implement the `Copy` trait
LL | f();
| --- `f` moved due to this call
LL | f(); //~ ERROR use of moved value
| ^ value used here after move
note: `FnOnce` closures can only be called once
--> /checkout/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs:17:23
|
|
LL | pub fn in_ty_param<F: FnOnce() -> &'static dyn std::fmt::Debug>(f: F) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `F` is made to be an `FnOnce` closure here
LL | f();
| --- this value implements `FnOnce`, which causes it to be moved when called
error: aborting due to 4 previous errors; 1 warning emitted
Some errors have detailed explanations: E0277, E0310, E0382.
For more information about an error, try `rustc --explain E0277`.
For more information about an error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/traits/method-on-unbounded-type-param.rs stdout ----
diff of stderr:
9 = help: items from traits can only be used if the type parameter is bounded by the trait
10 help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
11 |
- LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
- | ++++++++++
- LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
- | +++++
+ LL | fn f<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
16
16
17 error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
30 = help: items from traits can only be used if the type parameter is bounded by the trait
30 = help: items from traits can only be used if the type parameter is bounded by the trait
31 help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
32 |
- LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
- | ++++++++++
- LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
- | +++++
+ LL | fn g<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
37
37
38 error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
51 = help: items from traits can only be used if the type parameter is bounded by the trait
51 = help: items from traits can only be used if the type parameter is bounded by the trait
52 help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
53 |
- LL | fn h<T: Iterator>(a: &T, b: T) -> std::cmp::Ordering {
- | ++++++++++
- LL | fn h<T: Ord>(a: &T, b: T) -> std::cmp::Ordering {
- | +++++
+ LL | fn h<T: Iterator: Ord>(a: &T, b: T) -> std::cmp::Ordering {
58
58
59 error[E0599]: the method `cmp` exists for struct `Box<dyn T>`, but its trait bounds were not satisfied
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/method-on-unbounded-type-param/method-on-unbounded-type-param.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/method-on-unbounded-type-param/method-on-unbounded-type-param.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/method-on-unbounded-type-param.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/traits/method-on-unbounded-type-param.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" "--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/traits/method-on-unbounded-type-param" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/method-on-unbounded-type-param/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0599]: no method named `cmp` found for type parameter `T` in the current scope
|
|
LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering {
| - method `cmp` not found for this type parameter
LL | a.cmp(&b) //~ ERROR E0599
| ^^^ method cannot be called on `T` due to unsatisfied trait bounds
= help: items from traits can only be used if the type parameter is bounded by the trait
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
|
LL | fn f<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
|
|
LL | (&a).cmp(&b) //~ ERROR E0599
| ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
= note: the following trait bounds were not satisfied:
= note: the following trait bounds were not satisfied:
`T: Ord`
which is required by `&T: Ord`
`&T: Iterator`
which is required by `&mut &T: Iterator`
`T: Iterator`
which is required by `&mut T: Iterator`
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
|
LL | fn g<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
|
|
LL | a.cmp(&b) //~ ERROR E0599
| ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
= note: the following trait bounds were not satisfied:
= note: the following trait bounds were not satisfied:
`T: Ord`
which is required by `&T: Ord`
`&T: Iterator`
which is required by `&mut &T: Iterator`
`T: Iterator`
which is required by `&mut T: Iterator`
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
|
LL | fn h<T: Iterator: Ord>(a: &T, b: T) -> std::cmp::Ordering {
error[E0599]: the method `cmp` exists for struct `Box<dyn T>`, but its trait bounds were not satisfied
|
LL | trait T {}
LL | trait T {}
| ------- doesn't satisfy `dyn T: Iterator` or `dyn T: Ord`
...
LL | x.cmp(&x); //~ ERROR E0599
| ^^^ method cannot be called on `Box<dyn T>` due to unsatisfied trait bounds
= note: the following trait bounds were not satisfied:
= note: the following trait bounds were not satisfied:
`dyn T: Iterator`
which is required by `Box<dyn T>: Iterator`
`dyn T: Ord`
which is required by `Box<dyn T>: Ord`
`Box<dyn T>: Iterator`
which is required by `&mut Box<dyn T>: Iterator`
`dyn T: Iterator`
which is required by `&mut dyn T: Iterator`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `cmp`, perhaps you need to implement one of them:
candidate #1: `Iterator`
candidate #2: `Ord`
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0599`.
------------------------------------------
https://github.com/rust-lang/rust/pull/120929#issuecomment-2067872794
CI still has errors, please fix them. If you have any questions regarding the failures, don't hesitate to reach out and ask them!
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#17 exporting to docker image format
#17 sending tarball 29.8s done
#17 DONE 34.9s
##[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-17]
---
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-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--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-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
---- [ui] tests/ui/traits/method-on-unbounded-type-param.rs stdout ----
diff of stderr:
9 = help: items from traits can only be used if the type parameter is bounded by the trait
10 help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
11 |
- LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
- | ++++++++++
- LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
- | +++++
+ LL | fn f<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
16
16
17 error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
30 = help: items from traits can only be used if the type parameter is bounded by the trait
30 = help: items from traits can only be used if the type parameter is bounded by the trait
31 help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
32 |
- LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
- | ++++++++++
- LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
- | +++++
+ LL | fn g<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
37
37
38 error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
51 = help: items from traits can only be used if the type parameter is bounded by the trait
51 = help: items from traits can only be used if the type parameter is bounded by the trait
52 help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
53 |
- LL | fn h<T: Iterator>(a: &T, b: T) -> std::cmp::Ordering {
- | ++++++++++
- LL | fn h<T: Ord>(a: &T, b: T) -> std::cmp::Ordering {
- | +++++
+ LL | fn h<T: Iterator: Ord>(a: &T, b: T) -> std::cmp::Ordering {
58
58
59 error[E0599]: the method `cmp` exists for struct `Box<dyn T>`, but its trait bounds were not satisfied
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/method-on-unbounded-type-param/method-on-unbounded-type-param.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/method-on-unbounded-type-param/method-on-unbounded-type-param.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/method-on-unbounded-type-param.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/traits/method-on-unbounded-type-param.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" "--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/traits/method-on-unbounded-type-param" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/method-on-unbounded-type-param/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0599]: no method named `cmp` found for type parameter `T` in the current scope
|
|
LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering {
| - method `cmp` not found for this type parameter
LL | a.cmp(&b) //~ ERROR E0599
| ^^^ method cannot be called on `T` due to unsatisfied trait bounds
= help: items from traits can only be used if the type parameter is bounded by the trait
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
|
LL | fn f<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
|
|
LL | (&a).cmp(&b) //~ ERROR E0599
| ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
= note: the following trait bounds were not satisfied:
= note: the following trait bounds were not satisfied:
`T: Ord`
which is required by `&T: Ord`
`&T: Iterator`
which is required by `&mut &T: Iterator`
`T: Iterator`
which is required by `&mut T: Iterator`
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
|
LL | fn g<T: Iterator: Ord>(a: T, b: T) -> std::cmp::Ordering {
error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
|
|
LL | a.cmp(&b) //~ ERROR E0599
| ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
= note: the following trait bounds were not satisfied:
= note: the following trait bounds were not satisfied:
`T: Ord`
which is required by `&T: Ord`
`&T: Iterator`
which is required by `&mut &T: Iterator`
`T: Iterator`
which is required by `&mut T: Iterator`
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
|
LL | fn h<T: Iterator: Ord>(a: &T, b: T) -> std::cmp::Ordering {
error[E0599]: the method `cmp` exists for struct `Box<dyn T>`, but its trait bounds were not satisfied
|
LL | trait T {}
LL | trait T {}
| ------- doesn't satisfy `dyn T: Iterator` or `dyn T: Ord`
...
LL | x.cmp(&x); //~ ERROR E0599
| ^^^ method cannot be called on `Box<dyn T>` due to unsatisfied trait bounds
= note: the following trait bounds were not satisfied:
= note: the following trait bounds were not satisfied:
`dyn T: Iterator`
which is required by `Box<dyn T>: Iterator`
`dyn T: Ord`
which is required by `Box<dyn T>: Ord`
`Box<dyn T>: Iterator`
which is required by `&mut Box<dyn T>: Iterator`
`dyn T: Iterator`
which is required by `&mut dyn T: Iterator`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `cmp`, perhaps you need to implement one of them:
candidate #1: `Iterator`
candidate #2: `Ord`
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0599`.
------------------------------------------
@fmease Thank you! All tests are passed.
@bors r+ rollup
:pushpin: Commit 31e581ec1201aac9a3475b16d2100a3ddd35e2e3 has been approved by fmease
It is now in the queue for this repository.