mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-13 12:36:47 +00:00
Bless ui tests.
This commit is contained in:
parent
e740c7b624
commit
d9f15faf3a
@ -208,17 +208,6 @@ LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/duplicate.rs:136:5
|
||||
|
|
||||
LL | iter::empty()
|
||||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | iter::empty::<T>()
|
||||
| +++++
|
||||
|
||||
error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
|
||||
--> $DIR/duplicate.rs:139:42
|
||||
|
|
||||
@ -237,17 +226,6 @@ LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/duplicate.rs:142:5
|
||||
|
|
||||
LL | iter::empty()
|
||||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | iter::empty::<T>()
|
||||
| +++++
|
||||
|
||||
error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
|
||||
--> $DIR/duplicate.rs:145:45
|
||||
|
|
||||
@ -266,17 +244,6 @@ LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/duplicate.rs:148:5
|
||||
|
|
||||
LL | iter::empty()
|
||||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | iter::empty::<T>()
|
||||
| +++++
|
||||
|
||||
error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
|
||||
--> $DIR/duplicate.rs:151:40
|
||||
|
|
||||
@ -697,6 +664,39 @@ LL | type A: Iterator<Item: 'static, Item: 'static>;
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/duplicate.rs:136:5
|
||||
|
|
||||
LL | iter::empty()
|
||||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | iter::empty::<T>()
|
||||
| +++++
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/duplicate.rs:142:5
|
||||
|
|
||||
LL | iter::empty()
|
||||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | iter::empty::<T>()
|
||||
| +++++
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/duplicate.rs:148:5
|
||||
|
|
||||
LL | iter::empty()
|
||||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | iter::empty::<T>()
|
||||
| +++++
|
||||
|
||||
error: aborting due to 81 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0282, E0719.
|
||||
|
@ -38,16 +38,6 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: to use an async block, remove the `||`: `async {`
|
||||
|
||||
error[E0658]: use of unstable library feature 'async_closure'
|
||||
--> $DIR/edition-2015.rs:1:22
|
||||
|
|
||||
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
|
||||
= help: add `#![feature(async_closure)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: use of unstable library feature 'async_closure'
|
||||
--> $DIR/edition-2015.rs:1:42
|
||||
|
|
||||
@ -58,6 +48,16 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
||||
= help: add `#![feature(async_closure)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: use of unstable library feature 'async_closure'
|
||||
--> $DIR/edition-2015.rs:1:22
|
||||
|
|
||||
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
|
||||
= help: add `#![feature(async_closure)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
@ -1,3 +1,12 @@
|
||||
error[E0307]: invalid `self` parameter type: `&dyn Foo`
|
||||
--> $DIR/inference_var_self_argument.rs:5:24
|
||||
|
|
||||
LL | async fn foo(self: &dyn Foo) {
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: type of `self` must be `Self` or a type that dereferences to it
|
||||
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
|
||||
|
||||
error[E0038]: the trait `Foo` cannot be made into an object
|
||||
--> $DIR/inference_var_self_argument.rs:5:5
|
||||
|
|
||||
@ -13,15 +22,6 @@ LL | async fn foo(self: &dyn Foo) {
|
||||
| ^^^ ...because method `foo` is `async`
|
||||
= help: consider moving `foo` to another trait
|
||||
|
||||
error[E0307]: invalid `self` parameter type: `&dyn Foo`
|
||||
--> $DIR/inference_var_self_argument.rs:5:24
|
||||
|
|
||||
LL | async fn foo(self: &dyn Foo) {
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: type of `self` must be `Self` or a type that dereferences to it
|
||||
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0038, E0307.
|
||||
|
@ -1,9 +1,3 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-66312.rs:9:8
|
||||
|
|
||||
LL | if x.is_some() {
|
||||
| ^^^^^^^^^^^ expected `bool`, found `()`
|
||||
|
||||
error[E0307]: invalid `self` parameter type: `T`
|
||||
--> $DIR/issue-66312.rs:4:22
|
||||
|
|
||||
@ -13,6 +7,12 @@ LL | fn is_some(self: T);
|
||||
= note: type of `self` must be `Self` or a type that dereferences to it
|
||||
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-66312.rs:9:8
|
||||
|
|
||||
LL | if x.is_some() {
|
||||
| ^^^^^^^^^^^ expected `bool`, found `()`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0307, E0308.
|
||||
|
@ -1,3 +1,11 @@
|
||||
error: `Foo` is forbidden as the type of a const generic parameter
|
||||
--> $DIR/opaque_types.rs:7:17
|
||||
|
|
||||
LL | fn foo<const C: Foo>() {}
|
||||
| ^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
|
||||
error: item does not constrain `Foo::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/opaque_types.rs:7:4
|
||||
|
|
||||
@ -68,14 +76,6 @@ LL | type Foo = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
|
||||
error: `Foo` is forbidden as the type of a const generic parameter
|
||||
--> $DIR/opaque_types.rs:7:17
|
||||
|
|
||||
LL | fn foo<const C: Foo>() {}
|
||||
| ^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
|
||||
error[E0391]: cycle detected when computing type of opaque `Foo::{opaque#0}`
|
||||
--> $DIR/opaque_types.rs:3:12
|
||||
|
|
||||
|
@ -3,22 +3,6 @@ error: using `#![feature(effects)]` without enabling next trait solver globally
|
||||
= note: the next trait solver must be enabled globally for the effects feature to work correctly
|
||||
= help: use `-Znext-solver` to enable
|
||||
|
||||
warning: this function depends on never type fallback being `()`
|
||||
--> $DIR/unsupported.rs:20:9
|
||||
|
|
||||
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
|
||||
= help: specify the types explicitly
|
||||
note: in edition 2024, the requirement `!: opaque::Trait` will fail
|
||||
--> $DIR/unsupported.rs:20:28
|
||||
|
|
||||
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
|
||||
| ^^^^^^^^^^
|
||||
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
|
||||
|
||||
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>::{synthetic#0}`
|
||||
--> $DIR/unsupported.rs:27:25
|
||||
|
|
||||
@ -52,6 +36,22 @@ note: in edition 2024, the requirement `!: opaque::Trait` will fail
|
||||
|
|
||||
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
|
||||
| ^^^^^^^^^^
|
||||
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
|
||||
|
||||
warning: this function depends on never type fallback being `()`
|
||||
--> $DIR/unsupported.rs:20:9
|
||||
|
|
||||
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
|
||||
= help: specify the types explicitly
|
||||
note: in edition 2024, the requirement `!: opaque::Trait` will fail
|
||||
--> $DIR/unsupported.rs:20:28
|
||||
|
|
||||
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>::{synthetic#0}`
|
||||
--> $DIR/unsupported.rs:30:24
|
||||
|
@ -18,14 +18,6 @@ LL | type Bop = impl std::fmt::Debug;
|
||||
= help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:6:16
|
||||
|
|
||||
LL | type Bar = impl std::fmt::Debug;
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Bar` must be used in combination with a concrete type within the same impl
|
||||
|
||||
error[E0658]: inherent associated types are unstable
|
||||
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:14:5
|
||||
|
|
||||
@ -36,6 +28,14 @@ LL | type Bop = impl std::fmt::Debug;
|
||||
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:6:16
|
||||
|
|
||||
LL | type Bar = impl std::fmt::Debug;
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Bar` must be used in combination with a concrete type within the same impl
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/feature-gate-impl_trait_in_assoc_type.rs:14:16
|
||||
|
|
||||
|
@ -19,7 +19,10 @@ error[E0720]: cannot resolve opaque type
|
||||
--> $DIR/impl-fn-predefined-lifetimes.rs:4:35
|
||||
|
|
||||
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^^^^^^^^^^^^^^ cannot resolve opaque type
|
||||
| ^^^^^^^^^^^^^^^ recursive opaque type
|
||||
...
|
||||
LL | |x| x
|
||||
| ----- returning here with type `{closure@$DIR/impl-fn-predefined-lifetimes.rs:7:5: 7:8}`
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
|
@ -1,9 +1,3 @@
|
||||
error[E0271]: expected `{async block@$DIR/issue-78722-2.rs:13:13: 13:18}` to be a future that resolves to `u8`, but it resolves to `()`
|
||||
--> $DIR/issue-78722-2.rs:11:30
|
||||
|
|
||||
LL | fn concrete_use() -> F {
|
||||
| ^ expected `()`, found `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-78722-2.rs:16:20
|
||||
|
|
||||
@ -18,6 +12,12 @@ LL | let f: F = async { 1 };
|
||||
= note: expected opaque type `F`
|
||||
found `async` block `{async block@$DIR/issue-78722-2.rs:16:20: 16:25}`
|
||||
|
||||
error[E0271]: expected `{async block@$DIR/issue-78722-2.rs:13:13: 13:18}` to be a future that resolves to `u8`, but it resolves to `()`
|
||||
--> $DIR/issue-78722-2.rs:11:30
|
||||
|
|
||||
LL | fn concrete_use() -> F {
|
||||
| ^ expected `()`, found `u8`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0308.
|
||||
|
@ -1,24 +1,3 @@
|
||||
error: item does not constrain `a::Foo::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:12
|
||||
|
|
||||
LL | fn eq(&self, _other: &(Foo, i32)) -> bool {
|
||||
| ^^
|
||||
|
|
||||
= note: consider moving the opaque type's declaration and defining uses into a separate module
|
||||
note: this opaque type is in the signature
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
|
||||
|
|
||||
LL | type Foo = impl PartialEq<(Foo, i32)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
|
||||
|
|
||||
LL | type Foo = impl PartialEq<(Foo, i32)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo` must be used in combination with a concrete type within the same module
|
||||
|
||||
error[E0053]: method `eq` has an incompatible type for trait
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:30
|
||||
|
|
||||
@ -35,8 +14,21 @@ help: change the parameter type to match the trait
|
||||
LL | fn eq(&self, _other: &(a::Bar, i32)) -> bool {
|
||||
| ~~~~~~~~~~~~~~
|
||||
|
||||
error: item does not constrain `a::Foo::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:12
|
||||
|
|
||||
LL | fn eq(&self, _other: &(Foo, i32)) -> bool {
|
||||
| ^^
|
||||
|
|
||||
= note: consider moving the opaque type's declaration and defining uses into a separate module
|
||||
note: this opaque type is in the signature
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
|
||||
|
|
||||
LL | type Foo = impl PartialEq<(Foo, i32)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:19:16
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
|
||||
|
|
||||
LL | type Foo = impl PartialEq<(Foo, i32)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -64,6 +56,14 @@ help: change the parameter type to match the trait
|
||||
LL | fn eq(&self, _other: &(b::Foo, i32)) -> bool {
|
||||
| ~~~~~~~~~~~~~~
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:19:16
|
||||
|
|
||||
LL | type Foo = impl PartialEq<(Foo, i32)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo` must be used in combination with a concrete type within the same module
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0053`.
|
||||
|
@ -342,44 +342,6 @@ LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
|
||||
|
|
||||
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
|
||||
|
||||
error[E0283]: type annotations needed
|
||||
--> $DIR/where-allowed.rs:46:57
|
||||
|
|
||||
LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
|
||||
| ^^^^^^^^^^ cannot infer type
|
||||
|
|
||||
= note: cannot satisfy `_: Debug`
|
||||
|
||||
error[E0283]: type annotations needed
|
||||
--> $DIR/where-allowed.rs:64:46
|
||||
|
|
||||
LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
|
||||
|
|
||||
= note: multiple `impl`s satisfying `_: Fn()` found in the following crates: `alloc`, `core`:
|
||||
- impl<A, F> Fn<A> for &F
|
||||
where A: Tuple, F: Fn<A>, F: ?Sized;
|
||||
- impl<Args, F, A> Fn<Args> for Box<F, A>
|
||||
where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
|
||||
|
||||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
||||
--> $DIR/where-allowed.rs:238:7
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
= note: `#[deny(invalid_type_param_default)]` on by default
|
||||
|
||||
error[E0118]: no nominal type found for inherent implementation
|
||||
--> $DIR/where-allowed.rs:238:1
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
|
||||
|
|
||||
= note: either implement a trait on it or create a newtype to wrap it instead
|
||||
|
||||
error[E0053]: method `in_trait_impl_return` has an incompatible type for trait
|
||||
--> $DIR/where-allowed.rs:128:34
|
||||
|
|
||||
@ -402,14 +364,6 @@ help: change the output type to match the trait
|
||||
LL | fn in_trait_impl_return() -> <() as DummyTrait>::Out { () }
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/where-allowed.rs:121:16
|
||||
|
|
||||
LL | type Out = impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `Out` must be used in combination with a concrete type within the same impl
|
||||
|
||||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
||||
--> $DIR/where-allowed.rs:245:36
|
||||
|
|
||||
@ -418,12 +372,69 @@ LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
= note: `#[deny(invalid_type_param_default)]` on by default
|
||||
|
||||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
||||
--> $DIR/where-allowed.rs:238:7
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
|
||||
error[E0283]: type annotations needed
|
||||
--> $DIR/where-allowed.rs:46:57
|
||||
|
|
||||
LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
|
||||
| ^^^^^^^^^^ cannot infer type
|
||||
|
|
||||
= note: cannot satisfy `_: Debug`
|
||||
|
||||
error[E0283]: type annotations needed
|
||||
--> $DIR/where-allowed.rs:64:46
|
||||
|
|
||||
LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
|
||||
|
|
||||
= note: multiple `impl`s satisfying `_: Fn()` found in the following crates: `alloc`, `core`:
|
||||
- impl<A, F> Fn<A> for &F
|
||||
where A: Tuple, F: Fn<A>, F: ?Sized;
|
||||
- impl<Args, F, A> Fn<Args> for Box<F, A>
|
||||
where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
|
||||
|
||||
error[E0118]: no nominal type found for inherent implementation
|
||||
--> $DIR/where-allowed.rs:238:1
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
|
||||
|
|
||||
= note: either implement a trait on it or create a newtype to wrap it instead
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/where-allowed.rs:121:16
|
||||
|
|
||||
LL | type Out = impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `Out` must be used in combination with a concrete type within the same impl
|
||||
|
||||
error: aborting due to 49 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0658, E0666.
|
||||
For more information about an error, try `rustc --explain E0053`.
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
||||
--> $DIR/where-allowed.rs:245:36
|
||||
|
|
||||
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
= note: `#[deny(invalid_type_param_default)]` on by default
|
||||
|
||||
Future breakage diagnostic:
|
||||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
||||
--> $DIR/where-allowed.rs:238:7
|
||||
|
|
||||
@ -434,14 +445,3 @@ LL | impl <T = impl Debug> T {}
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
= note: `#[deny(invalid_type_param_default)]` on by default
|
||||
|
||||
Future breakage diagnostic:
|
||||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
||||
--> $DIR/where-allowed.rs:245:36
|
||||
|
|
||||
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
= note: `#[deny(invalid_type_param_default)]` on by default
|
||||
|
||||
|
@ -26,7 +26,5 @@ type A = <m::Alias as m::Trait>::X; //~ ERROR type `Priv` is private
|
||||
trait Tr2<T> {}
|
||||
impl<T> Tr2<T> for u8 {}
|
||||
fn g() -> impl Tr2<m::Alias> { 0 } //~ ERROR type `Priv` is private
|
||||
//~| ERROR type `Priv` is private
|
||||
fn g_ext() -> impl Tr2<ext::Alias> { 0 } //~ ERROR type `ext::Priv` is private
|
||||
//~| ERROR type `ext::Priv` is private
|
||||
fn main() {}
|
||||
|
@ -46,23 +46,11 @@ error: type `Priv` is private
|
||||
LL | fn g() -> impl Tr2<m::Alias> { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^ private type
|
||||
|
||||
error: type `Priv` is private
|
||||
--> $DIR/private-type-in-interface.rs:28:11
|
||||
|
|
||||
LL | fn g() -> impl Tr2<m::Alias> { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^ private type
|
||||
|
||||
error: type `ext::Priv` is private
|
||||
--> $DIR/private-type-in-interface.rs:30:15
|
||||
--> $DIR/private-type-in-interface.rs:29:15
|
||||
|
|
||||
LL | fn g_ext() -> impl Tr2<ext::Alias> { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^ private type
|
||||
|
||||
error: type `ext::Priv` is private
|
||||
--> $DIR/private-type-in-interface.rs:30:15
|
||||
|
|
||||
LL | fn g_ext() -> impl Tr2<ext::Alias> { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^ private type
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
|
@ -67,38 +67,6 @@ error: `~const` can only be applied to `#[const_trait]` traits
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:29
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:48
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:29
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:48
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:29:29
|
||||
|
|
||||
@ -155,6 +123,38 @@ LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:29
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:48
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:29
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: `~const` can only be applied to `#[const_trait]` traits
|
||||
--> $DIR/const-impl-trait.rs:25:48
|
||||
|
|
||||
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time
|
||||
--> $DIR/const-impl-trait.rs:37:26
|
||||
|
|
||||
|
@ -1,3 +1,12 @@
|
||||
error[E0307]: invalid `self` parameter type: `Bar`
|
||||
--> $DIR/arbitrary-self-opaque.rs:8:18
|
||||
|
|
||||
LL | fn foo(self: Bar) {}
|
||||
| ^^^
|
||||
|
|
||||
= note: type of `self` must be `Self` or a type that dereferences to it
|
||||
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
|
||||
|
||||
error: item does not constrain `Bar::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/arbitrary-self-opaque.rs:8:8
|
||||
|
|
||||
@ -19,15 +28,6 @@ LL | type Bar = impl Sized;
|
||||
|
|
||||
= note: `Bar` must be used in combination with a concrete type within the same module
|
||||
|
||||
error[E0307]: invalid `self` parameter type: `Bar`
|
||||
--> $DIR/arbitrary-self-opaque.rs:8:18
|
||||
|
|
||||
LL | fn foo(self: Bar) {}
|
||||
| ^^^
|
||||
|
|
||||
= note: type of `self` must be `Self` or a type that dereferences to it
|
||||
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0307`.
|
||||
|
@ -9,8 +9,8 @@ LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
|
||||
| ++++ ++ ++
|
||||
LL | async fn a<'a>(self: Pin<&Foo>, f: &'a Foo) -> &'a Foo { f }
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75
|
||||
@ -23,8 +23,8 @@ LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
|
||||
| ++++ ++ ++
|
||||
LL | async fn c<'a>(self: Pin<&Self>, f: &'a Foo, g: &Foo) -> (Pin<&'a Foo>, &'a Foo) { (self, f) }
|
||||
| ++++ ++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
|
||||
@ -37,8 +37,8 @@ LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
|
||||
|
|
||||
help: consider reusing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn bar<'a>(self: Alias<&'a Self>, arg: &'a ()) -> &() { arg }
|
||||
| ++
|
||||
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &'a () { arg }
|
||||
| ++
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -11,34 +11,34 @@ struct Struct<'a> {
|
||||
impl<'a> Struct<'a> {
|
||||
// Test using `&self` sugar:
|
||||
|
||||
async fn ref_self<'b>(&'b self, f: &'b u32) -> &u32 {
|
||||
async fn ref_self<'b>(&self, f: &'b u32) -> &'b u32 {
|
||||
f
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
// Test using `&Self` explicitly:
|
||||
|
||||
async fn ref_Self<'b>(self: &'b Self, f: &'b u32) -> &u32 {
|
||||
async fn ref_Self<'b>(self: &Self, f: &'b u32) -> &'b u32 {
|
||||
f
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
async fn box_ref_Self<'b>(self: Box<&'b Self>, f: &'b u32) -> &u32 {
|
||||
async fn box_ref_Self<'b>(self: Box<&Self>, f: &'b u32) -> &'b u32 {
|
||||
f
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
async fn pin_ref_Self<'b>(self: Pin<&'b Self>, f: &'b u32) -> &u32 {
|
||||
async fn pin_ref_Self<'b>(self: Pin<&Self>, f: &'b u32) -> &'b u32 {
|
||||
f
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
async fn box_box_ref_Self<'b>(self: Box<Box<&'b Self>>, f: &'b u32) -> &u32 {
|
||||
async fn box_box_ref_Self<'b>(self: Box<Box<&Self>>, f: &'b u32) -> &'b u32 {
|
||||
f
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
async fn box_pin_Self<'b>(self: Box<Pin<&'b Self>>, f: &'b u32) -> &u32 {
|
||||
async fn box_pin_Self<'b>(self: Box<Pin<&Self>>, f: &'b u32) -> &'b u32 {
|
||||
f
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_self<'b>(&'b self, f: &'b u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_self<'b>(&self, f: &'b u32) -> &'b u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/lt-ref-self-async.rs:22:9
|
||||
@ -25,8 +25,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_Self<'b>(self: &'b Self, f: &'b u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_Self<'b>(self: &Self, f: &'b u32) -> &'b u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/lt-ref-self-async.rs:27:9
|
||||
@ -40,8 +40,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_ref_Self<'b>(self: Box<&'b Self>, f: &'b u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_ref_Self<'b>(self: Box<&Self>, f: &'b u32) -> &'b u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/lt-ref-self-async.rs:32:9
|
||||
@ -55,8 +55,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn pin_ref_Self<'b>(self: Pin<&'b Self>, f: &'b u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn pin_ref_Self<'b>(self: Pin<&Self>, f: &'b u32) -> &'b u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/lt-ref-self-async.rs:37:9
|
||||
@ -70,8 +70,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_box_ref_Self<'b>(self: Box<Box<&'b Self>>, f: &'b u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_box_ref_Self<'b>(self: Box<Box<&Self>>, f: &'b u32) -> &'b u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/lt-ref-self-async.rs:42:9
|
||||
@ -85,8 +85,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_pin_Self<'b>(self: Box<Pin<&'b Self>>, f: &'b u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_pin_Self<'b>(self: Box<Pin<&Self>>, f: &'b u32) -> &'b u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -10,8 +10,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_AssocType<'a>(self: &'a <Struct as Trait>::AssocType, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_AssocType<'a>(self: &<Struct as Trait>::AssocType, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-assoc-async.rs:24:9
|
||||
@ -25,8 +25,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_ref_AssocType<'a>(self: Box<&'a <Struct as Trait>::AssocType>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_ref_AssocType<'a>(self: Box<&<Struct as Trait>::AssocType>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-assoc-async.rs:29:9
|
||||
@ -40,8 +40,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn pin_ref_AssocType<'a>(self: Pin<&'a <Struct as Trait>::AssocType>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn pin_ref_AssocType<'a>(self: Pin<&<Struct as Trait>::AssocType>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-assoc-async.rs:34:9
|
||||
@ -55,8 +55,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_box_ref_AssocType<'a>(self: Box<Box<&'a <Struct as Trait>::AssocType>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_box_ref_AssocType<'a>(self: Box<Box<&<Struct as Trait>::AssocType>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-assoc-async.rs:39:9
|
||||
@ -70,8 +70,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_pin_ref_AssocType<'a>(self: Box<Pin<&'a <Struct as Trait>::AssocType>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_pin_ref_AssocType<'a>(self: Box<Pin<&<Struct as Trait>::AssocType>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -10,8 +10,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_self<'a>(&mut self, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-self-async.rs:20:9
|
||||
@ -25,8 +25,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_Self<'a>(self: &mut Self, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-self-async.rs:25:9
|
||||
@ -40,8 +40,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_ref_Self<'a>(self: Box<&mut Self>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-self-async.rs:30:9
|
||||
@ -55,8 +55,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn pin_ref_Self<'a>(self: Pin<&mut Self>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-self-async.rs:35:9
|
||||
@ -70,8 +70,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_box_ref_Self<'a>(self: Box<Box<&'a mut Self>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_box_ref_Self<'a>(self: Box<Box<&mut Self>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-self-async.rs:40:9
|
||||
@ -85,8 +85,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_pin_ref_Self<'a>(self: Box<Pin<&'a mut Self>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_pin_ref_Self<'a>(self: Box<Pin<&mut Self>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -10,8 +10,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_Struct<'a>(self: &mut Struct, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-struct-async.rs:18:9
|
||||
@ -25,8 +25,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_ref_Struct<'a>(self: Box<&mut Struct>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-struct-async.rs:23:9
|
||||
@ -40,8 +40,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn pin_ref_Struct<'a>(self: Pin<&mut Struct>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-struct-async.rs:28:9
|
||||
@ -55,8 +55,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_box_ref_Struct<'a>(self: Box<Box<&'a mut Struct>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_box_ref_Struct<'a>(self: Box<Box<&mut Struct>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-mut-struct-async.rs:33:9
|
||||
@ -70,8 +70,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_pin_ref_Struct<'a>(self: Box<Pin<&'a mut Struct>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_pin_ref_Struct<'a>(self: Box<Pin<&mut Struct>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -10,8 +10,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_self<'a>(&self, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-self-async.rs:30:9
|
||||
@ -25,8 +25,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_Self<'a>(self: &Self, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-self-async.rs:35:9
|
||||
@ -40,8 +40,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_ref_Self<'a>(self: Box<&Self>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-self-async.rs:40:9
|
||||
@ -55,8 +55,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn pin_ref_Self<'a>(self: Pin<&Self>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-self-async.rs:45:9
|
||||
@ -70,8 +70,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_box_ref_Self<'a>(self: Box<Box<&Self>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-self-async.rs:50:9
|
||||
@ -85,8 +85,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_pin_ref_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_pin_ref_Self<'a>(self: Box<Pin<&Self>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-self-async.rs:55:9
|
||||
@ -100,8 +100,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn wrap_ref_Self_Self<'a>(self: Wrap<&'a Self, Self>, f: &'a u8) -> &u8 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn wrap_ref_Self_Self<'a>(self: Wrap<&Self, Self>, f: &'a u8) -> &'a u8 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
@ -10,8 +10,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn ref_Struct<'a>(self: &Struct, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-struct-async.rs:18:9
|
||||
@ -25,8 +25,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_ref_Struct<'a>(self: Box<&Struct>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-struct-async.rs:23:9
|
||||
@ -40,8 +40,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn pin_ref_Struct<'a>(self: Pin<&Struct>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-struct-async.rs:28:9
|
||||
@ -55,8 +55,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_box_ref_Struct<'a>(self: Box<Box<&'a Struct>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_box_ref_Struct<'a>(self: Box<Box<&Struct>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/ref-struct-async.rs:33:9
|
||||
@ -70,8 +70,8 @@ LL | f
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn box_pin_Struct<'a>(self: Box<Pin<&'a Struct>>, f: &'a u32) -> &u32 {
|
||||
| ++++ ++ ++
|
||||
LL | async fn box_pin_Struct<'a>(self: Box<Pin<&Struct>>, f: &'a u32) -> &'a u32 {
|
||||
| ++++ ++ ++
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
error: `Bar` is forbidden as the type of a const generic parameter
|
||||
--> $DIR/const_generic_type.rs:8:24
|
||||
|
|
||||
LL | async fn test<const N: crate::Bar>() {
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
|
||||
error: item does not constrain `Bar::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/const_generic_type.rs:8:10
|
||||
|
|
||||
@ -39,13 +47,5 @@ LL | type Bar = impl std::fmt::Display;
|
||||
|
|
||||
= note: `Bar` must be used in combination with a concrete type within the same module
|
||||
|
||||
error: `Bar` is forbidden as the type of a const generic parameter
|
||||
--> $DIR/const_generic_type.rs:8:24
|
||||
|
|
||||
LL | async fn test<const N: crate::Bar>() {
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -7,19 +7,6 @@ LL | fn execute(ty: Ty<'_>) -> &str { todo!() }
|
||||
= note: lifetimes appearing in an associated or opaque type are not considered constrained
|
||||
= note: consider introducing a named lifetime parameter
|
||||
|
||||
error: item does not constrain `lifetime_params::Ty::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/constrain_inputs.rs:6:8
|
||||
|
|
||||
LL | fn execute(ty: Ty<'_>) -> &str { todo!() }
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: consider moving the opaque type's declaration and defining uses into a separate module
|
||||
note: this opaque type is in the signature
|
||||
--> $DIR/constrain_inputs.rs:4:19
|
||||
|
|
||||
LL | type Ty<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
|
||||
--> $DIR/constrain_inputs.rs:10:35
|
||||
|
|
||||
@ -38,6 +25,19 @@ LL | type BadTraitRef = dyn Fn(Ty<'_>) -> &str;
|
||||
= note: lifetimes appearing in an associated or opaque type are not considered constrained
|
||||
= note: consider introducing a named lifetime parameter
|
||||
|
||||
error: item does not constrain `lifetime_params::Ty::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/constrain_inputs.rs:6:8
|
||||
|
|
||||
LL | fn execute(ty: Ty<'_>) -> &str { todo!() }
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: consider moving the opaque type's declaration and defining uses into a separate module
|
||||
note: this opaque type is in the signature
|
||||
--> $DIR/constrain_inputs.rs:4:19
|
||||
|
|
||||
LL | type Ty<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
|
||||
--> $DIR/constrain_inputs.rs:19:31
|
||||
|
|
||||
|
@ -1,3 +1,19 @@
|
||||
error[E0277]: the trait bound `T: Trait` is not satisfied
|
||||
--> $DIR/generic_underconstrained.rs:9:31
|
||||
|
|
||||
LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
|
||||
| ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
|
||||
|
|
||||
note: required by a bound on the type alias `Underconstrained`
|
||||
--> $DIR/generic_underconstrained.rs:6:26
|
||||
|
|
||||
LL | type Underconstrained<T: Trait> = impl Send;
|
||||
| ^^^^^ required by this bound
|
||||
help: consider restricting type parameter `T`
|
||||
|
|
||||
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
|
||||
| +++++++
|
||||
|
||||
error[E0277]: the trait bound `T: Trait` is not satisfied
|
||||
--> $DIR/generic_underconstrained.rs:9:51
|
||||
|
|
||||
@ -19,22 +35,6 @@ help: consider restricting type parameter `T`
|
||||
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
|
||||
| +++++++
|
||||
|
||||
error[E0277]: the trait bound `T: Trait` is not satisfied
|
||||
--> $DIR/generic_underconstrained.rs:9:31
|
||||
|
|
||||
LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
|
||||
| ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
|
||||
|
|
||||
note: required by a bound on the type alias `Underconstrained`
|
||||
--> $DIR/generic_underconstrained.rs:6:26
|
||||
|
|
||||
LL | type Underconstrained<T: Trait> = impl Send;
|
||||
| ^^^^^ required by this bound
|
||||
help: consider restricting type parameter `T`
|
||||
|
|
||||
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
|
||||
| +++++++
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -1,3 +1,35 @@
|
||||
error[E0277]: `U` doesn't implement `Debug`
|
||||
--> $DIR/generic_underconstrained2.rs:8:33
|
||||
|
|
||||
LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
|
||||
| ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||
|
|
||||
note: required by a bound on the type alias `Underconstrained`
|
||||
--> $DIR/generic_underconstrained2.rs:5:26
|
||||
|
|
||||
LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
|
||||
| ^^^^^^^^^^^^^^^ required by this bound
|
||||
help: consider restricting type parameter `U`
|
||||
|
|
||||
LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0277]: `V` doesn't implement `Debug`
|
||||
--> $DIR/generic_underconstrained2.rs:17:43
|
||||
|
|
||||
LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||
|
|
||||
note: required by a bound on the type alias `Underconstrained2`
|
||||
--> $DIR/generic_underconstrained2.rs:14:27
|
||||
|
|
||||
LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
|
||||
| ^^^^^^^^^^^^^^^ required by this bound
|
||||
help: consider restricting type parameter `V`
|
||||
|
|
||||
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0277]: `U` doesn't implement `Debug`
|
||||
--> $DIR/generic_underconstrained2.rs:8:53
|
||||
|
|
||||
@ -40,38 +72,6 @@ help: consider restricting type parameter `V`
|
||||
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0277]: `U` doesn't implement `Debug`
|
||||
--> $DIR/generic_underconstrained2.rs:8:33
|
||||
|
|
||||
LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
|
||||
| ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||
|
|
||||
note: required by a bound on the type alias `Underconstrained`
|
||||
--> $DIR/generic_underconstrained2.rs:5:26
|
||||
|
|
||||
LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
|
||||
| ^^^^^^^^^^^^^^^ required by this bound
|
||||
help: consider restricting type parameter `U`
|
||||
|
|
||||
LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0277]: `V` doesn't implement `Debug`
|
||||
--> $DIR/generic_underconstrained2.rs:17:43
|
||||
|
|
||||
LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||
|
|
||||
note: required by a bound on the type alias `Underconstrained2`
|
||||
--> $DIR/generic_underconstrained2.rs:14:27
|
||||
|
|
||||
LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
|
||||
| ^^^^^^^^^^^^^^^ required by this bound
|
||||
help: consider restricting type parameter `V`
|
||||
|
|
||||
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
|
||||
| +++++++++++++++++
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -1,3 +1,9 @@
|
||||
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
|
||||
--> $DIR/ice-failed-to-resolve-instance-for-110696.rs:41:6
|
||||
|
|
||||
LL | impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<DummyT<T>> for Scope<U> {
|
||||
| ^ unconstrained type parameter
|
||||
|
||||
error: item does not constrain `DummyT::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/ice-failed-to-resolve-instance-for-110696.rs:28:8
|
||||
|
|
||||
@ -24,12 +30,6 @@ note: this opaque type is in the signature
|
||||
LL | type DummyT<T> = impl F;
|
||||
| ^^^^^^
|
||||
|
||||
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
|
||||
--> $DIR/ice-failed-to-resolve-instance-for-110696.rs:41:6
|
||||
|
|
||||
LL | impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<DummyT<T>> for Scope<U> {
|
||||
| ^ unconstrained type parameter
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0207`.
|
||||
|
@ -1,30 +1,3 @@
|
||||
error[E0391]: cycle detected when computing type of `Bar::{opaque#0}`
|
||||
--> $DIR/in-where-clause.rs:5:12
|
||||
|
|
||||
LL | type Bar = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires computing type of opaque `Bar::{opaque#0}`...
|
||||
--> $DIR/in-where-clause.rs:5:12
|
||||
|
|
||||
LL | type Bar = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
note: ...which requires type-checking `foo`...
|
||||
--> $DIR/in-where-clause.rs:8:1
|
||||
|
|
||||
LL | / fn foo() -> Bar
|
||||
LL | | where
|
||||
LL | | Bar: Send,
|
||||
| |______________^
|
||||
= note: ...which requires revealing opaque types in `[Binder { value: TraitPredicate(<Bar as core::marker::Send>, polarity:Positive), bound_vars: [] }]`...
|
||||
= note: ...which again requires computing type of `Bar::{opaque#0}`, completing the cycle
|
||||
note: cycle used when checking that `Bar::{opaque#0}` is well-formed
|
||||
--> $DIR/in-where-clause.rs:5:12
|
||||
|
|
||||
LL | type Bar = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
|
||||
error[E0283]: type annotations needed: cannot satisfy `Bar: Send`
|
||||
--> $DIR/in-where-clause.rs:12:9
|
||||
|
|
||||
@ -41,6 +14,29 @@ LL | where
|
||||
LL | Bar: Send,
|
||||
| ^^^^ required by this bound in `foo`
|
||||
|
||||
error[E0391]: cycle detected when computing type of opaque `Bar::{opaque#0}`
|
||||
--> $DIR/in-where-clause.rs:5:12
|
||||
|
|
||||
LL | type Bar = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires type-checking `foo`...
|
||||
--> $DIR/in-where-clause.rs:8:1
|
||||
|
|
||||
LL | / fn foo() -> Bar
|
||||
LL | | where
|
||||
LL | | Bar: Send,
|
||||
| |______________^
|
||||
= note: ...which requires revealing opaque types in `[Binder { value: TraitPredicate(<Bar as core::marker::Send>, polarity:Positive), bound_vars: [] }]`...
|
||||
note: ...which requires computing type of `Bar::{opaque#0}`...
|
||||
--> $DIR/in-where-clause.rs:5:12
|
||||
|
|
||||
LL | type Bar = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
= note: ...which again requires computing type of opaque `Bar::{opaque#0}`, completing the cycle
|
||||
= note: cycle used when evaluating trait selection obligation `Bar: core::marker::Send`
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0283, E0391.
|
||||
|
@ -1,15 +1,14 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
type Bug<T, U> = impl Fn(T) -> U + Copy; //~ ERROR cycle detected
|
||||
type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
|
||||
const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
|
||||
//~^ ERROR: non-defining opaque type use
|
||||
//~| ERROR: item does not constrain
|
||||
//~| ERROR: item does not constrain
|
||||
//~^ ERROR cycle detected
|
||||
//~| ERROR: non-defining opaque type use
|
||||
|
||||
fn make_bug<T, U: From<T>>() -> Bug<T, U> {
|
||||
|x| x.into() //~ ERROR the trait bound `U: From<T>` is not satisfied
|
||||
|x| x.into()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -10,75 +10,33 @@ note: for this opaque type
|
||||
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0391]: cycle detected when computing type of `Bug::{opaque#0}`
|
||||
error[E0391]: cycle detected when type-checking `CONST_BUG`
|
||||
--> $DIR/issue-53092-2.rs:6:1
|
||||
|
|
||||
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: ...which requires computing layout of `Bug<u8, ()>`...
|
||||
= note: ...which requires normalizing `Bug<u8, ()>`...
|
||||
note: ...which requires computing type of `Bug::{opaque#0}`...
|
||||
--> $DIR/issue-53092-2.rs:4:18
|
||||
|
|
||||
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires computing type of opaque `Bug::{opaque#0}`...
|
||||
--> $DIR/issue-53092-2.rs:4:18
|
||||
|
|
||||
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires type-checking `CONST_BUG`...
|
||||
= note: ...which again requires type-checking `CONST_BUG`, completing the cycle
|
||||
note: cycle used when checking that `CONST_BUG` is well-formed
|
||||
--> $DIR/issue-53092-2.rs:6:1
|
||||
|
|
||||
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which requires computing layout of `Bug<u8, ()>`...
|
||||
= note: ...which requires normalizing `Bug<u8, ()>`...
|
||||
= note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle
|
||||
note: cycle used when checking that `Bug::{opaque#0}` is well-formed
|
||||
--> $DIR/issue-53092-2.rs:4:18
|
||||
|
|
||||
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
|
||||
error: item does not constrain `Bug::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/issue-53092-2.rs:6:7
|
||||
|
|
||||
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: consider moving the opaque type's declaration and defining uses into a separate module
|
||||
note: this opaque type is in the signature
|
||||
--> $DIR/issue-53092-2.rs:4:18
|
||||
|
|
||||
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
error: item does not constrain `Bug::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/issue-53092-2.rs:6:61
|
||||
|
|
||||
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: consider moving the opaque type's declaration and defining uses into a separate module
|
||||
note: this opaque type is in the signature
|
||||
--> $DIR/issue-53092-2.rs:4:18
|
||||
|
|
||||
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `U: From<T>` is not satisfied
|
||||
--> $DIR/issue-53092-2.rs:12:5
|
||||
|
|
||||
LL | |x| x.into()
|
||||
| ^^^^^^^^^^^^ the trait `From<T>` is not implemented for `U`
|
||||
|
|
||||
note: required by a bound in `make_bug`
|
||||
--> $DIR/issue-53092-2.rs:11:19
|
||||
|
|
||||
LL | fn make_bug<T, U: From<T>>() -> Bug<T, U> {
|
||||
| ^^^^^^^ required by this bound in `make_bug`
|
||||
help: consider restricting type parameter `U`
|
||||
|
|
||||
LL | type Bug<T, U: std::convert::From<T>> = impl Fn(T) -> U + Copy;
|
||||
| +++++++++++++++++++++++
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0277, E0391, E0792.
|
||||
For more information about an error, try `rustc --explain E0277`.
|
||||
Some errors have detailed explanations: E0391, E0792.
|
||||
For more information about an error, try `rustc --explain E0391`.
|
||||
|
@ -1,3 +1,12 @@
|
||||
error[E0119]: conflicting implementations of trait `Trait<Bar, _>`
|
||||
--> $DIR/issue-84660-unsoundness.rs:29:1
|
||||
|
|
||||
LL | impl<In, Out> Trait<Bar, In> for Out {
|
||||
| ------------------------------------ first implementation here
|
||||
...
|
||||
LL | impl<In, Out> Trait<(), In> for Out {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||
|
||||
error: item does not constrain `Bar::{opaque#0}`, but has it in its signature
|
||||
--> $DIR/issue-84660-unsoundness.rs:22:8
|
||||
|
|
||||
@ -11,15 +20,6 @@ note: this opaque type is in the signature
|
||||
LL | type Bar = impl Foo;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait<Bar, _>`
|
||||
--> $DIR/issue-84660-unsoundness.rs:29:1
|
||||
|
|
||||
LL | impl<In, Out> Trait<Bar, In> for Out {
|
||||
| ------------------------------------ first implementation here
|
||||
...
|
||||
LL | impl<In, Out> Trait<(), In> for Out {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0119`.
|
||||
|
@ -1,3 +1,12 @@
|
||||
error[E0119]: conflicting implementations of trait `Trait<Bar, _>`
|
||||
--> $DIR/issue-84660-unsoundness.rs:29:1
|
||||
|
|
||||
LL | impl<In, Out> Trait<Bar, In> for Out {
|
||||
| ------------------------------------ first implementation here
|
||||
...
|
||||
LL | impl<In, Out> Trait<(), In> for Out {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||
|
||||
error[E0284]: type annotations needed: cannot satisfy `Bar == _`
|
||||
--> $DIR/issue-84660-unsoundness.rs:22:37
|
||||
|
|
||||
@ -9,15 +18,6 @@ LL | | unreachable!();
|
||||
LL | | }
|
||||
| |_____^ cannot satisfy `Bar == _`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait<Bar, _>`
|
||||
--> $DIR/issue-84660-unsoundness.rs:29:1
|
||||
|
|
||||
LL | impl<In, Out> Trait<Bar, In> for Out {
|
||||
| ------------------------------------ first implementation here
|
||||
...
|
||||
LL | impl<In, Out> Trait<(), In> for Out {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0119, E0284.
|
||||
|
@ -1,11 +1,3 @@
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/nested-in-anon-const.rs:13:33
|
||||
|
|
||||
LL | type B<Z> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `B` must be used in combination with a concrete type within the same item
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/nested-in-anon-const.rs:12:17
|
||||
|
|
||||
@ -15,6 +7,14 @@ LL | |
|
||||
LL | | },
|
||||
| |_________________^ expected `usize`, found `()`
|
||||
|
||||
error: unconstrained opaque type
|
||||
--> $DIR/nested-in-anon-const.rs:13:33
|
||||
|
|
||||
LL | type B<Z> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `B` must be used in combination with a concrete type within the same item
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
@ -10,18 +10,6 @@ note: required by a bound on the type alias `Ty`
|
||||
LL | Ty: Id<Assoc = Ty>,
|
||||
| ^^^^^^^^^^^^^^ required by this bound
|
||||
|
||||
error[E0275]: overflow evaluating the requirement `Ty: Id`
|
||||
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:15:19
|
||||
|
|
||||
LL | fn define() -> Ty {}
|
||||
| ^^
|
||||
|
|
||||
note: required by a bound on the type alias `Ty`
|
||||
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:13:9
|
||||
|
|
||||
LL | Ty: Id<Assoc = Ty>,
|
||||
| ^^^^^^^^^^^^^^ required by this bound
|
||||
|
||||
error[E0275]: overflow evaluating the requirement `Ty: Id`
|
||||
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:15:16
|
||||
|
|
||||
@ -34,6 +22,6 @@ note: required by a bound on the type alias `Ty`
|
||||
LL | Ty: Id<Assoc = Ty>,
|
||||
| ^^^^^^^^^^^^^^ required by this bound
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0275`.
|
||||
|
@ -160,7 +160,7 @@ impl BadTrait<_> for BadStruct<_> {}
|
||||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for implementations
|
||||
|
||||
fn impl_trait() -> impl BadTrait<_> {
|
||||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for opaque types
|
||||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ struct Struct;
|
||||
trait Trait<T> {}
|
||||
impl Trait<usize> for Struct {}
|
||||
type Y = impl Trait<_>;
|
||||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for opaque types
|
||||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for type aliases
|
||||
fn foo() -> Y {
|
||||
Struct
|
||||
}
|
||||
|
@ -484,11 +484,16 @@ help: use type parameters instead
|
||||
LL | impl<T> BadTrait<T> for BadStruct<T> {}
|
||||
| +++ ~ ~
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for opaque types
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
|
||||
--> $DIR/typeck_type_placeholder_item.rs:162:34
|
||||
|
|
||||
LL | fn impl_trait() -> impl BadTrait<_> {
|
||||
| ^ not allowed in type signatures
|
||||
|
|
||||
help: use type parameters instead
|
||||
|
|
||||
LL | fn impl_trait<T>() -> impl BadTrait<T> {
|
||||
| +++ ~
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
|
||||
--> $DIR/typeck_type_placeholder_item.rs:167:25
|
||||
@ -518,33 +523,17 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
|
||||
LL | type X = Box<_>;
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for opaque types
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
|
||||
--> $DIR/typeck_type_placeholder_item.rs:182:21
|
||||
|
|
||||
LL | type Y = impl Trait<_>;
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
|
||||
--> $DIR/typeck_type_placeholder_item.rs:44:27
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
|
||||
--> $DIR/typeck_type_placeholder_item.rs:206:14
|
||||
|
|
||||
LL | fn test10(&self, _x : _) { }
|
||||
| ^ not allowed in type signatures
|
||||
|
|
||||
help: use type parameters instead
|
||||
|
|
||||
LL | fn test10<T>(&self, _x : T) { }
|
||||
| +++ ~
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
|
||||
--> $DIR/typeck_type_placeholder_item.rs:110:34
|
||||
|
|
||||
LL | fn fn_test10(&self, _x : _) { }
|
||||
| ^ not allowed in type signatures
|
||||
|
|
||||
help: use type parameters instead
|
||||
|
|
||||
LL | fn fn_test10<T>(&self, _x : T) { }
|
||||
| +++ ~
|
||||
LL | const C: _;
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
|
||||
--> $DIR/typeck_type_placeholder_item.rs:194:14
|
||||
@ -555,6 +544,21 @@ LL | const D: _ = 42;
|
||||
| not allowed in type signatures
|
||||
| help: replace with the correct type: `i32`
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
|
||||
--> $DIR/typeck_type_placeholder_item.rs:209:14
|
||||
|
|
||||
LL | const D: _ = 42;
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0046]: not all trait items implemented, missing: `F`
|
||||
--> $DIR/typeck_type_placeholder_item.rs:200:1
|
||||
|
|
||||
LL | type F: std::ops::Fn(_);
|
||||
| ----------------------- `F` from trait
|
||||
...
|
||||
LL | impl Qux for Struct {
|
||||
| ^^^^^^^^^^^^^^^^^^^ missing `F` in implementation
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
|
||||
--> $DIR/typeck_type_placeholder_item.rs:217:31
|
||||
|
|
||||
@ -573,27 +577,6 @@ LL | const _: Option<_> = map(value);
|
||||
| not allowed in type signatures
|
||||
| help: replace with the correct type: `Option<u8>`
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
|
||||
--> $DIR/typeck_type_placeholder_item.rs:206:14
|
||||
|
|
||||
LL | const C: _;
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
|
||||
--> $DIR/typeck_type_placeholder_item.rs:209:14
|
||||
|
|
||||
LL | const D: _ = 42;
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0046]: not all trait items implemented, missing: `F`
|
||||
--> $DIR/typeck_type_placeholder_item.rs:200:1
|
||||
|
|
||||
LL | type F: std::ops::Fn(_);
|
||||
| ----------------------- `F` from trait
|
||||
...
|
||||
LL | impl Qux for Struct {
|
||||
| ^^^^^^^^^^^^^^^^^^^ missing `F` in implementation
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
|
||||
--> $DIR/typeck_type_placeholder_item.rs:225:31
|
||||
|
|
||||
@ -624,6 +607,17 @@ LL | fn test9(&self) -> _ { () }
|
||||
| not allowed in type signatures
|
||||
| help: replace with the correct return type: `()`
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
|
||||
--> $DIR/typeck_type_placeholder_item.rs:44:27
|
||||
|
|
||||
LL | fn test10(&self, _x : _) { }
|
||||
| ^ not allowed in type signatures
|
||||
|
|
||||
help: use type parameters instead
|
||||
|
|
||||
LL | fn test10<T>(&self, _x : T) { }
|
||||
| +++ ~
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
|
||||
--> $DIR/typeck_type_placeholder_item.rs:107:31
|
||||
|
|
||||
@ -633,6 +627,17 @@ LL | fn fn_test9(&self) -> _ { () }
|
||||
| not allowed in type signatures
|
||||
| help: replace with the correct return type: `()`
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
|
||||
--> $DIR/typeck_type_placeholder_item.rs:110:34
|
||||
|
|
||||
LL | fn fn_test10(&self, _x : _) { }
|
||||
| ^ not allowed in type signatures
|
||||
|
|
||||
help: use type parameters instead
|
||||
|
|
||||
LL | fn fn_test10<T>(&self, _x : T) { }
|
||||
| +++ ~
|
||||
|
||||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types
|
||||
--> $DIR/typeck_type_placeholder_item.rs:202:14
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user