Fix the wrong subtraction in align_offset intrinsic.
This commit is contained in:
parent
a3a7203e2c
commit
749d8a880f
2 changed files with 18 additions and 2 deletions
16
src/test/run-pass/align-offset-sign.rs
Normal file
16
src/test/run-pass/align-offset-sign.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(align_offset)]
|
||||
|
||||
fn main() {
|
||||
let x = 1 as *const u8;
|
||||
assert_eq!(x.align_offset(8), 7);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue