mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 01:11:06 +00:00
Merge pull request #1259 from ctjhoa/master
Fix warning on ATOMIC_USIZE_INIT & ATOMIC_BOOL_INIT
This commit is contained in:
commit
632a2b2979
@ -1,5 +1,5 @@
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
use proc_macro2::{Ident, Literal, Span, TokenStream};
|
use proc_macro2::{Ident, Literal, Span, TokenStream};
|
||||||
@ -79,7 +79,7 @@ impl TryToTokens for ast::Program {
|
|||||||
// of the wasm executable. For now it's just a plain old static, but we'll
|
// of the wasm executable. For now it's just a plain old static, but we'll
|
||||||
// eventually have it actually in its own section.
|
// eventually have it actually in its own section.
|
||||||
|
|
||||||
static CNT: AtomicUsize = ATOMIC_USIZE_INIT;
|
static CNT: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
let generated_static_name = format!(
|
let generated_static_name = format!(
|
||||||
"__WASM_BINDGEN_GENERATED_{}",
|
"__WASM_BINDGEN_GENERATED_{}",
|
||||||
|
@ -4,8 +4,8 @@ use std::fmt;
|
|||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
use std::sync::atomic::Ordering::SeqCst;
|
use std::sync::atomic::Ordering::SeqCst;
|
||||||
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT};
|
use std::sync::atomic::{AtomicBool};
|
||||||
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};
|
use std::sync::atomic::{AtomicUsize};
|
||||||
|
|
||||||
use ast;
|
use ast;
|
||||||
use proc_macro2::{self, Ident};
|
use proc_macro2::{self, Ident};
|
||||||
@ -109,8 +109,8 @@ pub struct ShortHash<T>(pub T);
|
|||||||
|
|
||||||
impl<T: Hash> fmt::Display for ShortHash<T> {
|
impl<T: Hash> fmt::Display for ShortHash<T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
static HASHED: AtomicBool = ATOMIC_BOOL_INIT;
|
static HASHED: AtomicBool = AtomicBool::new(false);
|
||||||
static HASH: AtomicUsize = ATOMIC_USIZE_INIT;
|
static HASH: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
// Try to amortize the cost of loading env vars a lot as we're gonna be
|
// Try to amortize the cost of loading env vars a lot as we're gonna be
|
||||||
// hashing for a lot of symbols.
|
// hashing for a lot of symbols.
|
||||||
|
@ -9,7 +9,7 @@ extern crate quote;
|
|||||||
use proc_macro2::*;
|
use proc_macro2::*;
|
||||||
use std::sync::atomic::*;
|
use std::sync::atomic::*;
|
||||||
|
|
||||||
static CNT: AtomicUsize = ATOMIC_USIZE_INIT;
|
static CNT: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn wasm_bindgen_test(
|
pub fn wasm_bindgen_test(
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::atomic::ATOMIC_USIZE_INIT;
|
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
|
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
|
||||||
use std::sync::{Arc, Mutex, MutexGuard};
|
use std::sync::{Arc, Mutex, MutexGuard};
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ pub struct Scene {
|
|||||||
inner: raytracer::scene::Scene,
|
inner: raytracer::scene::Scene,
|
||||||
}
|
}
|
||||||
|
|
||||||
static NEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
|
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
impl Scene {
|
impl Scene {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user