TL;DR: prefix await
is better because it is consistent with the rest of the language despite of its drawbacks.
There's ongoing discussion whether prefix or postfix await
expression should be added to Rust.
//! A simple utility to count the number of allocated objects per type: | |
//! declared a field of type `ObjectCounter<T>` inside your type `T`, | |
//! and then `ObjectCounter::<T>::count()` will return the number of | |
//! allocated objects. | |
//! | |
//! This could be used for example a quick and dirty way to count | |
//! domain-specific objects e. g. sockets, connections, buffers, | |
//! requests etc. | |
#![feature(alloc_static)] |
//! Sample `lazy_static` function which provides an utility | |
//! similar to [lazy_static crate](https://github.com/rust-lang-nursery/lazy-static.rs) | |
//! but without any macros. | |
#![feature(alloc_static)] | |
use std::ptr; | |
use std::collections::HashMap; | |
use std::sync::atomic::*; |
//! Sample `lazy_static` function which provides an utility | |
//! similar to [lazy_static crate](https://github.com/rust-lang-nursery/lazy-static.rs) | |
//! but without any macros. | |
#![feature(alloc_static)] | |
use std::ptr; | |
use std::collections::HashMap; | |
use std::sync::atomic::*; | |
use std::cell::UnsafeCell; |
//! `singleton::<T>()` creates `T` once, and returns | |
//! a pointer to the same instances on subsequent calls. | |
#![feature(alloc_static)] | |
use std::ptr; | |
use std::sync::atomic::*; | |
use std::cell::UnsafeCell; | |
/// The function |
diff --git a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java | |
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java | |
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java | |
@@ -1115,19 +1115,21 @@ | |
} | |
} | |
- static String[] INDENTS = new String[0]; | |
+ static volatile String[] INDENTS = new String[0]; | |
#!/usr/bin/env python3 | |
from z3 import * | |
Person = Datatype("Person") | |
Person.declare("knight") | |
Person.declare("knave") | |
Person.declare("joker") | |
Person = Person.create() |
#[test] | |
fn test_bool_1() { | |
do_conformance_test("tests/rust-testcases/bool.sky", "# Boolean tests\n\nTrue + 9223372036854775807 ### Type of parameters mismatch\n") | |
} | |
#[test] | |
fn test_struct_1() { | |
do_conformance_test("tests/rust-testcases/struct.sky", "# Struct tests\n\n# Comparison\nassert_(struct() == struct())\nassert_(struct(a=1) == struct(a=1))\nassert_(struct(a=1, b=False) == struct(a=1, b=False))\n\n# Order of fields is not important for comparison\nassert_(struct(a=1, b=2) == struct(b=2, a=1))\n\n# Inequality\nassert_(struct(a=2) != struct())\nassert_(struct() != struct(a=2))\nassert_(struct(a=2) != struct(a=1))\nassert_(struct(a=2) != struct(b=1))\nassert_(struct(a=1, b=2) != struct(a=1, b=\"2\"))\n") | |
} |
use std::mem; | |
use std::pin::Pin; | |
use std::ops::DerefMut; | |
/// Self-referential struct | |
struct SelfRef<A, B> | |
where B: ?Sized, A: DerefMut, A::Target: Unpin, | |
{ | |
/// Holds a pointer of type A |
use std::mem; | |
#[derive(Copy, Clone, Eq, PartialEq, Debug)] | |
struct Walk { | |
axis: u32, | |
positive: bool, | |
} | |
#[derive(Debug, Copy, Clone)] | |
struct Coord { |