Skip to content
Permalink
Browse files

Add a test for #57781

  • Loading branch information...
varkor committed Feb 25, 2019
1 parent b7763af commit e3297e7ce36a53d22088cd187e66454956eb659e
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/test/ui/issues/issue-57781.rs
@@ -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 e3297e7

Please sign in to comment.
You can’t perform that action at this time.