Always use extern crate std in cranelift-codegen
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -209,7 +209,7 @@ fn make_funcref(
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::string::ToString;
|
||||
use alloc::string::ToString;
|
||||
|
||||
#[test]
|
||||
fn display() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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] = [
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user