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

ices/81712.rs: fixed with errors #647

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#81712

#![feature(generic_associated_types)]

// The cyclic dependency between trait A and B compiles as expected
trait A {
    type BType: B<AType = Self>;
}

trait B {
    type AType: A<BType = Self>;
}

// rustc crashes on the generic cyclic dependency between traits C and D
trait C {
    type DType<T>: D<T, CType = Self>;
}
trait D<T> {
    type CType: C<DType = Self>;
}
=== 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/81712.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[E0601]: `main` function not found in crate `81712`
  --> /home/runner/work/glacier/glacier/ices/81712.rs:1:1
   |
1  | / #![feature(generic_associated_types)]
2  | |
3  | | // The cyclic dependency between trait A and B compiles as expected
4  | | trait A {
...  |
17 | |     type CType: C<DType = Self>;
18 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/81712.rs`

error[E0107]: missing generics for associated type `C::DType`
  --> /home/runner/work/glacier/glacier/ices/81712.rs:14:10
   |
14 |     type DType<T>: D<T, CType = Self>;
   |          ^^^^^ expected 1 type argument
   |
note: associated type defined here, with 1 type parameter: `T`
  --> /home/runner/work/glacier/glacier/ices/81712.rs:14:10
   |
14 |     type DType<T>: D<T, CType = Self>;
   |          ^^^^^ -
help: use angle brackets to add missing type argument
   |
14 |     type DType<T><T>: D<T, CType = Self>;
   |               ^^^

error: aborting due to 2 previous errors; 1 warning emitted

Some errors have detailed explanations: E0107, E0601.
For more information about an 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/81712.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[E0601]: `main` function not found in crate `81712`
  --> /home/runner/work/glacier/glacier/ices/81712.rs:1:1
   |
1  | / #![feature(generic_associated_types)]
2  | |
3  | | // The cyclic dependency between trait A and B compiles as expected
4  | | trait A {
...  |
17 | |     type CType: C<DType = Self>;
18 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/81712.rs`

error[E0107]: missing generics for associated type `C::DType`
  --> /home/runner/work/glacier/glacier/ices/81712.rs:14:10
   |
14 |     type DType<T>: D<T, CType = Self>;
   |          ^^^^^ expected 1 type argument
   |
note: associated type defined here, with 1 type parameter: `T`
  --> /home/runner/work/glacier/glacier/ices/81712.rs:14:10
   |
14 |     type DType<T>: D<T, CType = Self>;
   |          ^^^^^ -
help: use angle brackets to add missing type argument
   |
14 |     type DType<T><T>: D<T, CType = Self>;
   |               ^^^

error: aborting due to 2 previous errors; 1 warning emitted

Some errors have detailed explanations: E0107, E0601.
For more information about an error, try `rustc --explain E0107`.
==============
@Alexendoo Alexendoo merged commit 02bbd09 into master Feb 6, 2021
@Alexendoo Alexendoo deleted the autofix/ices/81712.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