Skip to content

Commit

Permalink
Made CodeAssembler traits public (#236)
Browse files Browse the repository at this point in the history
* Made CodeAssembler traits public

* Renamed fn_asm_traits.rs to asm_traits.rs and exported it

* Allow inline and doc warnings
  • Loading branch information
Kixiron committed Dec 15, 2021
1 parent 6909233 commit dbfb63d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ sealed class TraitGroup {
}

void GenerateAsmTraits(TraitGroup[] traitGroups) {
var filename = genTypes.Dirs.GetRustFilename("code_asm", "fn_asm_traits.rs");
var filename = genTypes.Dirs.GetRustFilename("code_asm", "asm_traits.rs");
using (var writer = new FileWriter(TargetLanguage.Rust, FileUtils.OpenWrite(filename))) {
writer.WriteFileHeader();
writer.WriteLine(RustConstants.InnerAttributeAllowNonCamelCaseTypes);
Expand Down Expand Up @@ -565,7 +565,7 @@ sealed class TraitGroup {
var filename = genTypes.Dirs.GetRustFilename("code_asm", "fn_asm_pub.rs");
using (var writer = new FileWriter(TargetLanguage.Rust, FileUtils.OpenWrite(filename))) {
writer.WriteFileHeader();
writer.WriteLine("use crate::code_asm::fn_asm_traits::*;");
writer.WriteLine("use crate::code_asm::asm_traits::*;");
writer.WriteLine($"use crate::code_asm::{CodeAssembler};");
writer.WriteLine($"use crate::{ErrorType};");
writer.WriteLine();
Expand Down Expand Up @@ -696,7 +696,7 @@ sealed class TraitGroup {
writer.WriteFileHeader();
writer.WriteLine("#![allow(clippy::if_same_then_else)]");
writer.WriteLine();
writer.WriteLine("use crate::code_asm::fn_asm_traits::*;");
writer.WriteLine("use crate::code_asm::asm_traits::*;");
writer.WriteLine("use crate::code_asm::mem::*;");
writer.WriteLine($"use crate::code_asm::op_state::{memoryOperandSizeType.Name(idConverter)};");
writer.WriteLine("use crate::code_asm::reg::*;");
Expand Down
4 changes: 3 additions & 1 deletion src/rust/iced-x86/src/code_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
//!
//! [`CodeAssembler`]: struct.CodeAssembler.html

#[allow(missing_docs, clippy::missing_errors_doc)]
pub mod asm_traits;
mod code_asm_methods;
#[allow(clippy::missing_inline_in_public_items)]
mod fn_asm_impl;
mod fn_asm_pub;
mod fn_asm_traits;
mod mem;
mod op_state;
mod reg;
Expand Down
2 changes: 1 addition & 1 deletion src/rust/iced-x86/src/code_asm/fn_asm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#![allow(clippy::if_same_then_else)]

use crate::code_asm::fn_asm_traits::*;
use crate::code_asm::asm_traits::*;
use crate::code_asm::mem::*;
use crate::code_asm::op_state::MemoryOperandSize;
use crate::code_asm::reg::*;
Expand Down
2 changes: 1 addition & 1 deletion src/rust/iced-x86/src/code_asm/fn_asm_pub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// ⚠️This file was generated by GENERATOR!🦹‍♂️

use crate::code_asm::fn_asm_traits::*;
use crate::code_asm::asm_traits::*;
use crate::code_asm::CodeAssembler;
use crate::IcedError;

Expand Down

0 comments on commit dbfb63d

Please sign in to comment.