Skip to content

Instantly share code, notes, and snippets.

@quux00
Created January 24, 2014 03:15
Show Gist options
  • Save quux00/8591491 to your computer and use it in GitHub Desktop.
Save quux00/8591491 to your computer and use it in GitHub Desktop.
rust enums
use std::sync::atomics::AtomicBool;
use std::sync::atomics::Ordering;
// error unresolved import: there is no `Relaxed` in `std::sync::atomics::Ordering`
// use std::sync::atomics::Ordering::Relaxed;
fn main() {
let mut ab = AtomicBool::new(false);
let val1 = ab.load(Ordering::Relaxed); // error: unresolved import:
// there is no `Relaxed` in `std::sync::atomics::Ordering`
println!("{:?}", val1);
ab.store(true, Ordering.Relaxed); // error: unresolved name `Ordering`.
let val2 = ab.load( Ordering(Relaxed)) ; // error: unresolved name `Relaxed`.
println!("{:?}", val2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment