Skip to content

Commit

Permalink
Rename Gen to Coro in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Oct 20, 2023
1 parent 2d91c76 commit 82ffd58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions tests/ui/generator/issue-87142.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
use std::ops::Coroutine;

pub trait CoroutineProviderAlt: Sized {
type Gen: Coroutine<(), Return = (), Yield = ()>;
type Coro: Coroutine<(), Return = (), Yield = ()>;

fn start(ctx: Context<Self>) -> Self::Gen;
fn start(ctx: Context<Self>) -> Self::Coro;
}

pub struct Context<G: 'static + CoroutineProviderAlt> {
pub link: Box<G::Gen>,
pub link: Box<G::Coro>,
}

impl CoroutineProviderAlt for () {
type Gen = impl Coroutine<(), Return = (), Yield = ()>;
fn start(ctx: Context<Self>) -> Self::Gen {
type Coro = impl Coroutine<(), Return = (), Yield = ()>;
fn start(ctx: Context<Self>) -> Self::Coro {
move || {
match ctx {
_ => (),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
mod gen {
use std::ops::Coroutine;

pub type GenOnce<Y, R> = impl Coroutine<Yield = Y, Return = R>;
pub type CoroOnce<Y, R> = impl Coroutine<Yield = Y, Return = R>;

pub const fn const_coroutine<Y, R>(yielding: Y, returning: R) -> GenOnce<Y, R> {
pub const fn const_coroutine<Y, R>(yielding: Y, returning: R) -> CoroOnce<Y, R> {
move || {
yield yielding;

Expand All @@ -17,6 +17,6 @@ mod gen {
}
}

const FOO: gen::GenOnce<usize, usize> = gen::const_coroutine(10, 100);
const FOO: gen::CoroOnce<usize, usize> = gen::const_coroutine(10, 100);

fn main() {}
8 changes: 4 additions & 4 deletions tests/ui/type-alias-impl-trait/issue-94429.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
use std::ops::Coroutine;

trait Runnable {
type Gen: Coroutine<Yield = (), Return = ()>;
type Coro: Coroutine<Yield = (), Return = ()>;

fn run(&mut self) -> Self::Gen;
fn run(&mut self) -> Self::Coro;
}

struct Implementor {}

impl Runnable for Implementor {
type Gen = impl Coroutine<Yield = (), Return = ()>;
type Coro = impl Coroutine<Yield = (), Return = ()>;

fn run(&mut self) -> Self::Gen {
fn run(&mut self) -> Self::Coro {
//~^ ERROR: type mismatch resolving
move || {
yield 1;
Expand Down

0 comments on commit 82ffd58

Please sign in to comment.