diff options
| author | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-01-14 21:21:40 -0500 |
|---|---|---|
| committer | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-02-07 15:07:03 -0500 |
| commit | 7ad48bd4e22aaffa5ac32809b9196fab9c04de2c (patch) | |
| tree | 7f104f51d9c3cc783c369204a97dff84d4022eb0 /src/test | |
| parent | 3602e0e262275c898966c45553c406c4873472fe (diff) | |
| download | rust-7ad48bd4e22aaffa5ac32809b9196fab9c04de2c.tar.gz rust-7ad48bd4e22aaffa5ac32809b9196fab9c04de2c.zip | |
Change inference var check to be in project_type
Diffstat (limited to 'src/test')
4 files changed, 16 insertions, 21 deletions
diff --git a/src/test/ui/generic-associated-types/issue-74824.rs b/src/test/ui/generic-associated-types/issue-74824.rs index 1bbf7aac5cd..01f99fa4487 100644 --- a/src/test/ui/generic-associated-types/issue-74824.rs +++ b/src/test/ui/generic-associated-types/issue-74824.rs @@ -17,6 +17,7 @@ impl<T> UnsafeCopy for T {} fn main() { let b = Box::new(42usize); let copy = <()>::copy(&b); + //~^ type annotations needed let raw_b = Box::deref(&b) as *const _; let raw_copy = Box::deref(©) as *const _; diff --git a/src/test/ui/generic-associated-types/issue-74824.stderr b/src/test/ui/generic-associated-types/issue-74824.stderr index 8517eb9fa21..e7ebf5964ba 100644 --- a/src/test/ui/generic-associated-types/issue-74824.stderr +++ b/src/test/ui/generic-associated-types/issue-74824.stderr @@ -27,6 +27,13 @@ help: consider restricting type parameter `T` LL | type Copy<T: std::clone::Clone>: Copy = Box<T>; | +++++++++++++++++++ -error: aborting due to 2 previous errors +error[E0282]: type annotations needed + --> $DIR/issue-74824.rs:19:16 + | +LL | let copy = <()>::copy(&b); + | ^^^^^^^^^^ cannot infer type for type parameter `T` declared on the associated function `copy` + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0277, E0282. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/generic-associated-types/issue-91762.rs b/src/test/ui/generic-associated-types/issue-91762.rs index e39a127abfd..b259a3c6e06 100644 --- a/src/test/ui/generic-associated-types/issue-91762.rs +++ b/src/test/ui/generic-associated-types/issue-91762.rs @@ -23,7 +23,7 @@ pub trait FunctorExt<T>: Sized { arg = self; ret = <Self::Base as Functor>::fmap(arg); - //~^ mismatched types + //~^ type annotations needed } } diff --git a/src/test/ui/generic-associated-types/issue-91762.stderr b/src/test/ui/generic-associated-types/issue-91762.stderr index e177e151d8a..a9c465cdd7e 100644 --- a/src/test/ui/generic-associated-types/issue-91762.stderr +++ b/src/test/ui/generic-associated-types/issue-91762.stderr @@ -1,22 +1,9 @@ -error[E0308]: mismatched types - --> $DIR/issue-91762.rs:25:45 +error[E0282]: type annotations needed + --> $DIR/issue-91762.rs:25:15 | -LL | / pub trait FunctorExt<T>: Sized { -LL | | type Base: Functor<With<T> = Self>; -LL | | -LL | | fn fmap<U>(self) { -... | -LL | | ret = <Self::Base as Functor>::fmap(arg); - | | ^^^ expected associated type, found type parameter `Self` -LL | | -LL | | } -LL | | } - | |_- this type parameter - | - = note: expected associated type `<<Self as FunctorExt<T>>::Base as Functor>::With<_>` - found type parameter `Self` - = note: you might be missing a type parameter or trait bound +LL | ret = <Self::Base as Functor>::fmap(arg); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `T` declared on the associated function `fmap` error: aborting due to previous error -For more information about this error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0282`. |
