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

ices/72845.rs: fixed with errors #1049

Merged
merged 1 commit into from
Dec 9, 2021
Merged

ices/72845.rs: fixed with errors #1049

merged 1 commit into from
Dec 9, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 9, 2021

Issue: rust-lang/rust#72845

#![feature(generic_const_exprs)]
#![feature(specialization)]
#![allow(incomplete_features)]

//--------------------------------------------------

trait Depth {
    const C: usize;
}

trait Type {
    type AT: Depth;
}

//--------------------------------------------------

enum Predicate<const B: bool> {}

trait Satisfied {}

impl Satisfied for Predicate<true> {}

//--------------------------------------------------

trait Spec1 {}

impl<T: Type> Spec1 for T where Predicate<{T::AT::C > 0}>: Satisfied {}

trait Spec2: Spec1 {}

impl<T: Type + Spec1> Spec2 for T where Predicate<{T::AT::C > 1}>: Satisfied {}

//--------------------------------------------------

trait Foo {
    fn Bar();
}

impl<T: Spec1> Foo for T {
    default fn Bar() {}
}

impl<T: Spec2> Foo for T {
    fn Bar() {}
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `72845`
  --> /home/runner/work/glacier/glacier/ices/72845.rs:1:1
   |
1  | / #![feature(generic_const_exprs)]
2  | | #![feature(specialization)]
3  | | #![allow(incomplete_features)]
4  | |
...  |
44 | |     fn Bar() {}
45 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/72845.rs`

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `72845`
  --> /home/runner/work/glacier/glacier/ices/72845.rs:1:1
   |
1  | / #![feature(generic_const_exprs)]
2  | | #![feature(specialization)]
3  | | #![allow(incomplete_features)]
4  | |
...  |
44 | |     fn Bar() {}
45 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/72845.rs`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.
==============
@Alexendoo Alexendoo merged commit cae8516 into master Dec 9, 2021
@Alexendoo Alexendoo deleted the autofix/ices/72845.rs branch December 9, 2021 14:24
@matthiaskrgr
Copy link
Member

If I add a main function as shown in the suggestion, it crashes again :/
rust-lang/rust#72845

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.

3 participants