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

ices/70972.rs: fixed with errors #354

Merged
merged 1 commit into from
May 5, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

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

Issue: rust-lang/rust#70972

use std::sync::atomic::{AtomicPtr, Ordering};

const P: &dyn T = &S as &dyn T;
static mut LOGGER: AtomicPtr<&dyn T> = AtomicPtr::new(&mut P);

pub trait T {}
struct S;
impl T for S {}

pub fn f() {
    match *LOGGER.load(Ordering::SeqCst) {
        P | _ => {}
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error: trait objects cannot be used in patterns
  --> /home/runner/work/glacier/glacier/ices/70972.rs:12:9
   |
12 |         P | _ => {}
   |         ^

error: aborting due to previous error

==============

=== stdout ===
=== stderr ===
error: trait objects cannot be used in patterns
  --> /home/runner/work/glacier/glacier/ices/70972.rs:12:9
   |
12 |         P | _ => {}
   |         ^

error: aborting due to previous error

==============
@Alexendoo Alexendoo merged commit 661f2b8 into master May 5, 2020
@Alexendoo Alexendoo deleted the autofix/ices/70972.rs branch May 5, 2020 15:40
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