Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/79636.rs: fixed with errors #644

Merged
merged 1 commit into from
Feb 6, 2021
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 6, 2021

Issue: rust-lang/rust#79636

#![feature(generic_associated_types)]

trait Monad {
    type Unwrapped;
    type Wrapped<B>;

    fn bind<B, F>(self, f: F) -> Self::Wrapped<B> {
        todo!()
    }
}

fn join<MOuter, MInner, A>(outer: MOuter) -> MOuter::Wrapped<A>
where
    MOuter: Monad<Unwrapped = MInner>,
    MInner: Monad<Unwrapped = A, Wrapped = MOuter::Wrapped<A>>,
{
    outer.bind(|inner| inner)
}

fn main() {
    assert_eq!(join(Some(Some(true))), Some(true));
}
=== stdout ===
=== stderr ===
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/79636.rs:1:12
  |
1 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information

error[E0107]: missing generics for associated type `Monad::Wrapped`
 --> /home/runner/work/glacier/glacier/ices/79636.rs:5:10
  |
5 |     type Wrapped<B>;
  |          ^^^^^^^ expected 1 type argument
  |
note: associated type defined here, with 1 type parameter: `B`
 --> /home/runner/work/glacier/glacier/ices/79636.rs:5:10
  |
5 |     type Wrapped<B>;
  |          ^^^^^^^ -
help: use angle brackets to add missing type argument
  |
5 |     type Wrapped<B><B>;
  |                 ^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0107`.
==============

=== stdout ===
=== stderr ===
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/79636.rs:1:12
  |
1 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44265 <rust-lang/rust#44265> for more information

error[E0107]: missing generics for associated type `Monad::Wrapped`
 --> /home/runner/work/glacier/glacier/ices/79636.rs:5:10
  |
5 |     type Wrapped<B>;
  |          ^^^^^^^ expected 1 type argument
  |
note: associated type defined here, with 1 type parameter: `B`
 --> /home/runner/work/glacier/glacier/ices/79636.rs:5:10
  |
5 |     type Wrapped<B>;
  |          ^^^^^^^ -
help: use angle brackets to add missing type argument
  |
5 |     type Wrapped<B><B>;
  |                 ^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0107`.
==============
@Alexendoo Alexendoo merged commit ff25922 into master Feb 6, 2021
@Alexendoo Alexendoo deleted the autofix/ices/79636.rs branch February 6, 2021 13:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants