suppress dead_code warning when target_feature = "avx2"

This commit is contained in:
Kogia-sima 2020-12-16 15:44:20 +09:00
parent a965f03321
commit 9b733f973f
8 changed files with 3 additions and 72 deletions

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: expected boolean literal
--> $DIR/invalid_option_value.rs:5:38
|

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: `path` option must be specified.
--> $DIR/no_path.rs:4:10
|

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: keyword argument repeated.
--> $DIR/repeated_arguments.rs:6:21
|

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: Failed to compile template.
caused by: Rust Syntax Error (LexError)

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: Failed to compile template.
caused by: Parse error (Unterminated code block)

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: Failed to compile template.
caused by: Rust Syntax Error (expected expression)

View File

@ -1,13 +1,3 @@
warning: unused import: `std::mem`
--> $DIR/mod.rs:12:5
|
12 | use std::mem;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
error: Unknown option: `patth`
--> $DIR/unknown_option.rs:5:12
|

View File

@ -2,6 +2,8 @@
//!
//! By default sailfish replaces the characters `&"'<>` with the equivalent html.
#![cfg_attr(target_feature = "avx2", allow(dead_code))]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod avx2;
mod fallback;
@ -9,7 +11,6 @@ mod naive;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod sse2;
use std::mem;
use std::sync::atomic::{AtomicPtr, Ordering};
use super::buffer::Buffer;
@ -69,7 +70,7 @@ pub fn escape_to_buf(feed: &str, buf: &mut Buffer) {
#[cfg(not(target_feature = "avx2"))]
{
let fun = FN.load(Ordering::Relaxed);
mem::transmute::<FnRaw, fn(&str, &mut Buffer)>(fun)(feed, buf);
std::mem::transmute::<FnRaw, fn(&str, &mut Buffer)>(fun)(feed, buf);
}
}