diff --git a/cranelift/isle/isle/isle_examples/link/borrows_main.rs b/cranelift/isle/isle/isle_examples/link/borrows_main.rs index 9de7d4ddded8..eaff4d9f918e 100644 --- a/cranelift/isle/isle/isle_examples/link/borrows_main.rs +++ b/cranelift/isle/isle/isle_examples/link/borrows_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod borrows; #[derive(Clone)] diff --git a/cranelift/isle/isle/isle_examples/link/iflets_main.rs b/cranelift/isle/isle/isle_examples/link/iflets_main.rs index 4c5717cbf407..ee974818f991 100644 --- a/cranelift/isle/isle/isle_examples/link/iflets_main.rs +++ b/cranelift/isle/isle/isle_examples/link/iflets_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod iflets; struct Context; diff --git a/cranelift/isle/isle/isle_examples/link/multi_constructor_main.rs b/cranelift/isle/isle/isle_examples/link/multi_constructor_main.rs index 3c05532ce077..c7bd08fd5bd1 100644 --- a/cranelift/isle/isle/isle_examples/link/multi_constructor_main.rs +++ b/cranelift/isle/isle/isle_examples/link/multi_constructor_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod multi_constructor; use multi_constructor::{ContextIter, IntoContextIter}; diff --git a/cranelift/isle/isle/isle_examples/link/multi_extractor_main.rs b/cranelift/isle/isle/isle_examples/link/multi_extractor_main.rs index ebfa38e30fdf..0554dd582976 100644 --- a/cranelift/isle/isle/isle_examples/link/multi_extractor_main.rs +++ b/cranelift/isle/isle/isle_examples/link/multi_extractor_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod multi_extractor; use multi_extractor::{ContextIter, IntoContextIter}; diff --git a/cranelift/isle/isle/isle_examples/link/test_main.rs b/cranelift/isle/isle/isle_examples/link/test_main.rs index 733e2a20193b..87f633e2ec6f 100644 --- a/cranelift/isle/isle/isle_examples/link/test_main.rs +++ b/cranelift/isle/isle/isle_examples/link/test_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod test; struct Context; diff --git a/cranelift/isle/isle/isle_examples/run/iconst_main.rs b/cranelift/isle/isle/isle_examples/run/iconst_main.rs index d53edea43831..275054993780 100644 --- a/cranelift/isle/isle/isle_examples/run/iconst_main.rs +++ b/cranelift/isle/isle/isle_examples/run/iconst_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod iconst; struct Context; diff --git a/cranelift/isle/isle/isle_examples/run/let_shadowing_main.rs b/cranelift/isle/isle/isle_examples/run/let_shadowing_main.rs index 37ddb0bcc50b..ec57de3383e1 100644 --- a/cranelift/isle/isle/isle_examples/run/let_shadowing_main.rs +++ b/cranelift/isle/isle/isle_examples/run/let_shadowing_main.rs @@ -1,3 +1,6 @@ +extern crate alloc; +extern crate core; + mod let_shadowing; struct Context; diff --git a/cranelift/isle/isle/src/codegen.rs b/cranelift/isle/isle/src/codegen.rs index c215e1db74ea..78a8fee729e7 100644 --- a/cranelift/isle/isle/src/codegen.rs +++ b/cranelift/isle/isle/src/codegen.rs @@ -166,7 +166,7 @@ impl<'a> Codegen<'a> { } writeln!(code, "\nuse super::*; // Pulls in all external types.").unwrap(); - writeln!(code, "use std::marker::PhantomData;").unwrap(); + writeln!(code, "use core::marker::PhantomData;").unwrap(); } fn generate_trait_sig(&self, code: &mut String, indent: &str, sig: &ExternalSig) { @@ -271,38 +271,38 @@ pub trait Length {{ fn len(&self) -> usize; }} -impl Length for std::vec::Vec {{ +impl Length for alloc::vec::Vec {{ fn len(&self) -> usize {{ - std::vec::Vec::len(self) + alloc::vec::Vec::len(self) }} }} pub struct ContextIterWrapper {{ iter: I, - _ctx: std::marker::PhantomData, + _ctx: core::marker::PhantomData, }} impl Default for ContextIterWrapper {{ fn default() -> Self {{ ContextIterWrapper {{ iter: I::default(), - _ctx: std::marker::PhantomData + _ctx: core::marker::PhantomData }} }} }} -impl std::ops::Deref for ContextIterWrapper {{ +impl core::ops::Deref for ContextIterWrapper {{ type Target = I; fn deref(&self) -> &I {{ &self.iter }} }} -impl std::ops::DerefMut for ContextIterWrapper {{ +impl core::ops::DerefMut for ContextIterWrapper {{ fn deref_mut(&mut self) -> &mut I {{ &mut self.iter }} }} impl From for ContextIterWrapper {{ fn from(iter: I) -> Self {{ - Self {{ iter, _ctx: std::marker::PhantomData }} + Self {{ iter, _ctx: core::marker::PhantomData }} }} }} impl ContextIter for ContextIterWrapper {{ @@ -322,7 +322,7 @@ impl IntoContextIter for ContextIterWrapper { fn into_context_iter(self) -> Self::IntoIter {{ ContextIterWrapper {{ iter: self.iter.into_iter(), - _ctx: std::marker::PhantomData + _ctx: core::marker::PhantomData }} }} }}