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

ices/67945-2.rs: fixed with errors #349

Merged
merged 1 commit into from
May 6, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented May 4, 2020

Issue: rust-lang/rust#67945

// reduced version by Centril
enum Bug<S> {
    Var = {
        let x: S = 0;
        0
    },
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `67945_2`
 --> /home/runner/work/glacier/glacier/ices/67945-2.rs:2:1
  |
2 | / enum Bug<S> {
3 | |     Var = {
4 | |         let x: S = 0;
5 | |         0
6 | |     },
7 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/67945-2.rs`

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/67945-2.rs:4:20
  |
2 | enum Bug<S> {
  |          - this type parameter
3 |     Var = {
4 |         let x: S = 0;
  |                -   ^ expected type parameter `S`, found integer
  |                |
  |                expected due to this
  |
  = note: expected type parameter `S`
                       found type `{integer}`
  = help: type parameters must be constrained to match other types
  = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

error: aborting due to 2 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 `67945_2`
 --> /home/runner/work/glacier/glacier/ices/67945-2.rs:2:1
  |
2 | / enum Bug<S> {
3 | |     Var = {
4 | |         let x: S = 0;
5 | |         0
6 | |     },
7 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/67945-2.rs`

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/67945-2.rs:4:20
  |
2 | enum Bug<S> {
  |          - this type parameter
3 |     Var = {
4 |         let x: S = 0;
  |                -   ^ expected type parameter `S`, found integer
  |                |
  |                expected due to this
  |
  = note: expected type parameter `S`
                       found type `{integer}`
  = help: type parameters must be constrained to match other types
  = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

error: aborting due to 2 previous errors

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

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to be fixed.

@JohnTitor JohnTitor merged commit 7dad611 into master May 6, 2020
@JohnTitor JohnTitor deleted the autofix/ices/67945-2.rs branch May 6, 2020 05:20
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants