Skip to content

Commit

Permalink
bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Mar 8, 2022
1 parent 067945f commit 0a096a0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/associated-types/issue-59324.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ pub trait ThriftService<Bug: NotFoo>:
{
fn get_service(
//~^ ERROR the trait bound `Bug: Foo` is not satisfied
//~| ERROR the trait bound `Bug: Foo` is not satisfied
&self,
) -> Self::AssocType;
//~^ the trait bound `Bug: Foo` is not satisfied
}

fn with_factory<H>(factory: dyn ThriftService<()>) {}
Expand Down
11 changes: 6 additions & 5 deletions src/test/ui/associated-types/issue-59324.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | |
LL | |
LL | | Service<AssocType = <Bug as Foo>::OnlyFoo>
... |
LL | |
LL | | ) -> Self::AssocType;
LL | | }
| |_^ the trait `Foo` is not implemented for `Bug`
|
Expand All @@ -23,7 +23,7 @@ LL | |
LL | |
LL | | Service<AssocType = <Bug as Foo>::OnlyFoo>
... |
LL | |
LL | | ) -> Self::AssocType;
LL | | }
| |_^ the trait `Foo` is not implemented for `Bug`
|
Expand All @@ -37,6 +37,7 @@ error[E0277]: the trait bound `Bug: Foo` is not satisfied
|
LL | / fn get_service(
LL | |
LL | |
LL | | &self,
LL | | ) -> Self::AssocType;
| |_________________________^ the trait `Foo` is not implemented for `Bug`
Expand All @@ -47,10 +48,10 @@ LL | pub trait ThriftService<Bug: NotFoo + Foo>:
| +++++

error[E0277]: the trait bound `Bug: Foo` is not satisfied
--> $DIR/issue-59324.rs:19:10
--> $DIR/issue-59324.rs:16:8
|
LL | ) -> Self::AssocType;
| ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bug`
LL | fn get_service(
| ^^^^^^^^^^^ the trait `Foo` is not implemented for `Bug`
|
help: consider further restricting this bound
|
Expand Down
12 changes: 1 addition & 11 deletions src/test/ui/generic-associated-types/issue-91139.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
// revisions: migrate nll
//[nll]compile-flags: -Z borrowck=mir

// Since we are testing nll (and migration) explicitly as a separate
// revisions, don't worry about the --compare-mode=nll on this test.

// ignore-compare-mode-nll

//[nll] check-pass
//[migrate] check-fail
// check-pass

#![feature(generic_associated_types)]

Expand All @@ -25,7 +16,6 @@ impl<T> Foo<T> for () {

fn foo<T>() {
let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
//[migrate]~^ the parameter type `T` may not live long enough
}

pub fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ trait SomeTrait<'a> {
fn give_me_ice<T>() {
callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
//~^ ERROR the trait bound `T: SomeTrait<'_>` is not satisfied [E0277]
//~| ERROR the trait bound `T: SomeTrait<'_>` is not satisfied [E0277]
}

fn callee<T: Fn<(&'static (),)>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ help: consider restricting type parameter `T`
LL | fn give_me_ice<T: SomeTrait<'_>>() {
| +++++++++++++++

error[E0277]: the trait bound `T: SomeTrait<'_>` is not satisfied
--> $DIR/issue-85455.rs:8:14
|
LL | callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SomeTrait<'_>` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
LL | fn give_me_ice<T: SomeTrait<'_>>() {
| +++++++++++++++

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ note: previous use here
LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `A: Foo` is not satisfied
error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
--> $DIR/generic_duplicate_param_use9.rs:7:18
|
LL | type Two<A, B> = impl Debug;
| ^^^^^^^^^^ the trait `Foo` is not implemented for `A`
| ^^^^^^^^^^ within `(A, B, <A as Foo>::Bar)`, the trait `Foo` is not implemented for `A`
|
= note: required because it appears within the type `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `A`
|
LL | type Two<A: Foo, B> = impl Debug;
Expand All @@ -27,7 +28,7 @@ error[E0277]: `A` doesn't implement `Debug`
LL | type Two<A, B> = impl Debug;
| ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= note: required because of the requirements on the impl of `Debug` for `(A, B, _)`
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `A`
|
LL | type Two<A: std::fmt::Debug, B> = impl Debug;
Expand All @@ -39,7 +40,7 @@ error[E0277]: `B` doesn't implement `Debug`
LL | type Two<A, B> = impl Debug;
| ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= note: required because of the requirements on the impl of `Debug` for `(A, B, _)`
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `B`
|
LL | type Two<A, B: std::fmt::Debug> = impl Debug;
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/type-alias-impl-trait/issue-89686.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
use std::future::Future;

type G<'a, T> = impl Future<Output = ()>;
//~^ ERROR: the trait bound `T: Trait` is not satisfied
//~^ ERROR <impl Future<Output = [async output]> as Future>::Output == ()
//~| ERROR the trait bound `T: Trait` is not satisfied

trait Trait {
type F: Future<Output = ()>;
Expand Down
24 changes: 22 additions & 2 deletions src/test/ui/type-alias-impl-trait/issue-89686.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
error[E0271]: type mismatch resolving `<impl Future<Output = [async output]> as Future>::Output == ()`
--> $DIR/issue-89686.rs:7:17
|
LL | type G<'a, T> = impl Future<Output = ()>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
...
LL | async move { self.f().await }
| ------------------ the found `async` block
|
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
|
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
| ------------------------------- the found opaque type
|
= note: expected unit type `()`
found associated type `<impl Future<Output = [async output]> as Future>::Output`
= help: consider constraining the associated type `<impl Future<Output = [async output]> as Future>::Output` to `()`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: the trait bound `T: Trait` is not satisfied
--> $DIR/issue-89686.rs:7:17
|
Expand All @@ -9,6 +28,7 @@ help: consider restricting type parameter `T`
LL | type G<'a, T: Trait> = impl Future<Output = ()>;
| +++++++

error: aborting due to previous error
error: aborting due to 2 previous errors

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

0 comments on commit 0a096a0

Please sign in to comment.