Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cranelift/isle/isle/isle_examples/link/borrows_main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod borrows;

#[derive(Clone)]
Expand Down
3 changes: 3 additions & 0 deletions cranelift/isle/isle/isle_examples/link/iflets_main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod iflets;

struct Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod multi_constructor;
use multi_constructor::{ContextIter, IntoContextIter};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod multi_extractor;

use multi_extractor::{ContextIter, IntoContextIter};
Expand Down
3 changes: 3 additions & 0 deletions cranelift/isle/isle/isle_examples/link/test_main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod test;

struct Context;
Expand Down
3 changes: 3 additions & 0 deletions cranelift/isle/isle/isle_examples/run/iconst_main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod iconst;

struct Context;
Expand Down
3 changes: 3 additions & 0 deletions cranelift/isle/isle/isle_examples/run/let_shadowing_main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern crate alloc;
extern crate core;

mod let_shadowing;

struct Context;
Expand Down
18 changes: 9 additions & 9 deletions cranelift/isle/isle/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -271,38 +271,38 @@ pub trait Length {{
fn len(&self) -> usize;
}}

impl<T> Length for std::vec::Vec<T> {{
impl<T> Length for alloc::vec::Vec<T> {{
fn len(&self) -> usize {{
std::vec::Vec::len(self)
alloc::vec::Vec::len(self)
}}
}}

pub struct ContextIterWrapper<I, C> {{
iter: I,
_ctx: std::marker::PhantomData<C>,
_ctx: core::marker::PhantomData<C>,
}}
impl<I: Default, C> Default for ContextIterWrapper<I, C> {{
fn default() -> Self {{
ContextIterWrapper {{
iter: I::default(),
_ctx: std::marker::PhantomData
_ctx: core::marker::PhantomData
}}
}}
}}
impl<I, C> std::ops::Deref for ContextIterWrapper<I, C> {{
impl<I, C> core::ops::Deref for ContextIterWrapper<I, C> {{
type Target = I;
fn deref(&self) -> &I {{
&self.iter
}}
}}
impl<I, C> std::ops::DerefMut for ContextIterWrapper<I, C> {{
impl<I, C> core::ops::DerefMut for ContextIterWrapper<I, C> {{
fn deref_mut(&mut self) -> &mut I {{
&mut self.iter
}}
}}
impl<I: Iterator, C: Context> From<I> for ContextIterWrapper<I, C> {{
fn from(iter: I) -> Self {{
Self {{ iter, _ctx: std::marker::PhantomData }}
Self {{ iter, _ctx: core::marker::PhantomData }}
}}
}}
impl<I: Iterator, C: Context> ContextIter for ContextIterWrapper<I, C> {{
Expand All @@ -322,7 +322,7 @@ impl<I: IntoIterator, C: Context> IntoContextIter for ContextIterWrapper<I, C> {
fn into_context_iter(self) -> Self::IntoIter {{
ContextIterWrapper {{
iter: self.iter.into_iter(),
_ctx: std::marker::PhantomData
_ctx: core::marker::PhantomData
}}
}}
}}
Expand Down