Skip to content

Commit

Permalink
Fix miri imports for inclusion in libstd
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Oct 11, 2020
1 parent 8eee2e4 commit a066695
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/backtrace/miri.rs
@@ -1,5 +1,5 @@
use std::boxed::Box;
use std::ffi::c_void;
use alloc::boxed::Box;
use core::ffi::c_void;

extern "Rust" {
fn miri_get_backtrace(flags: u64) -> Box<[*mut ()]>;
Expand Down Expand Up @@ -32,7 +32,7 @@ impl Frame {
}

pub fn sp(&self) -> *mut c_void {
std::ptr::null_mut()
core::ptr::null_mut()
}

pub fn symbol_address(&self) -> *mut c_void {
Expand Down
14 changes: 7 additions & 7 deletions src/symbolize/miri.rs
@@ -1,9 +1,9 @@
use core::ffi::c_void;
use core::marker::PhantomData;

use crate::backtrace::miri::{resolve_addr, Frame};
use crate::symbolize::{ResolveWhat, SymbolName};
use crate::types::BytesOrWideString;
use super::super::backtrace::miri::{resolve_addr, Frame};
use super::BytesOrWideString;
use super::{ResolveWhat, SymbolName};

pub unsafe fn resolve(what: ResolveWhat<'_>, cb: &mut dyn FnMut(&super::Symbol)) {
let sym = match what {
Expand Down Expand Up @@ -45,10 +45,10 @@ impl<'a> Symbol<'a> {
Some(self.inner.inner.colno)
}

pub fn filename(&self) -> Option<&::std::path::Path> {
use std::path::Path;
Some(Path::new(
std::str::from_utf8(&self.inner.inner.filename).unwrap(),
#[cfg(feature = "std")]
pub fn filename(&self) -> Option<&std::path::Path> {
Some(std::path::Path::new(
core::str::from_utf8(&self.inner.inner.filename).unwrap(),
))
}
}

0 comments on commit a066695

Please sign in to comment.