File tree 3 files changed +16
-13
lines changed
crates/intrinsic-test/src
3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ pub struct ArmArchitectureTest {
21
21
}
22
22
23
23
impl SupportedArchitectureTest for ArmArchitectureTest {
24
- fn create ( cli_options : ProcessedCli ) -> Self {
24
+ fn create ( cli_options : ProcessedCli ) -> Box < Self > {
25
25
let a32 = cli_options. target . contains ( "v7" ) ;
26
26
let mut intrinsics = get_neon_intrinsics ( & cli_options. filename , & cli_options. target )
27
27
. expect ( "Error parsing input file" ) ;
@@ -43,10 +43,10 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
43
43
. collect :: < Vec < _ > > ( ) ;
44
44
intrinsics. dedup ( ) ;
45
45
46
- Self {
46
+ Box :: new ( Self {
47
47
intrinsics : intrinsics,
48
48
cli_options : cli_options,
49
- }
49
+ } )
50
50
}
51
51
52
52
fn build_c_file ( & self ) -> bool {
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ pub mod values;
16
16
/// Architectures must support this trait
17
17
/// to be successfully tested.
18
18
pub trait SupportedArchitectureTest {
19
- fn create ( cli_options : ProcessedCli ) -> Self ;
19
+ fn create ( cli_options : ProcessedCli ) -> Box < Self >
20
+ where
21
+ Self : Sized ;
20
22
fn build_c_file ( & self ) -> bool ;
21
23
fn build_rust_file ( & self ) -> bool ;
22
24
fn compare_outputs ( & self ) -> bool ;
Original file line number Diff line number Diff line change @@ -14,15 +14,16 @@ fn main() {
14
14
let args: Cli = clap:: Parser :: parse ( ) ;
15
15
let processed_cli_options = ProcessedCli :: new ( args) ;
16
16
17
- let test_environment_result = match processed_cli_options. target . as_str ( ) {
18
- "aarch64-unknown-linux-gnu"
19
- | "armv7-unknown-linux-gnueabihf"
20
- | "aarch64_be-unknown-linux-gnu" => {
21
- Some ( ArmArchitectureTest :: create ( processed_cli_options) )
22
- }
23
-
24
- _ => None ,
25
- } ;
17
+ let test_environment_result: Option < Box < dyn SupportedArchitectureTest > > =
18
+ match processed_cli_options. target . as_str ( ) {
19
+ "aarch64-unknown-linux-gnu"
20
+ | "armv7-unknown-linux-gnueabihf"
21
+ | "aarch64_be-unknown-linux-gnu" => {
22
+ Some ( ArmArchitectureTest :: create ( processed_cli_options) )
23
+ }
24
+
25
+ _ => None ,
26
+ } ;
26
27
27
28
if test_environment_result. is_none ( ) {
28
29
std:: process:: exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments