Always use extern crate std in cranelift-codegen

This commit is contained in:
bjorn3
2019-09-28 15:52:23 +02:00
committed by Dan Gohman
parent a114423d0a
commit 10e226f9ff
63 changed files with 89 additions and 90 deletions

View File

@@ -11,8 +11,8 @@
use crate::ir::Constant;
use crate::HashMap;
use cranelift_entity::EntityRef;
use std::collections::BTreeMap;
use std::vec::Vec;
use alloc::collections::BTreeMap;
use alloc::vec::Vec;
/// This type describes the actual constant data.
pub type ConstantData = Vec<u8>;

View File

@@ -19,7 +19,7 @@ use core::iter;
use core::mem;
use core::ops::{Index, IndexMut};
use core::u16;
use std::vec::Vec;
use alloc::vec::Vec;
/// A data flow graph defines all instructions and extended basic blocks in a function as well as
/// the data flow dependencies between them. The DFG also tracks values which can be either
@@ -1093,7 +1093,7 @@ mod tests {
use crate::cursor::{Cursor, FuncCursor};
use crate::ir::types;
use crate::ir::{Function, InstructionData, Opcode, TrapCode};
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn make_inst() {

View File

@@ -456,7 +456,7 @@ impl From<Table> for AnyEntity {
mod tests {
use super::*;
use core::u32;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn value_with_number() {

View File

@@ -9,7 +9,7 @@ use crate::ir::{ArgumentLoc, ExternalName, SigRef, Type};
use crate::isa::{CallConv, RegInfo, RegUnit};
use core::fmt;
use core::str::FromStr;
use std::vec::Vec;
use alloc::vec::Vec;
/// Function signature.
///
@@ -335,7 +335,7 @@ impl fmt::Display for ExtFuncData {
mod tests {
use super::*;
use crate::ir::types::{B8, F32, I32};
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn argument_type() {

View File

@@ -121,7 +121,7 @@ mod tests {
use super::ExternalName;
use crate::ir::LibCall;
use core::u32;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn display_testcase() {

View File

@@ -8,7 +8,7 @@ use core::fmt::{self, Display, Formatter};
use core::iter::FromIterator;
use core::str::{from_utf8, FromStr};
use core::{i32, u32};
use std::vec::Vec;
use alloc::vec::Vec;
/// Convert a type into a vector of bytes; all implementors in this file must use little-endian
/// orderings of bytes to match WebAssembly's little-endianness.
@@ -940,7 +940,7 @@ mod tests {
use core::mem;
use core::str::FromStr;
use core::{f32, f64};
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn format_imm64() {

View File

@@ -9,7 +9,7 @@
use core::fmt::{self, Display, Formatter};
use core::ops::{Deref, DerefMut};
use core::str::FromStr;
use std::vec::Vec;
use alloc::vec::Vec;
use crate::ir;
use crate::ir::types;
@@ -560,7 +560,7 @@ pub enum ResolvedConstraint {
#[cfg(test)]
mod tests {
use super::*;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn opcodes() {

View File

@@ -6,7 +6,7 @@
use crate::ir::entities::Ebb;
use core::fmt::{self, Display, Formatter};
use core::slice::{Iter, IterMut};
use std::vec::Vec;
use alloc::vec::Vec;
/// Contents of a jump table.
///
@@ -85,7 +85,7 @@ mod tests {
use super::JumpTableData;
use crate::entity::EntityRef;
use crate::ir::Ebb;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn empty() {

View File

@@ -751,7 +751,7 @@ mod tests {
use crate::entity::EntityRef;
use crate::ir::{Ebb, Inst, ProgramOrder, SourceLoc};
use core::cmp::Ordering;
use std::vec::Vec;
use alloc::vec::Vec;
struct LayoutCursor<'f> {
/// Borrowed function layout. Public so it can be re-borrowed from this cursor.

View File

@@ -209,7 +209,7 @@ fn make_funcref(
#[cfg(test)]
mod tests {
use super::*;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn display() {

View File

@@ -100,7 +100,7 @@ pub struct ValueLabelStart {
#[derive(Debug, Clone)]
pub enum ValueLabelAssignments {
/// Original value labels assigned at transform.
Starts(std::vec::Vec<ValueLabelStart>),
Starts(alloc::vec::Vec<ValueLabelStart>),
/// A value alias to original value.
Alias {

View File

@@ -148,7 +148,7 @@ mod tests {
use super::*;
use crate::entity::EntityRef;
use crate::ir::{Ebb, Inst};
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn convert() {

View File

@@ -54,7 +54,7 @@ impl fmt::Display for SourceLoc {
#[cfg(test)]
mod tests {
use crate::ir::SourceLoc;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn display() {

View File

@@ -11,7 +11,7 @@ use core::fmt;
use core::ops::{Index, IndexMut};
use core::slice;
use core::str::FromStr;
use std::vec::Vec;
use alloc::vec::Vec;
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
@@ -343,7 +343,7 @@ mod tests {
use super::*;
use crate::ir::types;
use crate::ir::Function;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn stack_slot() {

View File

@@ -103,7 +103,7 @@ impl FromStr for TrapCode {
#[cfg(test)]
mod tests {
use super::*;
use std::string::ToString;
use alloc::string::ToString;
// Everything but user-defined codes.
const CODES: [TrapCode; 11] = [

View File

@@ -363,7 +363,7 @@ impl Default for Type {
#[cfg(test)]
mod tests {
use super::*;
use std::string::ToString;
use alloc::string::ToString;
#[test]
fn basic_scalars() {