Get lightbeam compiling on stable Rust (#2370)

This will hopefully remove a small thorn in our side with periodic
nightly breakage due to nightly features changing. This commit moves
lightbeam to stable Rust, swapping out `staticvec` for `arrayvec` and
otherwise updating some dependencies (namely `dynasm`) to compile with
stable.

This then also updates CI appropriately to not use a pinned nightly and
instead us a floating `nightly` channel so we can head off any breakage
coming up ASAP.
This commit is contained in:
Alex Crichton
2020-11-06 13:23:08 -06:00
committed by GitHub
parent 8af2dbfbac
commit d2daf5064e
8 changed files with 106 additions and 87 deletions

View File

@@ -2,6 +2,7 @@ use capstone::prelude::*;
use dynasmrt::AssemblyOffset;
use std::error::Error;
use std::fmt::{Display, Write};
use std::io;
pub fn disassemble<D: Display>(
mem: &[u8],
@@ -10,10 +11,11 @@ pub fn disassemble<D: Display>(
let cs = Capstone::new()
.x86()
.mode(arch::x86::ArchMode::Mode64)
.build()?;
.build()
.map_err(map_caperr)?;
println!("{} bytes:", mem.len());
let insns = cs.disasm_all(&mem, 0x0)?;
let insns = cs.disasm_all(&mem, 0x0).map_err(map_caperr)?;
for i in insns.iter() {
let mut line = String::new();
@@ -49,3 +51,7 @@ pub fn disassemble<D: Display>(
Ok(())
}
fn map_caperr(err: capstone::Error) -> Box<dyn Error> {
Box::new(io::Error::new(io::ErrorKind::Other, err.to_string()))
}