Rollup merge of #134745 - compiler-errors:better-arg-span-in-typeck, r=BoxyUwU
Normalize each signature input/output in `typeck_with_fallback` with its own span Applies the same hack as #106582 but to the args in typeck. Greatly improves normalization error spans from a signature.
This commit is contained in:
commit
c371a94e78
16 changed files with 69 additions and 77 deletions
|
@ -147,8 +147,23 @@ fn typeck_with_fallback<'tcx>(
|
||||||
check_abi(tcx, span, fn_sig.abi());
|
check_abi(tcx, span, fn_sig.abi());
|
||||||
|
|
||||||
// Compute the function signature from point of view of inside the fn.
|
// Compute the function signature from point of view of inside the fn.
|
||||||
let fn_sig = tcx.liberate_late_bound_regions(def_id.to_def_id(), fn_sig);
|
let mut fn_sig = tcx.liberate_late_bound_regions(def_id.to_def_id(), fn_sig);
|
||||||
let fn_sig = fcx.normalize(body.value.span, fn_sig);
|
|
||||||
|
// Normalize the input and output types one at a time, using a different
|
||||||
|
// `WellFormedLoc` for each. We cannot call `normalize_associated_types`
|
||||||
|
// on the entire `FnSig`, since this would use the same `WellFormedLoc`
|
||||||
|
// for each type, preventing the HIR wf check from generating
|
||||||
|
// a nice error message.
|
||||||
|
let arg_span =
|
||||||
|
|idx| decl.inputs.get(idx).map_or(decl.output.span(), |arg: &hir::Ty<'_>| arg.span);
|
||||||
|
|
||||||
|
fn_sig.inputs_and_output = tcx.mk_type_list_from_iter(
|
||||||
|
fn_sig
|
||||||
|
.inputs_and_output
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
.map(|(idx, ty)| fcx.normalize(arg_span(idx), ty)),
|
||||||
|
);
|
||||||
|
|
||||||
check_fn(&mut fcx, fn_sig, None, decl, def_id, body, tcx.features().unsized_fn_params());
|
check_fn(&mut fcx, fn_sig, None, decl, def_id, body, tcx.features().unsized_fn_params());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,11 +10,12 @@ LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: S
|
||||||
| +++++++++++
|
| +++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `Self: Get` is not satisfied
|
error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
--> $DIR/associated-types-for-unimpl-trait.rs:11:81
|
--> $DIR/associated-types-for-unimpl-trait.rs:11:41
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized {}
|
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized {}
|
||||||
| ^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized, Self: Get {}
|
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized, Self: Get {}
|
||||||
|
|
|
@ -10,11 +10,12 @@ LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
|
||||||
| +++++
|
| +++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `T: Get` is not satisfied
|
error[E0277]: the trait bound `T: Get` is not satisfied
|
||||||
--> $DIR/associated-types-no-suitable-bound.rs:11:40
|
--> $DIR/associated-types-no-suitable-bound.rs:11:21
|
||||||
|
|
|
|
||||||
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
|
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
|
||||||
| ^^ the trait `Get` is not implemented for `T`
|
| ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
|
||||||
|
|
|
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider restricting type parameter `T` with trait `Get`
|
help: consider restricting type parameter `T` with trait `Get`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
|
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
|
||||||
|
|
|
@ -10,11 +10,12 @@ LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Ge
|
||||||
| +++++++++++++++
|
| +++++++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `Self: Get` is not satisfied
|
error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
--> $DIR/associated-types-no-suitable-supertrait-2.rs:17:62
|
--> $DIR/associated-types-no-suitable-supertrait-2.rs:17:40
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
||||||
| ^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
||||||
|
|
|
@ -34,27 +34,29 @@ LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Ge
|
||||||
| +++++++++++++++
|
| +++++++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `Self: Get` is not satisfied
|
error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
--> $DIR/associated-types-no-suitable-supertrait.rs:17:62
|
--> $DIR/associated-types-no-suitable-supertrait.rs:17:40
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
||||||
| ^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
||||||
| +++++++++++++++
|
| +++++++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `(T, U): Get` is not satisfied
|
error[E0277]: the trait bound `(T, U): Get` is not satisfied
|
||||||
--> $DIR/associated-types-no-suitable-supertrait.rs:23:64
|
--> $DIR/associated-types-no-suitable-supertrait.rs:23:40
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
|
||||||
| ^^ the trait `Get` is not implemented for `(T, U)`
|
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
|
||||||
|
|
|
|
||||||
help: this trait has no implementations, consider adding one
|
help: this trait has no implementations, consider adding one
|
||||||
--> $DIR/associated-types-no-suitable-supertrait.rs:12:1
|
--> $DIR/associated-types-no-suitable-supertrait.rs:12:1
|
||||||
|
|
|
|
||||||
LL | trait Get {
|
LL | trait Get {
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
|
|
|
@ -65,16 +65,17 @@ LL | pub trait ThriftService<Bug: NotFoo + Foo>:
|
||||||
| +++++
|
| +++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `(): Foo` is not satisfied
|
error[E0277]: the trait bound `(): Foo` is not satisfied
|
||||||
--> $DIR/issue-59324.rs:23:52
|
--> $DIR/issue-59324.rs:23:29
|
||||||
|
|
|
|
||||||
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
|
||||||
| ^^ the trait `Foo` is not implemented for `()`
|
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
|
||||||
|
|
|
|
||||||
help: this trait has no implementations, consider adding one
|
help: this trait has no implementations, consider adding one
|
||||||
--> $DIR/issue-59324.rs:3:1
|
--> $DIR/issue-59324.rs:3:1
|
||||||
|
|
|
|
||||||
LL | pub trait Foo: NotFoo {
|
LL | pub trait Foo: NotFoo {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
|
|
||||||
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
|
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
|
||||||
--> $DIR/issue-59324.rs:23:29
|
--> $DIR/issue-59324.rs:23:29
|
||||||
|
|
|
@ -18,16 +18,10 @@ LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i
|
||||||
| +++++++++++++++++++++
|
| +++++++++++++++++++++
|
||||||
|
|
||||||
error[E0277]: `Foo<T, U>` cannot be sent between threads safely
|
error[E0277]: `Foo<T, U>` cannot be sent between threads safely
|
||||||
--> $DIR/issue-83857-ub.rs:21:80
|
--> $DIR/issue-83857-ub.rs:21:35
|
||||||
|
|
|
|
||||||
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
|
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
|
||||||
| ________________________________________________________________________________^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo<T, U>` cannot be sent between threads safely
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | f(foo(v));
|
|
||||||
LL | |
|
|
||||||
LL | | }
|
|
||||||
| |_^ `Foo<T, U>` cannot be sent between threads safely
|
|
||||||
|
|
|
|
||||||
= help: the trait `Send` is not implemented for `Foo<T, U>`
|
= help: the trait `Send` is not implemented for `Foo<T, U>`
|
||||||
note: required for `Foo<T, U>` to implement `WithAssoc`
|
note: required for `Foo<T, U>` to implement `WithAssoc`
|
||||||
|
|
|
@ -48,10 +48,10 @@ LL | fn baz<I: Foo>(x: &<I as Foo<A = Bar>>::A) {}
|
||||||
| +++++
|
| +++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `I: Foo` is not satisfied
|
error[E0277]: the trait bound `I: Foo` is not satisfied
|
||||||
--> $DIR/E0229.rs:13:39
|
--> $DIR/E0229.rs:13:14
|
||||||
|
|
|
|
||||||
LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {}
|
LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {}
|
||||||
| ^^ the trait `Foo` is not implemented for `I`
|
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `I`
|
||||||
|
|
|
|
||||||
help: consider restricting type parameter `I` with trait `Foo`
|
help: consider restricting type parameter `I` with trait `Foo`
|
||||||
|
|
|
|
||||||
|
|
|
@ -11,19 +11,17 @@ LL | trait HasState {
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0277]: the trait bound `isize: HasState` is not satisfied
|
error[E0277]: the trait bound `isize: HasState` is not satisfied
|
||||||
--> $DIR/issue-18611.rs:1:46
|
--> $DIR/issue-18611.rs:1:18
|
||||||
|
|
|
|
||||||
LL | fn add_state(op: <isize as HasState>::State) {
|
LL | fn add_state(op: <isize as HasState>::State) {
|
||||||
| ______________________________________________^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize`
|
||||||
... |
|
|
||||||
LL | | }
|
|
||||||
| |_^ the trait `HasState` is not implemented for `isize`
|
|
||||||
|
|
|
|
||||||
help: this trait has no implementations, consider adding one
|
help: this trait has no implementations, consider adding one
|
||||||
--> $DIR/issue-18611.rs:6:1
|
--> $DIR/issue-18611.rs:6:1
|
||||||
|
|
|
|
||||||
LL | trait HasState {
|
LL | trait HasState {
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,10 @@ LL | trait Trait2<'a> {
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
|
error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
|
||||||
--> $DIR/issue-35570.rs:8:66
|
--> $DIR/issue-35570.rs:8:16
|
||||||
|
|
|
|
||||||
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
|
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
|
||||||
| __________________________________________________________________^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | let _e: (usize, usize) = unsafe{mem::transmute(param)};
|
|
||||||
LL | | }
|
|
||||||
| |_^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
|
|
||||||
|
|
|
|
||||||
help: this trait has no implementations, consider adding one
|
help: this trait has no implementations, consider adding one
|
||||||
--> $DIR/issue-35570.rs:4:1
|
--> $DIR/issue-35570.rs:4:1
|
||||||
|
|
|
@ -48,16 +48,17 @@ LL | trait Project {
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0277]: the trait bound `(): Project` is not satisfied
|
error[E0277]: the trait bound `(): Project` is not satisfied
|
||||||
--> $DIR/bad-projection.rs:14:40
|
--> $DIR/bad-projection.rs:14:17
|
||||||
|
|
|
|
||||||
LL | pub fn uwu() -> <() as Project>::Assoc {}
|
LL | pub fn uwu() -> <() as Project>::Assoc {}
|
||||||
| ^^ the trait `Project` is not implemented for `()`
|
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Project` is not implemented for `()`
|
||||||
|
|
|
|
||||||
help: this trait has no implementations, consider adding one
|
help: this trait has no implementations, consider adding one
|
||||||
--> $DIR/bad-projection.rs:9:1
|
--> $DIR/bad-projection.rs:9:1
|
||||||
|
|
|
|
||||||
LL | trait Project {
|
LL | trait Project {
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ trait Trait2<'a, 'b> {
|
||||||
// do not infer that.
|
// do not infer that.
|
||||||
fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
|
fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
|
||||||
//~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
|
//~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
|
||||||
|
//~| ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
|
||||||
{
|
{
|
||||||
//~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -10,12 +10,10 @@ LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T
|
||||||
| ++++++++++++++++++++++++
|
| ++++++++++++++++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
|
error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
|
||||||
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:23:1
|
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:25
|
||||||
|
|
|
|
||||||
LL | / {
|
LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
|
||||||
LL | |
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
|
||||||
LL | | }
|
|
||||||
| |_^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
|
|
||||||
|
|
|
|
||||||
help: consider restricting type parameter `T` with trait `Trait2`
|
help: consider restricting type parameter `T` with trait `Trait2`
|
||||||
|
|
|
|
||||||
|
|
|
@ -35,13 +35,10 @@ LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
|
||||||
| +++++++++++++++++++
|
| +++++++++++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `B: Clone` is not satisfied
|
error[E0277]: the trait bound `B: Clone` is not satisfied
|
||||||
--> $DIR/issue-79224.rs:30:62
|
--> $DIR/issue-79224.rs:30:12
|
||||||
|
|
|
|
||||||
LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
| ______________________________________________________________^
|
| ^^^^^ the trait `Clone` is not implemented for `B`
|
||||||
... |
|
|
||||||
LL | | }
|
|
||||||
| |_____^ the trait `Clone` is not implemented for `B`
|
|
||||||
|
|
|
|
||||||
= note: required for `B` to implement `ToOwned`
|
= note: required for `B` to implement `ToOwned`
|
||||||
help: consider further restricting type parameter `B` with trait `Clone`
|
help: consider further restricting type parameter `B` with trait `Clone`
|
||||||
|
|
|
@ -15,21 +15,17 @@ LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
|
||||||
| +++++++
|
| +++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `T: Trait` is not satisfied
|
error[E0277]: the trait bound `T: Trait` is not satisfied
|
||||||
--> $DIR/generic_underconstrained.rs:9:51
|
--> $DIR/generic_underconstrained.rs:9:31
|
||||||
|
|
|
|
||||||
LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
|
LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
|
||||||
| ___________________________________________________^
|
| ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | unimplemented!()
|
|
||||||
LL | | }
|
|
||||||
| |_^ the trait `Trait` is not implemented for `T`
|
|
||||||
|
|
|
|
||||||
note: required by a bound on the type alias `Underconstrained`
|
note: required by a bound on the type alias `Underconstrained`
|
||||||
--> $DIR/generic_underconstrained.rs:6:26
|
--> $DIR/generic_underconstrained.rs:6:26
|
||||||
|
|
|
|
||||||
LL | type Underconstrained<T: Trait> = impl Send;
|
LL | type Underconstrained<T: Trait> = impl Send;
|
||||||
| ^^^^^ required by this bound
|
| ^^^^^ required by this bound
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider restricting type parameter `T` with trait `Trait`
|
help: consider restricting type parameter `T` with trait `Trait`
|
||||||
|
|
|
|
||||||
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
|
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
|
||||||
|
|
|
@ -31,42 +31,34 @@ LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained
|
||||||
| +++++++++++++++++
|
| +++++++++++++++++
|
||||||
|
|
||||||
error[E0277]: `U` doesn't implement `Debug`
|
error[E0277]: `U` doesn't implement `Debug`
|
||||||
--> $DIR/generic_underconstrained2.rs:8:53
|
--> $DIR/generic_underconstrained2.rs:8:33
|
||||||
|
|
|
|
||||||
LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
|
LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
|
||||||
| _____________________________________________________^
|
| ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | 5u32
|
|
||||||
LL | | }
|
|
||||||
| |_^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
|
||||||
|
|
|
|
||||||
note: required by a bound on the type alias `Underconstrained`
|
note: required by a bound on the type alias `Underconstrained`
|
||||||
--> $DIR/generic_underconstrained2.rs:5:26
|
--> $DIR/generic_underconstrained2.rs:5:26
|
||||||
|
|
|
|
||||||
LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
|
LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
|
||||||
| ^^^^^^^^^^^^^^^ required by this bound
|
| ^^^^^^^^^^^^^^^ required by this bound
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider restricting type parameter `U` with trait `Debug`
|
help: consider restricting type parameter `U` with trait `Debug`
|
||||||
|
|
|
|
||||||
LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
|
LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
|
||||||
| +++++++++++++++++
|
| +++++++++++++++++
|
||||||
|
|
||||||
error[E0277]: `V` doesn't implement `Debug`
|
error[E0277]: `V` doesn't implement `Debug`
|
||||||
--> $DIR/generic_underconstrained2.rs:17:64
|
--> $DIR/generic_underconstrained2.rs:17:43
|
||||||
|
|
|
|
||||||
LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
|
LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
|
||||||
| ________________________________________________________________^
|
| ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | 5u32
|
|
||||||
LL | | }
|
|
||||||
| |_^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
|
||||||
|
|
|
|
||||||
note: required by a bound on the type alias `Underconstrained2`
|
note: required by a bound on the type alias `Underconstrained2`
|
||||||
--> $DIR/generic_underconstrained2.rs:14:27
|
--> $DIR/generic_underconstrained2.rs:14:27
|
||||||
|
|
|
|
||||||
LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
|
LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
|
||||||
| ^^^^^^^^^^^^^^^ required by this bound
|
| ^^^^^^^^^^^^^^^ required by this bound
|
||||||
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
help: consider restricting type parameter `V` with trait `Debug`
|
help: consider restricting type parameter `V` with trait `Debug`
|
||||||
|
|
|
|
||||||
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
|
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue