Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4f92f0d3
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f92f0d3
编写于
7月 11, 2020
作者:
R
Ralf Jung
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove feature gate from tests
上级
0e4f335e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
10 addition
and
23 deletion
+10
-23
library/core/src/ptr/const_ptr.rs
library/core/src/ptr/const_ptr.rs
+0
-4
library/core/src/ptr/mut_ptr.rs
library/core/src/ptr/mut_ptr.rs
+0
-4
src/test/ui/consts/offset.rs
src/test/ui/consts/offset.rs
+0
-1
src/test/ui/consts/offset_from.rs
src/test/ui/consts/offset_from.rs
+0
-1
src/test/ui/consts/offset_from_ub.rs
src/test/ui/consts/offset_from_ub.rs
+0
-1
src/test/ui/consts/offset_from_ub.stderr
src/test/ui/consts/offset_from_ub.stderr
+10
-10
src/test/ui/offset_from.rs
src/test/ui/offset_from.rs
+0
-2
未找到文件。
library/core/src/ptr/const_ptr.rs
浏览文件 @
4f92f0d3
...
...
@@ -339,8 +339,6 @@ pub const fn wrapping_offset(self, count: isize) -> *const T
/// Basic usage:
///
/// ```
/// #![feature(ptr_offset_from)]
///
/// let a = [0; 5];
/// let ptr1: *const i32 = &a[1];
/// let ptr2: *const i32 = &a[3];
...
...
@@ -355,8 +353,6 @@ pub const fn wrapping_offset(self, count: isize) -> *const T
/// *Incorrect* usage:
///
/// ```rust,no_run
/// #![feature(ptr_offset_from)]
///
/// let ptr1 = Box::into_raw(Box::new(0u8)) as *const u8;
/// let ptr2 = Box::into_raw(Box::new(1u8)) as *const u8;
/// let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize);
...
...
library/core/src/ptr/mut_ptr.rs
浏览文件 @
4f92f0d3
...
...
@@ -510,8 +510,6 @@ pub const fn guaranteed_eq(self, other: *mut T) -> bool
/// Basic usage:
///
/// ```
/// #![feature(ptr_offset_from)]
///
/// let mut a = [0; 5];
/// let ptr1: *mut i32 = &mut a[1];
/// let ptr2: *mut i32 = &mut a[3];
...
...
@@ -526,8 +524,6 @@ pub const fn guaranteed_eq(self, other: *mut T) -> bool
/// *Incorrect* usage:
///
/// ```rust,no_run
/// #![feature(ptr_offset_from)]
///
/// let ptr1 = Box::into_raw(Box::new(0u8));
/// let ptr2 = Box::into_raw(Box::new(1u8));
/// let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize);
...
...
src/test/ui/consts/offset.rs
浏览文件 @
4f92f0d3
// run-pass
#![feature(const_ptr_offset)]
#![feature(const_ptr_offset_from)]
#![feature(ptr_offset_from)]
use
std
::
ptr
;
#[repr(C)]
...
...
src/test/ui/consts/offset_from.rs
浏览文件 @
4f92f0d3
...
...
@@ -2,7 +2,6 @@
#![feature(const_raw_ptr_deref)]
#![feature(const_ptr_offset_from)]
#![feature(ptr_offset_from)]
struct
Struct
{
field
:
(),
...
...
src/test/ui/consts/offset_from_ub.rs
浏览文件 @
4f92f0d3
#![feature(const_raw_ptr_deref)]
#![feature(const_ptr_offset_from)]
#![feature(ptr_offset_from)]
#[repr(C)]
struct
Struct
{
...
...
src/test/ui/consts/offset_from_ub.stderr
浏览文件 @
4f92f0d3
...
...
@@ -6,9 +6,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
| |
| ptr_offset_from cannot compute offset of pointers into different allocations.
| inside `std::ptr::const_ptr::<impl *const Struct>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:1
7
:27
| inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:1
6
:27
|
::: $DIR/offset_from_ub.rs:1
1
:1
::: $DIR/offset_from_ub.rs:1
0
:1
|
LL | / pub const DIFFERENT_ALLOC: usize = {
LL | |
...
...
@@ -29,9 +29,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
| |
| unable to turn bytes into a pointer
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `NOT_PTR` at $DIR/offset_from_ub.rs:2
3
:14
| inside `NOT_PTR` at $DIR/offset_from_ub.rs:2
2
:14
|
::: $DIR/offset_from_ub.rs:2
1
:1
::: $DIR/offset_from_ub.rs:2
0
:1
|
LL | / pub const NOT_PTR: usize = {
LL | |
...
...
@@ -47,9 +47,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
| |
| exact_div: 1_isize cannot be divided by 2_isize without remainder
| inside `std::ptr::const_ptr::<impl *const u16>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:3
1
:14
| inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:3
0
:14
|
::: $DIR/offset_from_ub.rs:2
6
:1
::: $DIR/offset_from_ub.rs:2
5
:1
|
LL | / pub const NOT_MULTIPLE_OF_SIZE: isize = {
LL | |
...
...
@@ -68,9 +68,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
| |
| inbounds test failed: 0x0 is not a valid pointer
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:3
7
:14
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:3
6
:14
|
::: $DIR/offset_from_ub.rs:3
4
:1
::: $DIR/offset_from_ub.rs:3
3
:1
|
LL | / pub const OFFSET_FROM_NULL: isize = {
LL | |
...
...
@@ -87,9 +87,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
| |
| unable to turn bytes into a pointer
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:4
4
:14
| inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:4
3
:14
|
::: $DIR/offset_from_ub.rs:
40
:1
::: $DIR/offset_from_ub.rs:
39
:1
|
LL | / pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC
LL | |
...
...
src/test/ui/offset_from.rs
浏览文件 @
4f92f0d3
// run-pass
#![feature(ptr_offset_from)]
fn
main
()
{
let
mut
a
=
[
0
;
5
];
let
ptr1
:
*
mut
i32
=
&
mut
a
[
1
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录