Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
997feacd
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
997feacd
编写于
11月 06, 2019
作者:
M
Mark Rousskov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Snap cfgs
上级
f4edc81a
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
34 addition
and
189 deletion
+34
-189
src/libcore/array/mod.rs
src/libcore/array/mod.rs
+0
-2
src/libcore/convert.rs
src/libcore/convert.rs
+0
-1
src/libcore/intrinsics.rs
src/libcore/intrinsics.rs
+0
-2
src/libcore/lib.rs
src/libcore/lib.rs
+0
-1
src/libcore/macros.rs
src/libcore/macros.rs
+0
-24
src/libcore/marker.rs
src/libcore/marker.rs
+0
-4
src/libcore/ops/try.rs
src/libcore/ops/try.rs
+2
-15
src/libcore/panic.rs
src/libcore/panic.rs
+1
-1
src/libcore/panicking.rs
src/libcore/panicking.rs
+0
-59
src/libcore/ptr/mod.rs
src/libcore/ptr/mod.rs
+0
-16
src/libcore/sync/atomic.rs
src/libcore/sync/atomic.rs
+29
-35
src/libpanic_unwind/seh.rs
src/libpanic_unwind/seh.rs
+2
-22
src/libproc_macro/lib.rs
src/libproc_macro/lib.rs
+0
-1
src/librustc/lib.rs
src/librustc/lib.rs
+0
-2
src/libstd/lib.rs
src/libstd/lib.rs
+0
-1
src/libstd/panic.rs
src/libstd/panic.rs
+0
-1
src/libsyntax_pos/lib.rs
src/libsyntax_pos/lib.rs
+0
-2
未找到文件。
src/libcore/array/mod.rs
浏览文件 @
997feacd
...
...
@@ -14,10 +14,8 @@
use
crate
::
marker
::
Unsize
;
use
crate
::
slice
::{
Iter
,
IterMut
};
#[cfg(not(bootstrap))]
mod
iter
;
#[cfg(not(bootstrap))]
#[unstable(feature
=
"array_value_iter"
,
issue
=
"65798"
)]
pub
use
iter
::
IntoIter
;
...
...
src/libcore/convert.rs
浏览文件 @
997feacd
...
...
@@ -557,7 +557,6 @@ fn from(t: T) -> T { t }
///
/// [#64715]: https://github.com/rust-lang/rust/issues/64715
#[stable(feature
=
"convert_infallible"
,
since
=
"1.34.0"
)]
#[cfg(not(bootstrap))]
#[rustc_reservation_impl=
"permitting this impl would forbid us from adding
\
`impl<T> From<!> for T` later; see rust-lang/rust#64715 for details"
]
impl
<
T
>
From
<!>
for
T
{
...
...
src/libcore/intrinsics.rs
浏览文件 @
997feacd
...
...
@@ -697,7 +697,6 @@
pub
fn
panic_if_uninhabited
<
T
>
();
/// Gets a reference to a static `Location` indicating where it was called.
#[cfg(not(bootstrap))]
pub
fn
caller_location
()
->
&
'static
crate
::
panic
::
Location
<
'static
>
;
/// Creates a value initialized to zero.
...
...
@@ -1346,7 +1345,6 @@ pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
pub
fn
nontemporal_store
<
T
>
(
ptr
:
*
mut
T
,
val
:
T
);
/// See documentation of `<*const T>::offset_from` for details.
#[cfg(not(bootstrap))]
pub
fn
ptr_offset_from
<
T
>
(
ptr
:
*
const
T
,
base
:
*
const
T
)
->
isize
;
}
...
...
src/libcore/lib.rs
浏览文件 @
997feacd
...
...
@@ -121,7 +121,6 @@
#![feature(hexagon_target_feature)]
#![feature(const_int_conversion)]
#![feature(const_transmute)]
#![cfg_attr(bootstrap,
feature(non_exhaustive))]
#![feature(structural_match)]
#![feature(abi_unadjusted)]
#![feature(adx_target_feature)]
...
...
src/libcore/macros.rs
浏览文件 @
997feacd
/// Panics the current thread.
///
/// For details, see `std::macros`.
#[cfg(bootstrap)]
#[macro_export]
#[allow_internal_unstable(core_panic,
panic_internals)]
#[stable(feature
=
"core"
,
since
=
"1.6.0"
)]
macro_rules!
panic
{
()
=>
(
$crate
::
panic!
(
"explicit panic"
)
);
(
$msg:expr
)
=>
({
$crate
::
panicking
::
panic
(
&
(
$msg
,
$crate
::
file!
(),
$crate
::
line!
(),
$crate
::
column!
()))
});
(
$msg:expr
,)
=>
(
$crate
::
panic!
(
$msg
)
);
(
$fmt:expr
,
$
(
$arg:tt
)
+
)
=>
({
$crate
::
panicking
::
panic_fmt
(
$crate
::
format_args!
(
$fmt
,
$
(
$arg
)
+
),
&
(
$crate
::
file!
(),
$crate
::
line!
(),
$crate
::
column!
()))
});
}
/// Panics the current thread.
///
/// For details, see `std::macros`.
#[cfg(not(bootstrap))]
#[macro_export]
#[allow_internal_unstable(core_panic,
// FIXME(anp, eddyb) `core_intrinsics` is used here to allow calling
...
...
src/libcore/marker.rs
浏览文件 @
997feacd
...
...
@@ -146,7 +146,6 @@ pub trait Unsize<T: ?Sized> {
///
/// [RFC1445]: https://github.com/rust-lang/rfcs/blob/master/text/1445-restrict-constants-in-patterns.md
/// [issue 63438]: https://github.com/rust-lang/rust/issues/63438
#[cfg(not(bootstrap))]
#[unstable(feature
=
"structural_match"
,
issue
=
"31434"
)]
#[rustc_on_unimplemented(message=
"the type `{Self}` does not `#[derive(PartialEq)]`"
)]
#[lang
=
"structural_peq"
]
...
...
@@ -197,7 +196,6 @@ pub trait StructuralPartialEq {
/// As a hack to work around this, we use two separate traits injected by each
/// of the two derives (`#[derive(PartialEq)]` and `#[derive(Eq)]`) and check
/// that both of them are present as part of structural-match checking.
#[cfg(not(bootstrap))]
#[unstable(feature
=
"structural_match"
,
issue
=
"31434"
)]
#[rustc_on_unimplemented(message=
"the type `{Self}` does not `#[derive(Eq)]`"
)]
#[lang
=
"structural_teq"
]
...
...
@@ -517,11 +515,9 @@ fn default() -> $t<T> {
}
}
#[cfg(not(bootstrap))]
#[unstable(feature
=
"structural_match"
,
issue
=
"31434"
)]
impl
<
T
:
?
Sized
>
StructuralPartialEq
for
$t
<
T
>
{
}
#[cfg(not(bootstrap))]
#[unstable(feature
=
"structural_match"
,
issue
=
"31434"
)]
impl
<
T
:
?
Sized
>
StructuralEq
for
$t
<
T
>
{
}
)
...
...
src/libcore/ops/try.rs
浏览文件 @
997feacd
...
...
@@ -5,20 +5,7 @@
/// extracting those success or failure values from an existing instance and
/// creating a new instance from a success or failure value.
#[unstable(feature
=
"try_trait"
,
issue
=
"42327"
)]
#[cfg_attr(bootstrap,
rustc_on_unimplemented(
on(all(
any(from_method=
"from_error"
,
from_method=
"from_ok"
),
from_desugaring=
"QuestionMark"
),
message=
"the `?` operator can only be used in a
\
function that returns `Result` or `Option`
\
(or another type that implements `{Try}`)"
,
label=
"cannot use the `?` operator in a function that returns `{Self}`"
),
on(all(from_method=
"into_result"
,
from_desugaring=
"QuestionMark"
),
message=
"the `?` operator can only be applied to values
\
that implement `{Try}`"
,
label=
"the `?` operator cannot be applied to type `{Self}`"
)
))]
#[cfg_attr(not(bootstrap),
rustc_on_unimplemented(
#[rustc_on_unimplemented(
on(all(
any(from_method=
"from_error"
,
from_method=
"from_ok"
),
from_desugaring=
"QuestionMark"
),
...
...
@@ -30,7 +17,7 @@
message=
"the `?` operator can only be applied to values
\
that implement `{Try}`"
,
label=
"the `?` operator cannot be applied to type `{Self}`"
)
)
)
]
)]
#[doc(alias
=
"?"
)]
pub
trait
Try
{
/// The type of this value when viewed as successful.
...
...
src/libcore/panic.rs
浏览文件 @
997feacd
...
...
@@ -167,7 +167,7 @@ fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
///
/// panic!("Normal panic");
/// ```
#[
cfg_attr(not(bootstrap),
lang
=
"panic_location"
)
]
#[
lang
=
"panic_location"
]
#[derive(Debug)]
#[stable(feature
=
"panic_hooks"
,
since
=
"1.10.0"
)]
pub
struct
Location
<
'a
>
{
...
...
src/libcore/panicking.rs
浏览文件 @
997feacd
...
...
@@ -31,28 +31,6 @@
use
crate
::
fmt
;
use
crate
::
panic
::{
Location
,
PanicInfo
};
#[cfg(bootstrap)]
#[cold]
// never inline unless panic_immediate_abort to avoid code
// bloat at the call sites as much as possible
#[cfg_attr(not(feature=
"panic_immediate_abort"
),inline(never))]
#[lang
=
"panic"
]
pub
fn
panic
(
expr_file_line_col
:
&
(
&
'static
str
,
&
'static
str
,
u32
,
u32
))
->
!
{
if
cfg!
(
feature
=
"panic_immediate_abort"
)
{
unsafe
{
super
::
intrinsics
::
abort
()
}
}
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
// reduce size overhead. The format_args! macro uses str's Display trait to
// write expr, which calls Formatter::pad, which must accommodate string
// truncation and padding (even though none is used here). Using
// Arguments::new_v1 may allow the compiler to omit Formatter::pad from the
// output binary, saving up to a few kilobytes.
let
(
expr
,
file
,
line
,
col
)
=
*
expr_file_line_col
;
panic_fmt
(
fmt
::
Arguments
::
new_v1
(
&
[
expr
],
&
[]),
&
(
file
,
line
,
col
))
}
#[cfg(not(bootstrap))]
#[cold]
// never inline unless panic_immediate_abort to avoid code
// bloat at the call sites as much as possible
...
...
@@ -72,21 +50,6 @@ pub fn panic(expr: &str, location: &Location<'_>) -> ! {
panic_fmt
(
fmt
::
Arguments
::
new_v1
(
&
[
expr
],
&
[]),
location
)
}
#[cfg(bootstrap)]
#[cold]
#[cfg_attr(not(feature=
"panic_immediate_abort"
),inline(never))]
#[lang
=
"panic_bounds_check"
]
fn
panic_bounds_check
(
file_line_col
:
&
(
&
'static
str
,
u32
,
u32
),
index
:
usize
,
len
:
usize
)
->
!
{
if
cfg!
(
feature
=
"panic_immediate_abort"
)
{
unsafe
{
super
::
intrinsics
::
abort
()
}
}
panic_fmt
(
format_args!
(
"index out of bounds: the len is {} but the index is {}"
,
len
,
index
),
file_line_col
)
}
#[cfg(not(bootstrap))]
#[cold]
#[cfg_attr(not(feature=
"panic_immediate_abort"
),inline(never))]
#[lang
=
"panic_bounds_check"
]
...
...
@@ -101,28 +64,6 @@ fn panic_bounds_check(location: &Location<'_>, index: usize, len: usize) -> ! {
)
}
#[cfg(bootstrap)]
#[cold]
#[cfg_attr(not(feature=
"panic_immediate_abort"
),inline(never))]
#[cfg_attr(
feature=
"panic_immediate_abort"
,inline)]
pub
fn
panic_fmt
(
fmt
:
fmt
::
Arguments
<
'_
>
,
file_line_col
:
&
(
&
'static
str
,
u32
,
u32
))
->
!
{
if
cfg!
(
feature
=
"panic_immediate_abort"
)
{
unsafe
{
super
::
intrinsics
::
abort
()
}
}
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
extern
"Rust"
{
#[lang
=
"panic_impl"
]
fn
panic_impl
(
pi
:
&
PanicInfo
<
'_
>
)
->
!
;
}
let
(
file
,
line
,
col
)
=
*
file_line_col
;
let
location
=
Location
::
internal_constructor
(
file
,
line
,
col
);
let
pi
=
PanicInfo
::
internal_constructor
(
Some
(
&
fmt
),
&
location
);
unsafe
{
panic_impl
(
&
pi
)
}
}
#[cfg(not(bootstrap))]
#[cold]
#[cfg_attr(not(feature=
"panic_immediate_abort"
),inline(never))]
#[cfg_attr(
feature=
"panic_immediate_abort"
,inline)]
...
...
src/libcore/ptr/mod.rs
浏览文件 @
997feacd
...
...
@@ -1301,7 +1301,6 @@ pub fn wrapping_offset(self, count: isize) -> *const T where T: Sized {
/// }
/// ```
#[unstable(feature
=
"ptr_offset_from"
,
issue
=
"41079"
)]
#[cfg(not(bootstrap))]
#[rustc_const_unstable(feature
=
"const_ptr_offset_from"
)]
#[inline]
pub
const
unsafe
fn
offset_from
(
self
,
origin
:
*
const
T
)
->
isize
where
T
:
Sized
{
...
...
@@ -1313,21 +1312,6 @@ pub fn wrapping_offset(self, count: isize) -> *const T where T: Sized {
intrinsics
::
ptr_offset_from
(
self
,
origin
)
}
#[unstable(feature
=
"ptr_offset_from"
,
issue
=
"41079"
)]
#[inline]
#[cfg(bootstrap)]
/// bootstrap
pub
unsafe
fn
offset_from
(
self
,
origin
:
*
const
T
)
->
isize
where
T
:
Sized
{
let
pointee_size
=
mem
::
size_of
::
<
T
>
();
assert
!
(
0
<
pointee_size
&&
pointee_size
<=
isize
::
max_value
()
as
usize
);
// This is the same sequence that Clang emits for pointer subtraction.
// It can be neither `nsw` nor `nuw` because the input is treated as
// unsigned but then the output is treated as signed, so neither works.
let
d
=
isize
::
wrapping_sub
(
self
as
_
,
origin
as
_
);
intrinsics
::
exact_div
(
d
,
pointee_size
as
_
)
}
/// Calculates the distance between two pointers. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
///
...
...
src/libcore/sync/atomic.rs
浏览文件 @
997feacd
...
...
@@ -162,14 +162,14 @@ pub fn spin_loop_hint() {
/// This type has the same in-memory representation as a [`bool`].
///
/// [`bool`]: ../../../std/primitive.bool.html
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[repr(C,
align(
1
))]
pub
struct
AtomicBool
{
v
:
UnsafeCell
<
u8
>
,
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
Default
for
AtomicBool
{
/// Creates an `AtomicBool` initialized to `false`.
...
...
@@ -179,14 +179,14 @@ fn default() -> Self {
}
// Send is implicitly implemented for AtomicBool.
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
unsafe
impl
Sync
for
AtomicBool
{}
/// A raw pointer type which can be safely shared between threads.
///
/// This type has the same in-memory representation as a `*mut T`.
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg_attr(target_pointer_width
=
"16"
,
repr(C,
align(
2
)))]
#[cfg_attr(target_pointer_width
=
"32"
,
repr(C,
align(
4
)))]
...
...
@@ -195,7 +195,7 @@ pub struct AtomicPtr<T> {
p
:
UnsafeCell
<*
mut
T
>
,
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Default
for
AtomicPtr
<
T
>
{
/// Creates a null `AtomicPtr<T>`.
...
...
@@ -204,10 +204,10 @@ fn default() -> AtomicPtr<T> {
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
unsafe
impl
<
T
>
Send
for
AtomicPtr
<
T
>
{}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
unsafe
impl
<
T
>
Sync
for
AtomicPtr
<
T
>
{}
...
...
@@ -308,7 +308,7 @@ pub enum Ordering {
/// An [`AtomicBool`] initialized to `false`.
///
/// [`AtomicBool`]: struct.AtomicBool.html
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[rustc_deprecated(
since
=
"1.34.0"
,
...
...
@@ -317,7 +317,7 @@ pub enum Ordering {
)]
pub
const
ATOMIC_BOOL_INIT
:
AtomicBool
=
AtomicBool
::
new
(
false
);
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
impl
AtomicBool
{
/// Creates a new `AtomicBool`.
///
...
...
@@ -804,7 +804,7 @@ pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
impl
<
T
>
AtomicPtr
<
T
>
{
/// Creates a new `AtomicPtr`.
///
...
...
@@ -1114,7 +1114,7 @@ pub fn compare_exchange_weak(&self,
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
#[stable(feature
=
"atomic_bool_from"
,
since
=
"1.24.0"
)]
impl
From
<
bool
>
for
AtomicBool
{
/// Converts a `bool` into an `AtomicBool`.
...
...
@@ -1130,14 +1130,14 @@ impl From<bool> for AtomicBool {
fn
from
(
b
:
bool
)
->
Self
{
Self
::
new
(
b
)
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"atomic_from"
,
since
=
"1.23.0"
)]
impl
<
T
>
From
<*
mut
T
>
for
AtomicPtr
<
T
>
{
#[inline]
fn
from
(
p
:
*
mut
T
)
->
Self
{
Self
::
new
(
p
)
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
macro_rules!
atomic_int
{
(
$cfg_cas:meta
,
$stable:meta
,
...
...
@@ -1895,7 +1895,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"8"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -1912,7 +1912,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicI8::new(0)"
,
i8
AtomicI8
ATOMIC_I8_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"8"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -1929,7 +1929,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicU8::new(0)"
,
u8
AtomicU8
ATOMIC_U8_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"16"
)
)]
#[cfg(
target_has_atomic_load_store
=
"16"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"16"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -1946,7 +1946,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicI16::new(0)"
,
i16
AtomicI16
ATOMIC_I16_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"16"
)
)]
#[cfg(
target_has_atomic_load_store
=
"16"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"16"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -1963,7 +1963,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicU16::new(0)"
,
u16
AtomicU16
ATOMIC_U16_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"32"
)
)]
#[cfg(
target_has_atomic_load_store
=
"32"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"32"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -1980,7 +1980,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicI32::new(0)"
,
i32
AtomicI32
ATOMIC_I32_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"32"
)
)]
#[cfg(
target_has_atomic_load_store
=
"32"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"32"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -1997,10 +1997,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicU32::new(0)"
,
u32
AtomicU32
ATOMIC_U32_INIT
}
#[cfg(any(
all(bootstrap,
target_has_atomic
=
"64"
),
target_has_atomic_load_store
=
"64"
))]
#[cfg(target_has_atomic_load_store
=
"64"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"64"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -2017,10 +2014,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicI64::new(0)"
,
i64
AtomicI64
ATOMIC_I64_INIT
}
#[cfg(any(
all(bootstrap,
target_has_atomic
=
"64"
),
target_has_atomic_load_store
=
"64"
))]
#[cfg(target_has_atomic_load_store
=
"64"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"64"
),
stable
(
feature
=
"integer_atomics_stable"
,
since
=
"1.34.0"
),
...
...
@@ -2071,22 +2065,22 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicU128::new(0)"
,
u128
AtomicU128
ATOMIC_U128_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[cfg(target_pointer_width
=
"16"
)]
macro_rules!
ptr_width
{
()
=>
{
2
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[cfg(target_pointer_width
=
"32"
)]
macro_rules!
ptr_width
{
()
=>
{
4
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[cfg(target_pointer_width
=
"64"
)]
macro_rules!
ptr_width
{
()
=>
{
8
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"ptr"
),
stable
(
feature
=
"rust1"
,
since
=
"1.0.0"
),
...
...
@@ -2103,7 +2097,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
"AtomicIsize::new(0)"
,
isize
AtomicIsize
ATOMIC_ISIZE_INIT
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
atomic_int!
{
cfg
(
target_has_atomic
=
"ptr"
),
stable
(
feature
=
"rust1"
,
since
=
"1.0.0"
),
...
...
@@ -2530,7 +2524,7 @@ pub fn compiler_fence(order: Ordering) {
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"8"
)
)]
#[cfg(
target_has_atomic_load_store
=
"8"
)]
#[stable(feature
=
"atomic_debug"
,
since
=
"1.3.0"
)]
impl
fmt
::
Debug
for
AtomicBool
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
...
...
@@ -2538,7 +2532,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"atomic_debug"
,
since
=
"1.3.0"
)]
impl
<
T
>
fmt
::
Debug
for
AtomicPtr
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
...
...
@@ -2546,7 +2540,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
}
#[cfg(
any(bootstrap,
target_has_atomic_load_store
=
"ptr"
)
)]
#[cfg(
target_has_atomic_load_store
=
"ptr"
)]
#[stable(feature
=
"atomic_pointer"
,
since
=
"1.24.0"
)]
impl
<
T
>
fmt
::
Pointer
for
AtomicPtr
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
...
...
src/libpanic_unwind/seh.rs
浏览文件 @
997feacd
...
...
@@ -98,9 +98,6 @@
mod
imp
{
pub
type
ptr_t
=
*
mut
u8
;
#[cfg(bootstrap)]
pub
const
NAME1
:
[
u8
;
7
]
=
[
b
'.'
,
b
'P'
,
b
'A'
,
b
'_'
,
b
'K'
,
0
,
0
];
macro_rules!
ptr
{
(
0
)
=>
(
core
::
ptr
::
null_mut
());
(
$e:expr
)
=>
(
$e
as
*
mut
u8
);
...
...
@@ -112,9 +109,6 @@ mod imp {
mod
imp
{
pub
type
ptr_t
=
u32
;
#[cfg(bootstrap)]
pub
const
NAME1
:
[
u8
;
7
]
=
[
b
'.'
,
b
'P'
,
b
'E'
,
b
'A'
,
b
'_'
,
b
'K'
,
0
];
extern
"C"
{
pub
static
__
ImageBase
:
u8
;
}
...
...
@@ -161,17 +155,11 @@ pub struct _PMD {
pub
struct
_
TypeDescriptor
{
pub
pVFTable
:
*
const
u8
,
pub
spare
:
*
mut
u8
,
#[cfg(bootstrap)]
pub
name
:
[
u8
;
7
],
#[cfg(not(bootstrap))]
pub
name
:
[
u8
;
11
],
}
// Note that we intentionally ignore name mangling rules here: we don't want C++
// to be able to catch Rust panics by simply declaring a `struct rust_panic`.
#[cfg(bootstrap)]
use
imp
::
NAME1
as
TYPE_NAME
;
#[cfg(not(bootstrap))]
const
TYPE_NAME
:
[
u8
;
11
]
=
*
b
"rust_panic
\0
"
;
static
mut
THROW_INFO
:
_
ThrowInfo
=
_
ThrowInfo
{
...
...
@@ -194,9 +182,6 @@ pub struct _TypeDescriptor {
pdisp
:
-
1
,
vdisp
:
0
,
},
#[cfg(bootstrap)]
sizeOrOffset
:
mem
::
size_of
::
<*
mut
u64
>
()
as
c_int
,
#[cfg(not(bootstrap))]
sizeOrOffset
:
mem
::
size_of
::
<
[
u64
;
2
]
>
()
as
c_int
,
copy_function
:
ptr!
(
0
),
};
...
...
@@ -218,8 +203,7 @@ pub struct _TypeDescriptor {
// an argument to the C++ personality function.
//
// Again, I'm not entirely sure what this is describing, it just seems to work.
#[cfg_attr(bootstrap,
lang
=
"msvc_try_filter"
)]
#[cfg_attr(not(any(test,
bootstrap)),
lang
=
"eh_catch_typeinfo"
)]
#[cfg_attr(not(test),
lang
=
"eh_catch_typeinfo"
)]
static
mut
TYPE_DESCRIPTOR
:
_
TypeDescriptor
=
_
TypeDescriptor
{
pVFTable
:
unsafe
{
&
TYPE_INFO_VTABLE
}
as
*
const
_
as
*
const
_
,
spare
:
core
::
ptr
::
null_mut
(),
...
...
@@ -239,11 +223,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
let
ptrs
=
mem
::
transmute
::
<
_
,
raw
::
TraitObject
>
(
data
);
let
mut
ptrs
=
[
ptrs
.data
as
u64
,
ptrs
.vtable
as
u64
];
let
mut
ptrs_ptr
=
ptrs
.as_mut_ptr
();
let
throw_ptr
=
if
cfg!
(
bootstrap
)
{
&
mut
ptrs_ptr
as
*
mut
_
as
*
mut
_
}
else
{
ptrs_ptr
as
*
mut
_
};
let
throw_ptr
=
ptrs_ptr
as
*
mut
_
;
// This... may seems surprising, and justifiably so. On 32-bit MSVC the
// pointers between these structure are just that, pointers. On 64-bit MSVC,
...
...
src/libproc_macro/lib.rs
浏览文件 @
997feacd
...
...
@@ -25,7 +25,6 @@
#![feature(extern_types)]
#![feature(in_band_lifetimes)]
#![feature(optin_builtin_traits)]
#![cfg_attr(bootstrap,
feature(non_exhaustive))]
#![feature(rustc_attrs)]
#![feature(specialization)]
...
...
src/librustc/lib.rs
浏览文件 @
997feacd
...
...
@@ -41,7 +41,6 @@
#![feature(overlapping_marker_traits)]
#![feature(extern_types)]
#![feature(nll)]
#![cfg_attr(bootstrap,
feature(non_exhaustive))]
#![feature(optin_builtin_traits)]
#![feature(option_expect_none)]
#![feature(range_is_empty)]
...
...
@@ -57,7 +56,6 @@
#![feature(test)]
#![feature(in_band_lifetimes)]
#![feature(crate_visibility_modifier)]
#![cfg_attr(bootstrap,
feature(proc_macro_hygiene))]
#![feature(log_syntax)]
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
...
...
src/libstd/lib.rs
浏览文件 @
997feacd
...
...
@@ -283,7 +283,6 @@
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![feature(nll)]
#![cfg_attr(bootstrap,
feature(non_exhaustive))]
#![cfg_attr(bootstrap,
feature(on_unimplemented))]
#![feature(optin_builtin_traits)]
#![feature(panic_info_message)]
...
...
src/libstd/panic.rs
浏览文件 @
997feacd
...
...
@@ -13,7 +13,6 @@
use
crate
::
ptr
::{
Unique
,
NonNull
};
use
crate
::
rc
::
Rc
;
use
crate
::
sync
::{
Arc
,
Mutex
,
RwLock
};
#[cfg(not(bootstrap))]
use
crate
::
sync
::
atomic
;
use
crate
::
task
::{
Context
,
Poll
};
use
crate
::
thread
::
Result
;
...
...
src/libsyntax_pos/lib.rs
浏览文件 @
997feacd
...
...
@@ -9,10 +9,8 @@
#![feature(const_fn)]
#![feature(crate_visibility_modifier)]
#![feature(nll)]
#![cfg_attr(bootstrap,
feature(non_exhaustive))]
#![feature(optin_builtin_traits)]
#![feature(rustc_attrs)]
#![cfg_attr(bootstrap,
feature(proc_macro_hygiene))]
#![feature(specialization)]
#![feature(step_trait)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录