Update to Rust 2018 edition (#632)
* initial cargo fix run * Upgrade cranelift-entity crate * Upgrade bforest crate * Upgrade the codegen crate * Upgrade the faerie crate * Upgrade the filetests crate * Upgrade the codegen-meta crate * Upgrade the frontend crate * Upgrade the cranelift-module crate * Upgrade the cranelift-native crate * Upgrade the cranelift-preopt crate * Upgrade the cranelift-reader crate * Upgrade the cranelift-serde crate * Upgrade the cranelift-simplejit crate * Upgrade the cranelift or cranelift-umbrella crate * Upgrade the cranelift-wasm crate * Upgrade cranelift-tools crate * Use new import style on remaining files * run format-all.sh * run test-all.sh, update Readme and travis ci configuration fixed an AssertionError also * Remove deprecated functions
This commit is contained in:
committed by
Dan Gohman
parent
e3db942b0c
commit
effe6c04e4
@@ -9,6 +9,7 @@ repository = "https://github.com/CraneStation/cranelift"
|
||||
categories = ["no-std"]
|
||||
readme = "README.md"
|
||||
keywords = ["entity", "set", "map"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//! Boxed slices for `PrimaryMap`.
|
||||
|
||||
use iter::{Iter, IterMut};
|
||||
use keys::Keys;
|
||||
use crate::iter::{Iter, IterMut};
|
||||
use crate::keys::Keys;
|
||||
use crate::EntityRef;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice;
|
||||
use EntityRef;
|
||||
|
||||
/// A slice mapping `K -> V` allocating dense entity references.
|
||||
///
|
||||
@@ -144,7 +144,7 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use primary::PrimaryMap;
|
||||
use crate::primary::PrimaryMap;
|
||||
|
||||
// `EntityRef` impl for testing.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! A double-ended iterator over entity references and entities.
|
||||
|
||||
use crate::EntityRef;
|
||||
use std::iter::Enumerate;
|
||||
use std::marker::PhantomData;
|
||||
use std::slice;
|
||||
use EntityRef;
|
||||
|
||||
/// Iterate over all keys in order.
|
||||
pub struct Iter<'a, K: EntityRef, V>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//! When `std::iter::Step` is stabilized, `Keys` could be implemented as a wrapper around
|
||||
//! `std::ops::Range`, but for now, we implement it manually.
|
||||
|
||||
use crate::EntityRef;
|
||||
use std::marker::PhantomData;
|
||||
use EntityRef;
|
||||
|
||||
/// Iterate over all keys in order.
|
||||
pub struct Keys<K: EntityRef> {
|
||||
|
||||
@@ -71,7 +71,7 @@ pub extern crate core as __core;
|
||||
pub trait EntityRef: Copy + Eq {
|
||||
/// Create a new entity reference from a small integer.
|
||||
/// This should crash if the requested index is not representable.
|
||||
fn new(usize) -> Self;
|
||||
fn new(_: usize) -> Self;
|
||||
|
||||
/// Get the index that was used to create this entity reference.
|
||||
fn index(self) -> usize;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Small lists of entity references.
|
||||
use crate::EntityRef;
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::vec::Vec;
|
||||
use EntityRef;
|
||||
|
||||
/// A small list of entity references allocated from a pool.
|
||||
///
|
||||
@@ -483,7 +483,7 @@ impl<T: EntityRef> EntityList<T> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use super::{sclass_for_length, sclass_size};
|
||||
use EntityRef;
|
||||
use crate::EntityRef;
|
||||
|
||||
/// An opaque reference to an instruction in a function.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//! Densely numbered entity references as mapping keys.
|
||||
|
||||
use iter::{Iter, IterMut};
|
||||
use keys::Keys;
|
||||
use crate::iter::{Iter, IterMut};
|
||||
use crate::keys::Keys;
|
||||
use crate::EntityRef;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice;
|
||||
use std::vec::Vec;
|
||||
use EntityRef;
|
||||
|
||||
/// A mapping `K -> V` for densely indexed entity references.
|
||||
///
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
//! Densely numbered entity references as mapping keys.
|
||||
use boxed_slice::BoxedSlice;
|
||||
use iter::{Iter, IterMut};
|
||||
use keys::Keys;
|
||||
use crate::boxed_slice::BoxedSlice;
|
||||
use crate::iter::{Iter, IterMut};
|
||||
use crate::keys::Keys;
|
||||
use crate::EntityRef;
|
||||
use std::iter::FromIterator;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice;
|
||||
use std::vec::Vec;
|
||||
use EntityRef;
|
||||
|
||||
/// A primary mapping `K -> V` allocating dense entity references.
|
||||
///
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! Densely numbered entity references as set keys.
|
||||
|
||||
use keys::Keys;
|
||||
use crate::keys::Keys;
|
||||
use crate::EntityRef;
|
||||
use std::marker::PhantomData;
|
||||
use std::vec::Vec;
|
||||
use EntityRef;
|
||||
|
||||
/// A set of `K` for densely indexed entity references.
|
||||
///
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
//! > Briggs, Torczon, *An efficient representation for sparse sets*,
|
||||
//! ACM Letters on Programming Languages and Systems, Volume 2, Issue 1-4, March-Dec. 1993.
|
||||
|
||||
use map::SecondaryMap;
|
||||
use crate::map::SecondaryMap;
|
||||
use crate::EntityRef;
|
||||
use std::mem;
|
||||
use std::slice;
|
||||
use std::u32;
|
||||
use std::vec::Vec;
|
||||
use EntityRef;
|
||||
|
||||
/// Trait for extracting keys from values stored in a `SparseMap`.
|
||||
///
|
||||
@@ -230,7 +230,7 @@ pub type SparseSet<T> = SparseMap<T, T>;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use EntityRef;
|
||||
use crate::EntityRef;
|
||||
|
||||
/// An opaque reference to an instruction in a function.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
|
||||
Reference in New Issue
Block a user