Skip to content

Commit

Permalink
Merge pull request rust-ndarray#404 from jturner314/slice-unsafe-code2
Browse files Browse the repository at this point in the history
Allow use of s![] with #[deny(unsafe_code)]
  • Loading branch information
bluss authored Jan 11, 2018
2 parents 067bb9f + 6cdf3b9 commit 8126097
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ macro_rules! s(
match $r {
r => {
let out_dim = $crate::SliceNextDim::next_dim(&r, $dim);
#[allow(unsafe_code)]
unsafe {
$crate::SliceInfo::new_unchecked(
[$($stack)* s!(@convert r, $s)],
Expand All @@ -552,6 +553,7 @@ macro_rules! s(
match $r {
r => {
let out_dim = $crate::SliceNextDim::next_dim(&r, $dim);
#[allow(unsafe_code)]
unsafe {
$crate::SliceInfo::new_unchecked(
[$($stack)* s!(@convert r)],
Expand Down
1 change: 1 addition & 0 deletions tests/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn test_mat_mul() {
}


#[deny(unsafe_code)]
#[test]
fn test_slice()
{
Expand Down

0 comments on commit 8126097

Please sign in to comment.