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

ices/52893.rs: fixed with errors #988

Merged
merged 1 commit into from
Oct 10, 2021
Merged

ices/52893.rs: fixed with errors #988

merged 1 commit into from
Oct 10, 2021

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#52893

impl<P, T, Name, F, OLIST, FINAL> AddClass<Name, F> for Class<P, T>
where
    Self: At<Name>,
    <Class<P, T> as At<Name>>::AtRes: Push<F>,
    <<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes:
        ToRef<Output = Class<P, OLIST>> + Push<OLIST>,
    <<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes as Push<OLIST>>::PushRes:
        Entry<Data = FINAL>,
{
    type Output = Class<P, FINAL>;

    fn init(self, func: F) -> Self::Output {
        let builder = self.at();
        let builder = builder.push(func);
        let output = builder.to_ref();
        builder.push(output)
    }
}

struct Class<P, T> {
    path: P,
    data: T,
}

trait At<Name> {
    type AtRes;

    fn at(self) -> Self::AtRes;
}

trait Push<T> {
    type PushRes;

    fn push(self, other: T) -> Self::PushRes;
}

trait AddClass<Name, F> {
    type Output;

    fn init(self, func: F) -> Self::Output;
}

trait Entry {
    type Data;
}

impl<P, T> Class<P, T> {
    fn with<Name, F>(self, constructor: F) -> <Self as AddClass<Name, F>>::Output
    where
        Self: AddClass<Name, F>,
    {
        loop {}
    }

    fn from<F>(self, constructor: F) -> <Self as AddClass<P, F>>::Output
    where
        Self: AddClass<P, F>,
    {
        loop {}
    }
}

trait ToRef {
    type Output;

    fn to_ref(&self) -> Self::Output;
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `52893`
  --> /home/runner/work/glacier/glacier/ices/52893.rs:1:1
   |
1  | / impl<P, T, Name, F, OLIST, FINAL> AddClass<Name, F> for Class<P, T>
2  | | where
3  | |     Self: At<Name>,
4  | |     <Class<P, T> as At<Name>>::AtRes: Push<F>,
...  |
66 | |     fn to_ref(&self) -> Self::Output;
67 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/52893.rs`

error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/52893.rs:16:22
   |
1  | impl<P, T, Name, F, OLIST, FINAL> AddClass<Name, F> for Class<P, T>
   |                     ----- this type parameter
...
16 |         builder.push(output)
   |                      ^^^^^^ expected type parameter `OLIST`, found struct `Class`
   |
   = note: expected type parameter `OLIST`
                      found struct `Class<P, OLIST>`

error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/52893.rs:16:9
   |
12 |     fn init(self, func: F) -> Self::Output {
   |                               ------------ expected `Class<P, _>` because of return type
...
16 |         builder.push(output)
   |         ^^^^^^^^^^^^^^^^^^^^ expected struct `Class`, found associated type
   |
   = note:       expected struct `Class<P, FINAL>`
           found associated type `<<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes as Push<OLIST>>::PushRes`
   = help: consider constraining the associated type `<<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes as Push<OLIST>>::PushRes` to `Class<P, _>`
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0601.
For more information about an error, try `rustc --explain E0308`.
==============

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `52893`
  --> /home/runner/work/glacier/glacier/ices/52893.rs:1:1
   |
1  | / impl<P, T, Name, F, OLIST, FINAL> AddClass<Name, F> for Class<P, T>
2  | | where
3  | |     Self: At<Name>,
4  | |     <Class<P, T> as At<Name>>::AtRes: Push<F>,
...  |
66 | |     fn to_ref(&self) -> Self::Output;
67 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/52893.rs`

error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/52893.rs:16:22
   |
1  | impl<P, T, Name, F, OLIST, FINAL> AddClass<Name, F> for Class<P, T>
   |                     ----- this type parameter
...
16 |         builder.push(output)
   |                      ^^^^^^ expected type parameter `OLIST`, found struct `Class`
   |
   = note: expected type parameter `OLIST`
                      found struct `Class<P, OLIST>`

error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/52893.rs:16:9
   |
12 |     fn init(self, func: F) -> Self::Output {
   |                               ------------ expected `Class<P, _>` because of return type
...
16 |         builder.push(output)
   |         ^^^^^^^^^^^^^^^^^^^^ expected struct `Class`, found associated type
   |
   = note:       expected struct `Class<P, FINAL>`
           found associated type `<<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes as Push<OLIST>>::PushRes`
   = help: consider constraining the associated type `<<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes as Push<OLIST>>::PushRes` to `Class<P, _>`
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0601.
For more information about an error, try `rustc --explain E0308`.
==============
@Alexendoo Alexendoo merged commit f635a96 into master Oct 10, 2021
@Alexendoo Alexendoo deleted the autofix/ices/52893.rs branch October 10, 2021 19:57
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