Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c48b499e
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,发现更多精彩内容 >>
提交
c48b499e
编写于
4月 29, 2015
作者:
B
bors
浏览文件
操作
浏览文件
下载
差异文件
Auto merge of #24888 - tamird:snapshot, r=alexcrichton
r? @alexcrichton cc @brson
上级
c4b23aec
69abc12b
变更
89
隐藏空白更改
内联
并排
Showing
89 changed file
with
29 addition
and
397 deletion
+29
-397
src/liballoc/arc.rs
src/liballoc/arc.rs
+0
-2
src/liballoc/lib.rs
src/liballoc/lib.rs
+1
-1
src/liballoc/rc.rs
src/liballoc/rc.rs
+0
-2
src/libarena/lib.rs
src/libarena/lib.rs
+0
-3
src/libcollections/btree/node.rs
src/libcollections/btree/node.rs
+0
-3
src/libcollections/lib.rs
src/libcollections/lib.rs
+0
-1
src/libcollections/linked_list.rs
src/libcollections/linked_list.rs
+0
-1
src/libcollections/vec.rs
src/libcollections/vec.rs
+0
-6
src/libcollections/vec_deque.rs
src/libcollections/vec_deque.rs
+0
-2
src/libcollectionstest/lib.rs
src/libcollectionstest/lib.rs
+0
-1
src/libcollectionstest/vec.rs
src/libcollectionstest/vec.rs
+0
-1
src/libcore/cell.rs
src/libcore/cell.rs
+0
-2
src/libcore/fmt/mod.rs
src/libcore/fmt/mod.rs
+6
-12
src/libcore/fmt/rt/v1.rs
src/libcore/fmt/rt/v1.rs
+1
-24
src/libcore/intrinsics.rs
src/libcore/intrinsics.rs
+0
-14
src/libcore/lib.rs
src/libcore/lib.rs
+1
-1
src/libcore/marker.rs
src/libcore/marker.rs
+0
-53
src/libcore/nonzero.rs
src/libcore/nonzero.rs
+0
-6
src/libcore/ops.rs
src/libcore/ops.rs
+0
-3
src/libcore/ptr.rs
src/libcore/ptr.rs
+0
-17
src/libcoretest/lib.rs
src/libcoretest/lib.rs
+0
-1
src/libcoretest/option.rs
src/libcoretest/option.rs
+1
-2
src/librustc/lib.rs
src/librustc/lib.rs
+0
-1
src/librustc_borrowck/lib.rs
src/librustc_borrowck/lib.rs
+0
-1
src/librustc_driver/lib.rs
src/librustc_driver/lib.rs
+0
-1
src/librustc_lint/lib.rs
src/librustc_lint/lib.rs
+0
-1
src/librustc_llvm/archive_ro.rs
src/librustc_llvm/archive_ro.rs
+0
-1
src/librustc_llvm/lib.rs
src/librustc_llvm/lib.rs
+0
-1
src/librustc_trans/lib.rs
src/librustc_trans/lib.rs
+0
-1
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/base.rs
+0
-2
src/librustc_typeck/lib.rs
src/librustc_typeck/lib.rs
+0
-1
src/libstd/collections/hash/table.rs
src/libstd/collections/hash/table.rs
+0
-2
src/libstd/io/buffered.rs
src/libstd/io/buffered.rs
+0
-1
src/libstd/io/mod.rs
src/libstd/io/mod.rs
+1
-2
src/libstd/lib.rs
src/libstd/lib.rs
+0
-1
src/libstd/macros.rs
src/libstd/macros.rs
+0
-25
src/libstd/rt/unwind.rs
src/libstd/rt/unwind.rs
+0
-17
src/libstd/sync/mpsc/mod.rs
src/libstd/sync/mpsc/mod.rs
+0
-3
src/libstd/sync/mpsc/mpsc_queue.rs
src/libstd/sync/mpsc/mpsc_queue.rs
+0
-1
src/libstd/sync/mpsc/oneshot.rs
src/libstd/sync/mpsc/oneshot.rs
+0
-1
src/libstd/sync/mpsc/select.rs
src/libstd/sync/mpsc/select.rs
+0
-2
src/libstd/sync/mpsc/shared.rs
src/libstd/sync/mpsc/shared.rs
+0
-1
src/libstd/sync/mpsc/spsc_queue.rs
src/libstd/sync/mpsc/spsc_queue.rs
+0
-1
src/libstd/sync/mpsc/stream.rs
src/libstd/sync/mpsc/stream.rs
+0
-1
src/libstd/sync/mpsc/sync.rs
src/libstd/sync/mpsc/sync.rs
+0
-1
src/libstd/sync/mutex.rs
src/libstd/sync/mutex.rs
+0
-2
src/libstd/sync/rwlock.rs
src/libstd/sync/rwlock.rs
+0
-3
src/libstd/sync/semaphore.rs
src/libstd/sync/semaphore.rs
+0
-1
src/libstd/sys/common/remutex.rs
src/libstd/sys/common/remutex.rs
+0
-2
src/libstd/thread/mod.rs
src/libstd/thread/mod.rs
+0
-1
src/libstd/thread/scoped_tls.rs
src/libstd/thread/scoped_tls.rs
+1
-2
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+0
-6
src/snapshots.txt
src/snapshots.txt
+10
-0
src/test/auxiliary/issue-2526.rs
src/test/auxiliary/issue-2526.rs
+0
-3
src/test/bench/task-perf-alloc-unwind.rs
src/test/bench/task-perf-alloc-unwind.rs
+1
-2
src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs
src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs
+0
-3
src/test/compile-fail/dropck_arr_cycle_checked.rs
src/test/compile-fail/dropck_arr_cycle_checked.rs
+0
-3
src/test/compile-fail/dropck_direct_cycle_with_drop.rs
src/test/compile-fail/dropck_direct_cycle_with_drop.rs
+0
-3
src/test/compile-fail/dropck_tarena_cycle_checked.rs
src/test/compile-fail/dropck_tarena_cycle_checked.rs
+0
-2
src/test/compile-fail/dropck_tarena_unsound_drop.rs
src/test/compile-fail/dropck_tarena_unsound_drop.rs
+0
-2
src/test/compile-fail/dropck_vec_cycle_checked.rs
src/test/compile-fail/dropck_vec_cycle_checked.rs
+0
-3
src/test/compile-fail/exclusive-drop-and-copy.rs
src/test/compile-fail/exclusive-drop-and-copy.rs
+0
-3
src/test/compile-fail/gated-unsafe-destructor.rs
src/test/compile-fail/gated-unsafe-destructor.rs
+0
-25
src/test/compile-fail/no-send-res-ports.rs
src/test/compile-fail/no-send-res-ports.rs
+1
-4
src/test/compile-fail/reject-specialized-drops-8142.rs
src/test/compile-fail/reject-specialized-drops-8142.rs
+0
-14
src/test/compile-fail/unique-vec-res.rs
src/test/compile-fail/unique-vec-res.rs
+0
-3
src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
+0
-3
src/test/run-pass/attr-no-drop-flag-size.rs
src/test/run-pass/attr-no-drop-flag-size.rs
+0
-3
src/test/run-pass/drop-trait-generic.rs
src/test/run-pass/drop-trait-generic.rs
+0
-3
src/test/run-pass/dropck_tarena_sound_drop.rs
src/test/run-pass/dropck_tarena_sound_drop.rs
+1
-3
src/test/run-pass/init-res-into-things.rs
src/test/run-pass/init-res-into-things.rs
+0
-4
src/test/run-pass/issue-15858.rs
src/test/run-pass/issue-15858.rs
+0
-4
src/test/run-pass/issue-15924.rs
src/test/run-pass/issue-15924.rs
+1
-2
src/test/run-pass/issue-16492.rs
src/test/run-pass/issue-16492.rs
+0
-4
src/test/run-pass/issue-17216.rs
src/test/run-pass/issue-17216.rs
+0
-4
src/test/run-pass/issue-2718.rs
src/test/run-pass/issue-2718.rs
+3
-5
src/test/run-pass/issue-2735-2.rs
src/test/run-pass/issue-2735-2.rs
+0
-4
src/test/run-pass/issue-2735-3.rs
src/test/run-pass/issue-2735-3.rs
+0
-4
src/test/run-pass/issue-4252.rs
src/test/run-pass/issue-4252.rs
+0
-3
src/test/run-pass/issue-979.rs
src/test/run-pass/issue-979.rs
+0
-4
src/test/run-pass/newtype-struct-drop-run.rs
src/test/run-pass/newtype-struct-drop-run.rs
+0
-4
src/test/run-pass/option-unwrap.rs
src/test/run-pass/option-unwrap.rs
+0
-4
src/test/run-pass/regions-no-bound-in-argument-cleanup.rs
src/test/run-pass/regions-no-bound-in-argument-cleanup.rs
+0
-3
src/test/run-pass/resource-assign-is-not-copy.rs
src/test/run-pass/resource-assign-is-not-copy.rs
+0
-3
src/test/run-pass/resource-destruct.rs
src/test/run-pass/resource-destruct.rs
+0
-3
src/test/run-pass/resource-in-struct.rs
src/test/run-pass/resource-in-struct.rs
+0
-4
src/test/run-pass/unboxed-closures-infer-fnonce-move.rs
src/test/run-pass/unboxed-closures-infer-fnonce-move.rs
+0
-4
src/test/run-pass/unboxed-closures-infer-fnonce.rs
src/test/run-pass/unboxed-closures-infer-fnonce.rs
+0
-4
src/test/run-pass/vec-slice-drop.rs
src/test/run-pass/vec-slice-drop.rs
+0
-4
未找到文件。
src/liballoc/arc.rs
浏览文件 @
c48b499e
...
...
@@ -355,7 +355,6 @@ pub fn make_unique(&mut self) -> &mut T {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Arc
<
T
>
{
/// Drops the `Arc<T>`.
...
...
@@ -489,7 +488,6 @@ fn clone(&self) -> Weak<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Weak
<
T
>
{
/// Drops the `Weak<T>`.
...
...
src/liballoc/lib.rs
浏览文件 @
c48b499e
...
...
@@ -73,7 +73,7 @@
#![feature(allocator)]
#![feature(custom_attribute)]
#![feature(fundamental)]
#![feature(lang_items
,
unsafe_destructor
)]
#![feature(lang_items)]
#![feature(box_syntax)]
#![feature(optin_builtin_traits)]
#![feature(unboxed_closures)]
...
...
src/liballoc/rc.rs
浏览文件 @
c48b499e
...
...
@@ -375,7 +375,6 @@ fn deref(&self) -> &T {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Rc
<
T
>
{
/// Drops the `Rc<T>`.
...
...
@@ -693,7 +692,6 @@ pub fn upgrade(&self) -> Option<Rc<T>> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Weak
<
T
>
{
/// Drops the `Weak<T>`.
...
...
src/libarena/lib.rs
浏览文件 @
c48b499e
...
...
@@ -35,7 +35,6 @@
#![feature(core)]
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(unsafe_destructor)]
#![cfg_attr(test,
feature(test))]
extern
crate
alloc
;
...
...
@@ -124,7 +123,6 @@ fn chunk(size: usize, is_copy: bool) -> Chunk {
}
}
#[unsafe_destructor]
impl
<
'longer_than_self
>
Drop
for
Arena
<
'longer_than_self
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
@@ -510,7 +508,6 @@ fn grow(&self) {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
TypedArena
<
T
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/libcollections/btree/node.rs
浏览文件 @
c48b499e
...
...
@@ -270,14 +270,12 @@ fn next_back(&mut self) -> Option<T> {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
RawItems
<
T
>
{
fn
drop
(
&
mut
self
)
{
for
_
in
self
.by_ref
()
{}
}
}
#[unsafe_destructor]
impl
<
K
,
V
>
Drop
for
Node
<
K
,
V
>
{
fn
drop
(
&
mut
self
)
{
if
self
.keys
.is_null
()
||
...
...
@@ -1394,7 +1392,6 @@ fn next_edge_back(&mut self) -> Option<Node<K, V>> {
}
}
#[unsafe_destructor]
impl
<
K
,
V
>
Drop
for
MoveTraversalImpl
<
K
,
V
>
{
fn
drop
(
&
mut
self
)
{
// We need to cleanup the stored values manually, as the RawItems destructor would run
...
...
src/libcollections/lib.rs
浏览文件 @
c48b499e
...
...
@@ -33,7 +33,6 @@
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(unsafe_destructor)]
#![feature(unique)]
#![feature(unsafe_no_drop_flag,
filling_drop)]
#![feature(step_by)]
...
...
src/libcollections/linked_list.rs
浏览文件 @
c48b499e
...
...
@@ -624,7 +624,6 @@ pub fn split_off(&mut self, at: usize) -> LinkedList<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
LinkedList
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
src/libcollections/vec.rs
浏览文件 @
c48b499e
...
...
@@ -1626,7 +1626,6 @@ fn add(mut self, rhs: &[T]) -> Vec<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Vec
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -1808,7 +1807,6 @@ fn next_back(&mut self) -> Option<T> {
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
ExactSizeIterator
for
IntoIter
<
T
>
{}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
IntoIter
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -1867,7 +1865,6 @@ fn next_back(&mut self) -> Option<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Drop
for
Drain
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -1914,7 +1911,6 @@ fn deref<'b>(&'b self) -> &'b Vec<T> {
}
// Prevent the inner `Vec<T>` from attempting to deallocate memory.
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Drop
for
DerefVec
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -1983,7 +1979,6 @@ struct PartialVecZeroSized<T,U> {
marker
:
PhantomData
<
::
core
::
cell
::
Cell
<
(
T
,
U
)
>>
,
}
#[unsafe_destructor]
impl
<
T
,
U
>
Drop
for
PartialVecNonZeroSized
<
T
,
U
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
@@ -2009,7 +2004,6 @@ fn drop(&mut self) {
}
}
#[unsafe_destructor]
impl
<
T
,
U
>
Drop
for
PartialVecZeroSized
<
T
,
U
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/libcollections/vec_deque.rs
浏览文件 @
c48b499e
...
...
@@ -59,7 +59,6 @@ fn clone(&self) -> VecDeque<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
VecDeque
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -1612,7 +1611,6 @@ pub struct Drain<'a, T: 'a> {
inner
:
&
'a
mut
VecDeque
<
T
>
,
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
:
'a
>
Drop
for
Drain
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
src/libcollectionstest/lib.rs
浏览文件 @
c48b499e
...
...
@@ -18,7 +18,6 @@
#![feature(test)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(unsafe_destructor)]
#![feature(into_cow)]
#![feature(step_by)]
#![cfg_attr(test,
feature(str_char))]
...
...
src/libcollectionstest/vec.rs
浏览文件 @
c48b499e
...
...
@@ -18,7 +18,6 @@ struct DropCounter<'a> {
count
:
&
'a
mut
u32
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
DropCounter
<
'a
>
{
fn
drop
(
&
mut
self
)
{
*
self
.count
+=
1
;
...
...
src/libcore/cell.rs
浏览文件 @
c48b499e
...
...
@@ -493,7 +493,6 @@ fn new(borrow: &'b Cell<BorrowFlag>) -> Option<BorrowRef<'b>> {
}
}
#[unsafe_destructor]
impl
<
'b
>
Drop
for
BorrowRef
<
'b
>
{
#[inline]
fn
drop
(
&
mut
self
)
{
...
...
@@ -557,7 +556,6 @@ struct BorrowRefMut<'b> {
_
borrow
:
&
'b
Cell
<
BorrowFlag
>
,
}
#[unsafe_destructor]
impl
<
'b
>
Drop
for
BorrowRefMut
<
'b
>
{
#[inline]
fn
drop
(
&
mut
self
)
{
...
...
src/libcore/fmt/mod.rs
浏览文件 @
c48b499e
...
...
@@ -34,8 +34,7 @@
mod
float
;
mod
builders
;
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#[cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#[unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
#[doc(hidden)]
pub
mod
rt
{
pub
mod
v1
;
...
...
@@ -148,8 +147,7 @@ enum Void {}
/// compile time it is ensured that the function and the value have the correct
/// types, and then this struct is used to canonicalize arguments to one type.
#[derive(Copy)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#[cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#[unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
#[doc(hidden)]
pub
struct
ArgumentV1
<
'a
>
{
value
:
&
'a
Void
,
...
...
@@ -169,8 +167,7 @@ fn show_usize(x: &usize, f: &mut Formatter) -> Result {
}
#[doc(hidden)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#[cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#[unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
pub
fn
new
<
'b
,
T
>
(
x
:
&
'b
T
,
f
:
fn
(
&
T
,
&
mut
Formatter
)
->
Result
)
->
ArgumentV1
<
'b
>
{
unsafe
{
...
...
@@ -182,8 +179,7 @@ pub fn new<'b, T>(x: &'b T,
}
#[doc(hidden)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#[cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#[unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
pub
fn
from_usize
(
x
:
&
usize
)
->
ArgumentV1
{
ArgumentV1
::
new
(
x
,
ArgumentV1
::
show_usize
)
}
...
...
@@ -206,8 +202,7 @@ impl<'a> Arguments<'a> {
/// When using the format_args!() macro, this function is used to generate the
/// Arguments structure.
#[doc(hidden)]
#[inline]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#[cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#[unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
pub
fn
new_v1
(
pieces
:
&
'a
[
&
'a
str
],
args
:
&
'a
[
ArgumentV1
<
'a
>
])
->
Arguments
<
'a
>
{
Arguments
{
...
...
@@ -224,8 +219,7 @@ pub fn new_v1(pieces: &'a [&'a str],
/// created with `argumentusize`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[doc(hidden)]
#[inline]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#[cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#[unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
pub
fn
new_v1_formatted
(
pieces
:
&
'a
[
&
'a
str
],
args
:
&
'a
[
ArgumentV1
<
'a
>
],
fmt
:
&
'a
[
rt
::
v1
::
Argument
])
->
Arguments
<
'a
>
{
...
...
src/libcore/fmt/rt/v1.rs
浏览文件 @
c48b499e
...
...
@@ -14,69 +14,46 @@
//! These definitions are similar to their `ct` equivalents, but differ in that
//! these can be statically allocated and are slightly optimized for the runtime
#![cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
#![cfg_attr(not(stage0),
unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
))]
#![unstable(feature
=
"core"
,
reason
=
"internal to format_args!"
)]
#[derive(Copy,
Clone)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
struct
Argument
{
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
position
:
Position
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
format
:
FormatSpec
,
}
#[derive(Copy,
Clone)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
struct
FormatSpec
{
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
fill
:
char
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
align
:
Alignment
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
flags
:
u32
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
precision
:
Count
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
width
:
Count
,
}
/// Possible alignments that can be requested as part of a formatting directive.
#[derive(Copy,
Clone,
PartialEq)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
enum
Alignment
{
/// Indication that contents should be left-aligned.
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Left
,
/// Indication that contents should be right-aligned.
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Right
,
/// Indication that contents should be center-aligned.
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Center
,
/// No alignment was requested.
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Unknown
,
}
#[derive(Copy,
Clone)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
enum
Count
{
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Is
(
usize
),
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Param
(
usize
),
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
NextParam
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Implied
,
}
#[derive(Copy,
Clone)]
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
pub
enum
Position
{
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
Next
,
#[cfg_attr(stage0,
stable(feature
=
"rust1"
,
since
=
"1.0.0"
))]
At
(
usize
)
}
src/libcore/intrinsics.rs
浏览文件 @
c48b499e
...
...
@@ -303,14 +303,8 @@
/// }
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
pub
fn
copy_nonoverlapping
<
T
>
(
src
:
*
const
T
,
dst
:
*
mut
T
,
count
:
usize
);
/// dox
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
pub
fn
copy_nonoverlapping
<
T
>
(
dst
:
*
mut
T
,
src
:
*
const
T
,
count
:
usize
);
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
/// and destination may overlap.
///
...
...
@@ -340,14 +334,8 @@
/// ```
///
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
pub
fn
copy
<
T
>
(
src
:
*
const
T
,
dst
:
*
mut
T
,
count
:
usize
);
/// dox
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
pub
fn
copy
<
T
>
(
dst
:
*
mut
T
,
src
:
*
const
T
,
count
:
usize
);
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
/// bytes of memory starting at `dst` to `c`.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
...
...
@@ -572,7 +560,5 @@ pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
/// Returns the value of the discriminant for the variant in 'v',
/// cast to a `u64`; if `T` has no discriminant, returns 0.
// SNAP 5520801
#[cfg(not(stage0))]
pub
fn
discriminant_value
<
T
>
(
v
:
&
T
)
->
u64
;
}
src/libcore/lib.rs
浏览文件 @
c48b499e
...
...
@@ -65,7 +65,7 @@
#![feature(intrinsics,
lang_items)]
#![feature(on_unimplemented)]
#![feature(simd
,
unsafe_destructor
)]
#![feature(simd)]
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(rustc_attrs)]
...
...
src/libcore/marker.rs
浏览文件 @
c48b499e
...
...
@@ -35,20 +35,10 @@
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[lang=
"send"
]
#[rustc_on_unimplemented
=
"`{Self}` cannot be sent between threads safely"
]
#[cfg(not(stage0))]
pub
unsafe
trait
Send
{
// empty.
}
/// Types able to be transferred across thread boundaries.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[lang=
"send"
]
#[rustc_on_unimplemented
=
"`{Self}` cannot be sent between threads safely"
]
#[cfg(stage0)]
pub
unsafe
trait
Send
:
MarkerTrait
{
// empty.
}
unsafe
impl
Send
for
..
{
}
impl
<
T
>
!
Send
for
*
const
T
{
}
...
...
@@ -60,21 +50,10 @@ impl !Send for Managed { }
#[lang=
"sized"
]
#[rustc_on_unimplemented
=
"`{Self}` does not have a constant size known at compile-time"
]
#[fundamental]
// for Default, for example, which requires that `[T]: !Default` be evaluatable
#[cfg(not(stage0))]
pub
trait
Sized
{
// Empty.
}
/// Types with a constant size known at compile-time.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[lang=
"sized"
]
#[rustc_on_unimplemented
=
"`{Self}` does not have a constant size known at compile-time"
]
#[fundamental]
// for Default, for example, which requires that `[T]: !Default` be evaluatable
#[cfg(stage0)]
pub
trait
Sized
:
MarkerTrait
{
// Empty.
}
/// Types that can be copied by simply copying bits (i.e. `memcpy`).
///
/// By default, variable bindings have 'move semantics.' In other
...
...
@@ -222,7 +201,6 @@ pub trait Copy : Clone {
/// wrapper around the value(s) which can be mutated when behind a `&`
/// reference; not doing this is undefined behaviour (for example,
/// `transmute`-ing from `&T` to `&mut T` is illegal).
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[lang=
"sync"
]
#[rustc_on_unimplemented
=
"`{Self}` cannot be shared between threads safely"
]
...
...
@@ -230,15 +208,6 @@ pub unsafe trait Sync {
// Empty
}
/// dox
#[cfg(stage0)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[lang=
"sync"
]
#[rustc_on_unimplemented
=
"`{Self}` cannot be shared between threads safely"
]
pub
unsafe
trait
Sync
:
MarkerTrait
{
// Empty
}
unsafe
impl
Sync
for
..
{
}
impl
<
T
>
!
Sync
for
*
const
T
{
}
...
...
@@ -301,20 +270,6 @@ fn clone(&self) -> $t<T> {
)
}
/// dox
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
pub
trait
MarkerTrait
:
PhantomFn
<
Self
,
Self
>
{
}
#[cfg(stage0)]
impl
<
T
:
?
Sized
>
MarkerTrait
for
T
{}
/// dox
#[lang=
"phantom_fn"
]
#[cfg(stage0)]
pub
trait
PhantomFn
<
A
:
?
Sized
,
R
:
?
Sized
=
()
>
{
}
/// `PhantomData<T>` allows you to describe that a type acts as if it stores a value of type `T`,
/// even though it does not. This allows you to inform the compiler about certain safety properties
/// of your code.
...
...
@@ -461,14 +416,6 @@ unsafe impl<'a, T: Send + ?Sized> Send for &'a mut T {}
#[rustc_reflect_like]
#[unstable(feature
=
"core"
,
reason
=
"requires RFC and more experience"
)]
#[allow(deprecated)]
#[cfg(not(stage0))]
pub
trait
Reflect
{}
/// dox
#[rustc_reflect_like]
#[unstable(feature
=
"core"
,
reason
=
"requires RFC and more experience"
)]
#[cfg(stage0)]
pub
trait
Reflect
:
MarkerTrait
{}
impl
Reflect
for
..
{
}
src/libcore/nonzero.rs
浏览文件 @
c48b499e
...
...
@@ -12,16 +12,10 @@
use
marker
::
Sized
;
use
ops
::
Deref
;
#[cfg(stage0)]
use
marker
::
MarkerTrait
;
/// Unsafe trait to indicate what types are usable with the NonZero struct
#[cfg(not(stage0))]
pub
unsafe
trait
Zeroable
{}
/// Unsafe trait to indicate what types are usable with the NonZero struct
#[cfg(stage0)]
pub
unsafe
trait
Zeroable
:
MarkerTrait
{}
unsafe
impl
<
T
:
?
Sized
>
Zeroable
for
*
const
T
{}
unsafe
impl
<
T
:
?
Sized
>
Zeroable
for
*
mut
T
{}
unsafe
impl
Zeroable
for
isize
{}
...
...
src/libcore/ops.rs
浏览文件 @
c48b499e
...
...
@@ -508,8 +508,6 @@ impl Neg for $t {
macro_rules!
neg_impl_unsigned
{
(
$
(
$t:ty
)
*
)
=>
{
neg_impl_core!
{
x
=>
{
#[cfg(stage0)]
use
::
num
::
wrapping
::
WrappingOps
;
!
x
.wrapping_add
(
1
)
},
$
(
$t
)
*
}
}
}
...
...
@@ -1162,7 +1160,6 @@ pub trait FnOnce<Args> {
extern
"rust-call"
fn
call_once
(
self
,
args
:
Args
)
->
Self
::
Output
;
}
#[cfg(not(stage0))]
mod
impls
{
use
marker
::
Sized
;
use
super
::{
Fn
,
FnMut
,
FnOnce
};
...
...
src/libcore/ptr.rs
浏览文件 @
c48b499e
...
...
@@ -106,28 +106,11 @@
// FIXME #19649: intrinsic docs don't render, so these have no docs :(
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
pub
use
intrinsics
::
copy_nonoverlapping
;
/// dox
#[cfg(stage0)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
unsafe
fn
copy_nonoverlapping
<
T
>
(
src
:
*
const
T
,
dst
:
*
mut
T
,
count
:
usize
)
{
intrinsics
::
copy_nonoverlapping
(
dst
,
src
,
count
)
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
pub
use
intrinsics
::
copy
;
/// dox
#[cfg(stage0)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
unsafe
fn
copy
<
T
>
(
src
:
*
const
T
,
dst
:
*
mut
T
,
count
:
usize
)
{
intrinsics
::
copy
(
dst
,
src
,
count
)
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
use
intrinsics
::
write_bytes
;
...
...
src/libcoretest/lib.rs
浏览文件 @
c48b499e
...
...
@@ -13,7 +13,6 @@
#![feature(box_syntax)]
#![feature(unboxed_closures)]
#![feature(unsafe_destructor)]
#![feature(core)]
#![feature(test)]
#![feature(rand)]
...
...
src/libcoretest/option.rs
浏览文件 @
c48b499e
...
...
@@ -44,8 +44,7 @@ struct R {
i
:
Rc
<
RefCell
<
isize
>>
,
}
#[unsafe_destructor]
impl
Drop
for
R
{
impl
Drop
for
R
{
fn
drop
(
&
mut
self
)
{
let
ii
=
&*
self
.i
;
let
i
=
*
ii
.borrow
();
...
...
src/librustc/lib.rs
浏览文件 @
c48b499e
...
...
@@ -34,7 +34,6 @@
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#![feature(std_misc)]
#![feature(path_ext)]
...
...
src/librustc_borrowck/lib.rs
浏览文件 @
c48b499e
...
...
@@ -25,7 +25,6 @@
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(unsafe_destructor)]
#![feature(into_cow)]
#[macro_use]
extern
crate
log
;
...
...
src/librustc_driver/lib.rs
浏览文件 @
c48b499e
...
...
@@ -31,7 +31,6 @@
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#![feature(exit_status)]
#![feature(set_stdio)]
...
...
src/librustc_lint/lib.rs
浏览文件 @
c48b499e
...
...
@@ -37,7 +37,6 @@
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#![feature(str_char)]
#![cfg_attr(test,
feature(test))]
...
...
src/librustc_llvm/archive_ro.rs
浏览文件 @
c48b499e
...
...
@@ -105,7 +105,6 @@ fn next(&mut self) -> Option<Child<'a>> {
}
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
Iter
<
'a
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/librustc_llvm/lib.rs
浏览文件 @
c48b499e
...
...
@@ -30,7 +30,6 @@
#![feature(libc)]
#![feature(link_args)]
#![feature(staged_api)]
#![feature(unsafe_destructor)]
extern
crate
libc
;
#[macro_use]
#[no_link]
extern
crate
rustc_bitflags
;
...
...
src/librustc_trans/lib.rs
浏览文件 @
c48b499e
...
...
@@ -34,7 +34,6 @@
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#![feature(unicode)]
#![feature(path_ext)]
...
...
src/librustc_trans/trans/base.rs
浏览文件 @
c48b499e
...
...
@@ -125,7 +125,6 @@ pub struct _InsnCtxt {
_
cannot_construct_outside_of_this_module
:
()
}
#[unsafe_destructor]
impl
Drop
for
_
InsnCtxt
{
fn
drop
(
&
mut
self
)
{
TASK_LOCAL_INSN_KEY
.with
(|
slot
|
{
...
...
@@ -166,7 +165,6 @@ pub fn new(ccx: &'a CrateContext<'a, 'tcx>, name: String)
}
}
#[unsafe_destructor]
impl
<
'a
,
'tcx
>
Drop
for
StatRecorder
<
'a
,
'tcx
>
{
fn
drop
(
&
mut
self
)
{
if
self
.ccx
.sess
()
.trans_stats
()
{
...
...
src/librustc_typeck/lib.rs
浏览文件 @
c48b499e
...
...
@@ -82,7 +82,6 @@
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#[macro_use]
extern
crate
log
;
...
...
src/libstd/collections/hash/table.rs
浏览文件 @
c48b499e
...
...
@@ -943,7 +943,6 @@ impl<'a, K, V> ExactSizeIterator for Drain<'a, K, V> {
fn
len
(
&
self
)
->
usize
{
self
.table
.size
()
}
}
#[unsafe_destructor]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
Drop
for
Drain
<
'a
,
K
,
V
>
{
fn
drop
(
&
mut
self
)
{
for
_
in
self
.by_ref
()
{}
...
...
@@ -986,7 +985,6 @@ fn clone(&self) -> RawTable<K, V> {
}
}
#[unsafe_destructor]
impl
<
K
,
V
>
Drop
for
RawTable
<
K
,
V
>
{
fn
drop
(
&
mut
self
)
{
if
self
.capacity
==
0
||
self
.capacity
==
mem
::
POST_DROP_USIZE
{
...
...
src/libstd/io/buffered.rs
浏览文件 @
c48b499e
...
...
@@ -292,7 +292,6 @@ fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
}
}
#[unsafe_destructor]
impl
<
W
:
Write
>
Drop
for
BufWriter
<
W
>
{
fn
drop
(
&
mut
self
)
{
if
self
.inner
.is_some
()
{
...
...
src/libstd/io/mod.rs
浏览文件 @
c48b499e
...
...
@@ -70,8 +70,7 @@ fn append_to_string<F>(buf: &mut String, f: F) -> Result<usize>
where
F
:
FnOnce
(
&
mut
Vec
<
u8
>
)
->
Result
<
usize
>
{
struct
Guard
<
'a
>
{
s
:
&
'a
mut
Vec
<
u8
>
,
len
:
usize
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
Guard
<
'a
>
{
impl
<
'a
>
Drop
for
Guard
<
'a
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
self
.s
.set_len
(
self
.len
);
}
}
...
...
src/libstd/lib.rs
浏览文件 @
c48b499e
...
...
@@ -118,7 +118,6 @@
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(unsafe_destructor)]
#![feature(unsafe_no_drop_flag,
filling_drop)]
#![feature(macro_reexport)]
#![feature(unique)]
...
...
src/libstd/macros.rs
浏览文件 @
c48b499e
...
...
@@ -38,30 +38,6 @@
#[macro_export]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[allow_internal_unstable]
#[cfg(stage0)]
macro_rules!
panic
{
()
=>
({
panic!
(
"explicit panic"
)
});
(
$msg:expr
)
=>
({
$crate
::
rt
::
begin_unwind
(
$msg
,
{
// static requires less code at runtime, more constant data
static
_
FILE_LINE
:
(
&
'static
str
,
usize
)
=
(
file!
(),
line!
()
as
usize
);
&
_
FILE_LINE
})
});
(
$fmt:expr
,
$
(
$arg:tt
)
+
)
=>
({
$crate
::
rt
::
begin_unwind_fmt
(
format_args!
(
$fmt
,
$
(
$arg
)
+
),
{
// The leading _'s are to avoid dead code warnings if this is
// used inside a dead function. Just `#[allow(dead_code)]` is
// insufficient, since the user may have
// `#[forbid(dead_code)]` and which cannot be overridden.
static
_
FILE_LINE
:
(
&
'static
str
,
u32
)
=
(
file!
(),
line!
());
&
_
FILE_LINE
})
});
}
/// The entry point for panic of Rust tasks.
///
/// This macro is used to inject panic into a Rust task, causing the task to
...
...
@@ -84,7 +60,6 @@
#[macro_export]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[allow_internal_unstable]
#[cfg(not(stage0))]
macro_rules!
panic
{
()
=>
({
panic!
(
"explicit panic"
)
...
...
src/libstd/rt/unwind.rs
浏览文件 @
c48b499e
...
...
@@ -510,23 +510,6 @@ pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, u32)) ->
/// This is the entry point of unwinding for panic!() and assert!().
#[inline(never)]
#[cold]
// avoid code bloat at the call sites as much as possible
#[cfg(stage0)]
pub
fn
begin_unwind
<
M
:
Any
+
Send
>
(
msg
:
M
,
file_line
:
&
(
&
'static
str
,
usize
))
->
!
{
// Note that this should be the only allocation performed in this code path.
// Currently this means that panic!() on OOM will invoke this code path,
// but then again we're not really ready for panic on OOM anyway. If
// we do start doing this, then we should propagate this allocation to
// be performed in the parent of this thread instead of the thread that's
// panicking.
// see below for why we do the `Any` coercion here.
let
(
file
,
line
)
=
*
file_line
;
begin_unwind_inner
(
Box
::
new
(
msg
),
&
(
file
,
line
as
u32
))
}
/// This is the entry point of unwinding for panic!() and assert!().
#[inline(never)]
#[cold]
// avoid code bloat at the call sites as much as possible
#[cfg(not(stage0))]
pub
fn
begin_unwind
<
M
:
Any
+
Send
>
(
msg
:
M
,
file_line
:
&
(
&
'static
str
,
u32
))
->
!
{
// Note that this should be the only allocation performed in this code path.
// Currently this means that panic!() on OOM will invoke this code path,
...
...
src/libstd/sync/mpsc/mod.rs
浏览文件 @
c48b499e
...
...
@@ -619,7 +619,6 @@ fn clone(&self) -> Sender<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Sender
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -683,7 +682,6 @@ fn clone(&self) -> SyncSender<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
SyncSender
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -930,7 +928,6 @@ fn into_iter(self) -> IntoIter<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Receiver
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
src/libstd/sync/mpsc/mpsc_queue.rs
浏览文件 @
c48b499e
...
...
@@ -138,7 +138,6 @@ pub fn pop(&self) -> PopResult<T> {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Queue
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
src/libstd/sync/mpsc/oneshot.rs
浏览文件 @
c48b499e
...
...
@@ -367,7 +367,6 @@ pub fn abort_selection(&mut self) -> Result<bool, Receiver<T>> {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Packet
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert_eq!
(
self
.state
.load
(
Ordering
::
SeqCst
),
DISCONNECTED
);
...
...
src/libstd/sync/mpsc/select.rs
浏览文件 @
c48b499e
...
...
@@ -315,7 +315,6 @@ pub unsafe fn remove(&mut self) {
}
}
#[unsafe_destructor]
impl
Drop
for
Select
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.head
.is_null
());
...
...
@@ -323,7 +322,6 @@ fn drop(&mut self) {
}
}
#[unsafe_destructor]
impl
<
'rx
,
T
:
Send
>
Drop
for
Handle
<
'rx
,
T
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
self
.remove
()
}
...
...
src/libstd/sync/mpsc/shared.rs
浏览文件 @
c48b499e
...
...
@@ -473,7 +473,6 @@ pub fn abort_selection(&mut self, _was_upgrade: bool) -> bool {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Packet
<
T
>
{
fn
drop
(
&
mut
self
)
{
// Note that this load is not only an assert for correctness about
...
...
src/libstd/sync/mpsc/spsc_queue.rs
浏览文件 @
c48b499e
...
...
@@ -226,7 +226,6 @@ pub fn peek<'a>(&'a self) -> Option<&'a mut T> {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Queue
<
T
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/libstd/sync/mpsc/stream.rs
浏览文件 @
c48b499e
...
...
@@ -471,7 +471,6 @@ pub fn abort_selection(&mut self,
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Packet
<
T
>
{
fn
drop
(
&
mut
self
)
{
// Note that this load is not only an assert for correctness about
...
...
src/libstd/sync/mpsc/sync.rs
浏览文件 @
c48b499e
...
...
@@ -411,7 +411,6 @@ pub fn abort_selection(&self) -> bool {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Packet
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert_eq!
(
self
.channels
.load
(
Ordering
::
SeqCst
),
0
);
...
...
src/libstd/sync/mutex.rs
浏览文件 @
c48b499e
...
...
@@ -244,7 +244,6 @@ pub fn is_poisoned(&self) -> bool {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
Mutex
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -340,7 +339,6 @@ fn deref_mut<'a>(&'a mut self) -> &'a mut T {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Drop
for
MutexGuard
<
'a
,
T
>
{
#[inline]
...
...
src/libstd/sync/rwlock.rs
浏览文件 @
c48b499e
...
...
@@ -249,7 +249,6 @@ pub fn is_poisoned(&self) -> bool {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Drop
for
RwLock
<
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -387,7 +386,6 @@ fn deref_mut(&mut self) -> &mut T {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Drop
for
RwLockReadGuard
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -395,7 +393,6 @@ fn drop(&mut self) {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Drop
for
RwLockWriteGuard
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
src/libstd/sync/semaphore.rs
浏览文件 @
c48b499e
...
...
@@ -100,7 +100,6 @@ pub fn access(&self) -> SemaphoreGuard {
}
}
#[unsafe_destructor]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
>
Drop
for
SemaphoreGuard
<
'a
>
{
fn
drop
(
&
mut
self
)
{
...
...
src/libstd/sys/common/remutex.rs
浏览文件 @
c48b499e
...
...
@@ -96,7 +96,6 @@ pub fn try_lock(&self) -> TryLockResult<ReentrantMutexGuard<T>> {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
ReentrantMutex
<
T
>
{
fn
drop
(
&
mut
self
)
{
// This is actually safe b/c we know that there is no further usage of
...
...
@@ -138,7 +137,6 @@ fn deref<'a>(&'a self) -> &'a T {
}
}
#[unsafe_destructor]
impl
<
'a
,
T
>
Drop
for
ReentrantMutexGuard
<
'a
,
T
>
{
#[inline]
fn
drop
(
&
mut
self
)
{
...
...
src/libstd/thread/mod.rs
浏览文件 @
c48b499e
...
...
@@ -700,7 +700,6 @@ pub fn join(mut self) -> T {
}
}
#[unsafe_destructor]
#[unstable(feature
=
"scoped"
,
reason
=
"memory unsafe if destructor is avoided, see #24292"
)]
impl
<
'a
,
T
:
Send
+
'a
>
Drop
for
JoinGuard
<
'a
,
T
>
{
...
...
src/libstd/thread/scoped_tls.rs
浏览文件 @
c48b499e
...
...
@@ -171,8 +171,7 @@ struct Reset<'a, T: 'a> {
key
:
&
'a
__
impl
::
KeyInner
<
T
>
,
val
:
*
mut
T
,
}
#[unsafe_destructor]
impl
<
'a
,
T
>
Drop
for
Reset
<
'a
,
T
>
{
impl
<
'a
,
T
>
Drop
for
Reset
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
self
.key
.set
(
self
.val
)
}
}
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
c48b499e
...
...
@@ -93,10 +93,6 @@
(
"fundamental"
,
"1.0.0"
,
Active
),
// Deprecate after snapshot
// SNAP 5520801
(
"unsafe_destructor"
,
"1.0.0"
,
Active
),
// A temporary feature gate used to enable parser extensions needed
// to bootstrap fix for #5723.
(
"issue_5723_bootstrap"
,
"1.0.0"
,
Accepted
),
...
...
@@ -209,8 +205,6 @@ enum Status {
(
"link_args"
,
Normal
),
(
"macro_escape"
,
Normal
),
(
"unsafe_destructor"
,
Gated
(
"unsafe_destructor"
,
"`#[unsafe_destructor]` does nothing anymore"
)),
(
"staged_api"
,
Gated
(
"staged_api"
,
"staged_api is for use by rustc only"
)),
(
"plugin"
,
Gated
(
"plugin"
,
...
...
src/snapshots.txt
浏览文件 @
c48b499e
S 2015-04-27 857ef6e
bitrig-x86_64 d28e2a5f8b478e69720703e751774f5e728a8edd
freebsd-x86_64 18925db56f6298cc190d1f41615ab5871de1dda0
linux-i386 0bc8cffdce611fb71fd7d3d8e7cdbfaf748a4f16
linux-x86_64 94089740e48167c5975c92c139ae9c286764012f
macos-i386 54cc35e76497e6e94fddf38d6e40e9d168491ddb
macos-x86_64 43a1c1fba0d1dfee4c2ca310d506f8f5f51b3f6f
winnt-i386 3db3adf2eaf37075043ec4ee41a5ea9b88810c44
winnt-x86_64 82b6eaea67741517ce6d7901ad2a9fd223c3aaf1
S 2015-03-27 5520801
bitrig-x86_64 55a69b0ae5481ccda54c2fcfc54025a0945c4f57
freebsd-x86_64 0910bbad35e213f679d0433884fd51398eb3bc8d
...
...
src/test/auxiliary/issue-2526.rs
浏览文件 @
c48b499e
...
...
@@ -11,8 +11,6 @@
#![crate_name=
"issue_2526"
]
#![crate_type
=
"lib"
]
#![feature(unsafe_destructor)]
use
std
::
marker
;
struct
arc_destruct
<
T
:
Sync
>
{
...
...
@@ -20,7 +18,6 @@ struct arc_destruct<T: Sync> {
_
marker
:
marker
::
PhantomData
<
T
>
}
#[unsafe_destructor]
impl
<
T
:
Sync
>
Drop
for
arc_destruct
<
T
>
{
fn
drop
(
&
mut
self
)
{}
}
...
...
src/test/bench/task-perf-alloc-unwind.rs
浏览文件 @
c48b499e
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(
unsafe_destructor,
box_syntax,
std_misc,
collections)]
#![feature(box_syntax,
std_misc,
collections)]
use
std
::
env
;
use
std
::
thread
;
...
...
@@ -54,7 +54,6 @@ struct r {
_
l
:
Box
<
nillist
>
,
}
#[unsafe_destructor]
impl
Drop
for
r
{
fn
drop
(
&
mut
self
)
{}
}
...
...
src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs
浏览文件 @
c48b499e
...
...
@@ -8,13 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct
defer
<
'a
>
{
x
:
&
'a
[
&
'a
str
],
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
defer
<
'a
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/test/compile-fail/dropck_arr_cycle_checked.rs
浏览文件 @
c48b499e
...
...
@@ -13,8 +13,6 @@
//
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
use
id
::
Id
;
...
...
@@ -69,7 +67,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn
CheckId
<
T
:
HasId
>
(
t
:
T
)
->
CheckId
<
T
>
{
CheckId
{
v
:
t
}
}
#[unsafe_destructor]
impl
<
T
:
HasId
>
Drop
for
CheckId
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.v
.count
()
>
0
);
...
...
src/test/compile-fail/dropck_direct_cycle_with_drop.rs
浏览文件 @
c48b499e
...
...
@@ -23,8 +23,6 @@
// `'a` in `&'a D<'a>` cannot be satisfied when `D<'a>` implements
// `Drop`.)
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
struct
D
<
'a
>
{
...
...
@@ -36,7 +34,6 @@ impl<'a> D<'a> {
fn
new
(
name
:
String
)
->
D
<
'a
>
{
D
{
name
:
name
,
p
:
Cell
::
new
(
None
)
}
}
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
D
<
'a
>
{
fn
drop
(
&
mut
self
)
{
println!
(
"dropping {} whose sibling is {:?}"
,
...
...
src/test/compile-fail/dropck_tarena_cycle_checked.rs
浏览文件 @
c48b499e
...
...
@@ -17,7 +17,6 @@
// for the error message we see here.)
#![allow(unstable)]
#![feature(unsafe_destructor)]
extern
crate
arena
;
...
...
@@ -76,7 +75,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn
CheckId
<
T
:
HasId
>
(
t
:
T
)
->
CheckId
<
T
>
{
CheckId
{
v
:
t
}
}
#[unsafe_destructor]
impl
<
T
:
HasId
>
Drop
for
CheckId
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.v
.count
()
>
0
);
...
...
src/test/compile-fail/dropck_tarena_unsound_drop.rs
浏览文件 @
c48b499e
...
...
@@ -20,7 +20,6 @@
// this was reduced to better understand its error message.)
#![allow(unstable)]
#![feature(unsafe_destructor)]
extern
crate
arena
;
...
...
@@ -35,7 +34,6 @@ struct CheckId<T:HasId> { v: T }
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
#[unsafe_destructor]
impl
<
T
:
HasId
>
Drop
for
CheckId
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.v
.count
()
>
0
);
...
...
src/test/compile-fail/dropck_vec_cycle_checked.rs
浏览文件 @
c48b499e
...
...
@@ -12,8 +12,6 @@
//
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
use
id
::
Id
;
...
...
@@ -68,7 +66,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn
CheckId
<
T
:
HasId
>
(
t
:
T
)
->
CheckId
<
T
>
{
CheckId
{
v
:
t
}
}
#[unsafe_destructor]
impl
<
T
:
HasId
>
Drop
for
CheckId
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.v
.count
()
>
0
);
...
...
src/test/compile-fail/exclusive-drop-and-copy.rs
浏览文件 @
c48b499e
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// issue #20126
#[derive(Copy,
Clone)]
//~ ERROR the trait `Copy` may not be implemented
...
...
@@ -22,7 +20,6 @@ fn drop(&mut self) {}
#[derive(Copy,
Clone)]
//~ ERROR the trait `Copy` may not be implemented
struct
Bar
<
T
>
(::
std
::
marker
::
PhantomData
<
T
>
);
#[unsafe_destructor]
impl
<
T
>
Drop
for
Bar
<
T
>
{
fn
drop
(
&
mut
self
)
{}
}
...
...
src/test/compile-fail/gated-unsafe-destructor.rs
已删除
100644 → 0
浏览文件 @
c4b23aec
// Copyright 2015 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.
// Test that `#[unsafe_destructor]` attribute is gated by `unsafe_destructor`
// feature gate.
//
// (This test can be removed entirely when we remove the
// `unsafe_destructor` feature itself.)
struct
D
<
'a
>
(
&
'a
u32
);
#[unsafe_destructor]
//~^ ERROR `#[unsafe_destructor]` does nothing anymore
impl
<
'a
>
Drop
for
D
<
'a
>
{
fn
drop
(
&
mut
self
)
{
}
}
pub
fn
main
()
{
}
src/test/compile-fail/no-send-res-ports.rs
浏览文件 @
c48b499e
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
thread
;
use
std
::
rc
::
Rc
;
...
...
@@ -22,8 +20,7 @@ struct foo {
_
x
:
Port
<
()
>
,
}
#[unsafe_destructor]
impl
Drop
for
foo
{
impl
Drop
for
foo
{
fn
drop
(
&
mut
self
)
{}
}
...
...
src/test/compile-fail/reject-specialized-drops-8142.rs
浏览文件 @
c48b499e
...
...
@@ -11,8 +11,6 @@
// Issue 8142: Test that Drop impls cannot be specialized beyond the
// predicates attached to the struct/enum definition itself.
#![feature(unsafe_destructor)]
trait
Bound
{
fn
foo
(
&
self
)
{
}
}
struct
K
<
'l1
,
'l2
>
{
x
:
&
'l1
i8
,
y
:
&
'l2
u8
}
struct
L
<
'l1
,
'l2
>
{
x
:
&
'l1
i8
,
y
:
&
'l2
u8
}
...
...
@@ -28,51 +26,39 @@ struct T<'t,Ts:'t> { x: &'t Ts }
struct
V
<
Tva
,
Tvb
>
{
x
:
*
const
Tva
,
y
:
*
const
Tvb
}
struct
W
<
'l1
,
'l2
>
{
x
:
&
'l1
i8
,
y
:
&
'l2
u8
}
#[unsafe_destructor]
impl
<
'al
,
'adds_bnd
:
'al
>
Drop
for
K
<
'al
,
'adds_bnd
>
{
// REJECT
//~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl.
fn
drop
(
&
mut
self
)
{
}
}
#[unsafe_destructor]
impl
<
'al
,
'adds_bnd
>
Drop
for
L
<
'al
,
'adds_bnd
>
where
'adds_bnd
:
'al
{
// REJECT
//~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl.
fn
drop
(
&
mut
self
)
{
}
}
#[unsafe_destructor]
impl
<
'ml
>
Drop
for
M
<
'ml
>
{
fn
drop
(
&
mut
self
)
{
}
}
// ACCEPT
#[unsafe_destructor]
impl
Drop
for
N
<
'static
>
{
fn
drop
(
&
mut
self
)
{
}
}
// REJECT
//~^ ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl
<
Cok_nobound
>
Drop
for
O
<
Cok_nobound
>
{
fn
drop
(
&
mut
self
)
{
}
}
// ACCEPT
#[unsafe_destructor]
impl
Drop
for
P
<
i8
>
{
fn
drop
(
&
mut
self
)
{
}
}
// REJECT
//~^ ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl
<
Adds_bnd
:
Bound
>
Drop
for
Q
<
Adds_bnd
>
{
fn
drop
(
&
mut
self
)
{
}
}
// REJECT
//~^ ERROR The requirement `Adds_bnd : Bound` is added only by the Drop impl.
#[unsafe_destructor]
impl
<
'rbnd
,
Adds_rbnd
:
'rbnd
>
Drop
for
R
<
Adds_rbnd
>
{
fn
drop
(
&
mut
self
)
{
}
}
// REJECT
//~^ ERROR The requirement `Adds_rbnd : 'rbnd` is added only by the Drop impl.
#[unsafe_destructor]
impl
<
Bs
:
Bound
>
Drop
for
S
<
Bs
>
{
fn
drop
(
&
mut
self
)
{
}
}
// ACCEPT
#[unsafe_destructor]
impl
<
't
,
Bt
:
't
>
Drop
for
T
<
't
,
Bt
>
{
fn
drop
(
&
mut
self
)
{
}
}
// ACCEPT
impl
Drop
for
U
{
fn
drop
(
&
mut
self
)
{
}
}
// ACCEPT
#[unsafe_destructor]
impl
<
One
>
Drop
for
V
<
One
,
One
>
{
fn
drop
(
&
mut
self
)
{
}
}
// REJECT
//~^ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl
<
'lw
>
Drop
for
W
<
'lw
,
'lw
>
{
fn
drop
(
&
mut
self
)
{
}
}
// REJECT
//~^ERROR Implementations of Drop cannot be specialized
...
...
src/test/compile-fail/unique-vec-res.rs
浏览文件 @
c48b499e
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
#[derive(Debug)]
...
...
@@ -17,7 +15,6 @@ struct r<'a> {
i
:
&
'a
Cell
<
isize
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
r
<
'a
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
浏览文件 @
c48b499e
...
...
@@ -23,8 +23,6 @@
// conditions above to be satisfied, meaning that if the dropck is
// sound, it should reject this code.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
use
id
::
Id
;
...
...
@@ -91,7 +89,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn
CheckId
<
T
:
HasId
>
(
t
:
T
)
->
CheckId
<
T
>
{
CheckId
{
v
:
t
}
}
#[unsafe_destructor]
impl
<
T
:
HasId
>
Drop
for
CheckId
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.v
.count
()
>
0
);
...
...
src/test/run-pass/attr-no-drop-flag-size.rs
浏览文件 @
c48b499e
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
#![feature(unsafe_no_drop_flag)]
use
std
::
mem
::
size_of
;
...
...
@@ -19,7 +17,6 @@ struct Test<T> {
a
:
T
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Test
<
T
>
{
fn
drop
(
&
mut
self
)
{
}
}
...
...
src/test/run-pass/drop-trait-generic.rs
浏览文件 @
c48b499e
...
...
@@ -8,13 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct
S
<
T
>
{
x
:
T
}
#[unsafe_destructor]
impl
<
T
>
::
std
::
ops
::
Drop
for
S
<
T
>
{
fn
drop
(
&
mut
self
)
{
println!
(
"bye"
);
...
...
src/test/run-pass/dropck_tarena_sound_drop.rs
浏览文件 @
c48b499e
...
...
@@ -16,9 +16,8 @@
// shows a similar setup, but restricts `f` so that the struct `C<'a>`
// is force-fed a lifetime equal to that of the borrowed arena.
#![allow(unstable)]
#![feature(
unsafe_destructor,
rustc_private)]
#![feature(rustc_private)]
extern
crate
arena
;
...
...
@@ -33,7 +32,6 @@ struct CheckId<T:HasId> { v: T }
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
#[unsafe_destructor]
impl
<
T
:
HasId
>
Drop
for
CheckId
<
T
>
{
fn
drop
(
&
mut
self
)
{
assert
!
(
self
.v
.count
()
>
0
);
...
...
src/test/run-pass/init-res-into-things.rs
浏览文件 @
c48b499e
...
...
@@ -8,10 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
...
...
@@ -24,7 +21,6 @@ struct r<'a> {
struct
BoxR
<
'a
>
{
x
:
r
<
'a
>
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
r
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.i
.set
(
self
.i
.get
()
+
1
)
...
...
src/test/run-pass/issue-15858.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
static
mut
DROP_RAN
:
bool
=
false
;
trait
Bar
{
...
...
@@ -26,7 +23,6 @@ fn do_something(&mut self) {}
struct
Foo
<
B
:
Bar
>
(
B
);
#[unsafe_destructor]
impl
<
B
:
Bar
>
Drop
for
Foo
<
B
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
...
...
src/test/run-pass/issue-15924.rs
浏览文件 @
c48b499e
...
...
@@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(
unsafe_destructor,
rustc_private)]
#![feature(rustc_private)]
extern
crate
serialize
;
...
...
@@ -22,7 +22,6 @@ struct Foo<T: Encodable> {
v
:
T
,
}
#[unsafe_destructor]
impl
<
T
:
Encodable
>
Drop
for
Foo
<
T
>
{
fn
drop
(
&
mut
self
)
{
json
::
encode
(
&
self
.v
);
...
...
src/test/run-pass/issue-16492.rs
浏览文件 @
c48b499e
...
...
@@ -10,8 +10,6 @@
// ignore-pretty
#![feature(unsafe_destructor)]
use
std
::
rc
::
Rc
;
use
std
::
cell
::
Cell
;
...
...
@@ -29,7 +27,6 @@ fn new(number: usize, state: Rc<Cell<usize>>) -> Field {
}
}
#[unsafe_destructor]
// because Field isn't Send
impl
Drop
for
Field
{
fn
drop
(
&
mut
self
)
{
println!
(
"Dropping field {}"
,
self
.number
);
...
...
@@ -50,7 +47,6 @@ struct HasDropImpl {
_
three
:
Field
}
#[unsafe_destructor]
// because HasDropImpl isn't Send
impl
Drop
for
HasDropImpl
{
fn
drop
(
&
mut
self
)
{
println!
(
"HasDropImpl.drop()"
);
...
...
src/test/run-pass/issue-17216.rs
浏览文件 @
c48b499e
...
...
@@ -8,14 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct
Leak
<
'a
>
{
dropped
:
&
'a
mut
bool
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
Leak
<
'a
>
{
fn
drop
(
&
mut
self
)
{
*
self
.dropped
=
true
;
...
...
src/test/run-pass/issue-2718.rs
浏览文件 @
c48b499e
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
//
#![feature(
unsafe_destructor,
std_misc)]
#![feature(std_misc)]
pub
type
Task
=
isize
;
...
...
@@ -165,8 +165,7 @@ pub struct send_packet<T:Send> {
p
:
Option
<*
const
packet
<
T
>>
,
}
#[unsafe_destructor]
impl
<
T
:
Send
>
Drop
for
send_packet
<
T
>
{
impl
<
T
:
Send
>
Drop
for
send_packet
<
T
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
if
self
.p
!=
None
{
...
...
@@ -195,8 +194,7 @@ pub struct recv_packet<T:Send> {
p
:
Option
<*
const
packet
<
T
>>
,
}
#[unsafe_destructor]
impl
<
T
:
Send
>
Drop
for
recv_packet
<
T
>
{
impl
<
T
:
Send
>
Drop
for
recv_packet
<
T
>
{
fn
drop
(
&
mut
self
)
{
unsafe
{
if
self
.p
!=
None
{
...
...
src/test/run-pass/issue-2735-2.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
// This test should behave exactly like issue-2735-3
...
...
@@ -18,7 +15,6 @@ struct defer<'a> {
b
:
&
'a
Cell
<
bool
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
defer
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.b
.set
(
true
);
...
...
src/test/run-pass/issue-2735-3.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
// This test should behave exactly like issue-2735-2
...
...
@@ -18,7 +15,6 @@ struct defer<'a> {
b
:
&
'a
Cell
<
bool
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
defer
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.b
.set
(
true
);
...
...
src/test/run-pass/issue-4252.rs
浏览文件 @
c48b499e
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
trait
X
{
fn
call
<
T
:
std
::
fmt
::
Debug
>
(
&
self
,
x
:
&
T
);
fn
default_method
<
T
:
std
::
fmt
::
Debug
>
(
&
self
,
x
:
&
T
)
{
...
...
@@ -31,7 +29,6 @@ fn call<T: std::fmt::Debug>(&self, x: &T) {
}
}
#[unsafe_destructor]
impl
<
T
:
X
+
std
::
fmt
::
Debug
>
Drop
for
Z
<
T
>
{
fn
drop
(
&
mut
self
)
{
// These statements used to cause an ICE.
...
...
src/test/run-pass/issue-979.rs
浏览文件 @
c48b499e
...
...
@@ -8,16 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
struct
r
<
'a
>
{
b
:
&
'a
Cell
<
isize
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
r
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.b
.set
(
self
.b
.get
()
+
1
);
...
...
src/test/run-pass/newtype-struct-drop-run.rs
浏览文件 @
c48b499e
...
...
@@ -8,16 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Make sure the destructor is run for newtype structs.
use
std
::
cell
::
Cell
;
struct
Foo
<
'a
>
(
&
'a
Cell
<
isize
>
);
#[unsafe_destructor]
impl
<
'a
>
Drop
for
Foo
<
'a
>
{
fn
drop
(
&
mut
self
)
{
let
Foo
(
i
)
=
*
self
;
...
...
src/test/run-pass/option-unwrap.rs
浏览文件 @
c48b499e
...
...
@@ -8,16 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
struct
dtor
<
'a
>
{
x
:
&
'a
Cell
<
isize
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
dtor
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.x
.set
(
self
.x
.get
()
-
1
);
...
...
src/test/run-pass/regions-no-bound-in-argument-cleanup.rs
浏览文件 @
c48b499e
...
...
@@ -10,8 +10,6 @@
// pretty-expanded FIXME #23616
#![feature(unsafe_destructor)]
use
std
::
marker
;
pub
struct
Foo
<
T
>
(
marker
::
PhantomData
<
T
>
);
...
...
@@ -24,7 +22,6 @@ fn next(&mut self) -> Option<T> {
}
}
#[unsafe_destructor]
impl
<
T
>
Drop
for
Foo
<
T
>
{
fn
drop
(
&
mut
self
)
{
self
.next
();
...
...
src/test/run-pass/resource-assign-is-not-copy.rs
浏览文件 @
c48b499e
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
#[derive(Debug)]
...
...
@@ -17,7 +15,6 @@ struct r<'a> {
i
:
&
'a
Cell
<
isize
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
r
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.i
.set
(
self
.i
.get
()
+
1
);
...
...
src/test/run-pass/resource-destruct.rs
浏览文件 @
c48b499e
...
...
@@ -8,15 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
struct
shrinky_pointer
<
'a
>
{
i
:
&
'a
Cell
<
isize
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
shrinky_pointer
<
'a
>
{
fn
drop
(
&
mut
self
)
{
println!
(
"Hello!"
);
self
.i
.set
(
self
.i
.get
()
-
1
);
...
...
src/test/run-pass/resource-in-struct.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Ensures that class dtors run if the object is inside an enum
// variant
...
...
@@ -23,7 +20,6 @@ struct close_res<'a> {
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
close_res
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.i
.set
(
false
);
...
...
src/test/run-pass/unboxed-closures-infer-fnonce-move.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Test that we are able to infer a suitable kind for this `move`
// closure that is just called (`FnOnce`).
...
...
@@ -18,7 +15,6 @@
struct
DropMe
<
'a
>
(
&
'a
mut
i32
);
#[unsafe_destructor]
impl
<
'a
>
Drop
for
DropMe
<
'a
>
{
fn
drop
(
&
mut
self
)
{
*
self
.0
+=
1
;
...
...
src/test/run-pass/unboxed-closures-infer-fnonce.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Test that we are able to infer a suitable kind for this closure
// that is just called (`FnOnce`).
...
...
@@ -18,7 +15,6 @@
struct
DropMe
<
'a
>
(
&
'a
mut
i32
);
#[unsafe_destructor]
impl
<
'a
>
Drop
for
DropMe
<
'a
>
{
fn
drop
(
&
mut
self
)
{
*
self
.0
+=
1
;
...
...
src/test/run-pass/vec-slice-drop.rs
浏览文件 @
c48b499e
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use
std
::
cell
::
Cell
;
// Make sure that destructors get run on slice literals
...
...
@@ -18,7 +15,6 @@ struct foo<'a> {
x
:
&
'a
Cell
<
isize
>
,
}
#[unsafe_destructor]
impl
<
'a
>
Drop
for
foo
<
'a
>
{
fn
drop
(
&
mut
self
)
{
self
.x
.set
(
self
.x
.get
()
+
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录