Skip to content

Commit

Permalink
Merge pull request #756 from hacspec/frontend-fix-crate-type
Browse files Browse the repository at this point in the history
fix(frontend): kill `crate_type` in `HaxMeta`
  • Loading branch information
W95Psp authored Jul 10, 2024
2 parents 87a5376 + 61d797c commit 640d31e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions cli/driver/src/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,9 @@ impl Callbacks for ExtractionCallbacks {

let cg_metadata = opts.cg.metadata[0].clone();
let crate_name = opts.crate_name.clone().unwrap();
let crate_type = match &opts.crate_types[..] {
[crate_type] => format!("{}", crate_type),
_ => panic!(),
};

let output_dir = compiler.sess.io.output_dir.clone().unwrap();
let haxmeta_path =
output_dir.join(format!("{crate_type}{crate_name}-{cg_metadata}.haxmeta",));
let haxmeta_path = output_dir.join(format!("{crate_name}-{cg_metadata}.haxmeta",));

let mut file = BufWriter::new(File::create(&haxmeta_path).unwrap());

Expand All @@ -271,7 +266,6 @@ impl Callbacks for ExtractionCallbacks {
convert_thir(&self.clone().into(), self.macro_calls.clone(), tcx);
let haxmeta: HaxMeta<Body> = HaxMeta {
crate_name,
crate_type,
cg_metadata,
externs,
impl_infos,
Expand Down
1 change: 0 additions & 1 deletion hax-types/src/driver_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub enum HaxDriverMessage {
#[derive(Debug, Clone)]
pub struct HaxMeta<Body: hax_frontend_exporter::IsBody> {
pub crate_name: String,
pub crate_type: String,
pub cg_metadata: String,
pub externs: Vec<PathBuf>,
pub items: Vec<hax_frontend_exporter::Item<Body>>,
Expand Down

0 comments on commit 640d31e

Please sign in to comment.