Skip to content

Commit

Permalink
Add a test for rust-lang#57781
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Feb 26, 2019
1 parent d76a632 commit 0b2f320
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/issues/issue-57781.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// run-pass

use std::cell::UnsafeCell;
use std::collections::HashMap;

struct OnceCell<T> {
_value: UnsafeCell<Option<T>>,
}

impl<T> OnceCell<T> {
const INIT: OnceCell<T> = OnceCell {
_value: UnsafeCell::new(None),
};
}

pub fn crash<K, T>() {
let _ = OnceCell::<HashMap<K, T>>::INIT;
}

fn main() {}

0 comments on commit 0b2f320

Please sign in to comment.