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

ices/68393.rs: fixed with errors #265

Merged
merged 1 commit into from
Jan 22, 2020
Merged

ices/68393.rs: fixed with errors #265

merged 1 commit into from
Jan 22, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#68393

pub enum EFoo { A }

pub trait Foo {
    const X: EFoo;
}

struct Abc;

impl Foo for Abc {
    const X: EFoo = EFoo::A;
}

struct Def;
impl Foo for Def {
    const X: EFoo = EFoo::A;
}

pub fn test<A: Foo, B: Foo>(arg: EFoo) {
    let A::X = arg;
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0158]: associated consts cannot be referenced in patterns
  --> /home/runner/work/glacier/glacier/ices/68393.rs:19:9
   |
19 |     let A::X = arg;
   |         ^^^^

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0158]: associated consts cannot be referenced in patterns
  --> /home/runner/work/glacier/glacier/ices/68393.rs:19:9
   |
19 |     let A::X = arg;
   |         ^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0158`.
==============
@JohnTitor JohnTitor merged commit a34e1c5 into master Jan 22, 2020
@JohnTitor JohnTitor deleted the autofix/ices/68393.rs branch January 22, 2020 12:09
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