Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6e29f86b
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
6e29f86b
编写于
10月 11, 2014
作者:
B
Boris Egorov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove into_vec method from &[T]
[breaking-change] Closes #17916
上级
1add4ded
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
14 deletion
+9
-14
src/libcollections/slice.rs
src/libcollections/slice.rs
+7
-5
src/libcollections/vec.rs
src/libcollections/vec.rs
+0
-7
src/libgraphviz/maybe_owned_vec.rs
src/libgraphviz/maybe_owned_vec.rs
+1
-1
src/librustc/middle/traits/select.rs
src/librustc/middle/traits/select.rs
+1
-1
未找到文件。
src/libcollections/slice.rs
浏览文件 @
6e29f86b
...
...
@@ -277,12 +277,14 @@ fn to_owned(&self) -> Vec<T> {
}
/// Converts `self` into an owned vector, not making a copy if possible.
/// Deprecated. Use 'to_vec'
#[deprecated
=
"Replaced by `to_vec`"
]
fn
into_vec
(
self
)
->
Vec
<
T
>
;
/// Deprecated. Use `
in
to_vec`
#[deprecated
=
"Replaced by `
in
to_vec`"
]
/// Deprecated. Use `to_vec`
#[deprecated
=
"Replaced by `to_vec`"
]
fn
into_owned
(
self
)
->
Vec
<
T
>
{
self
.
in
to_vec
()
self
.to_vec
()
}
}
...
...
@@ -2328,9 +2330,9 @@ fn test_mut_last() {
}
#[test]
fn
test_
in
to_vec
()
{
fn
test_to_vec
()
{
let
xs
=
box
[
1u
,
2
,
3
];
let
ys
=
xs
.
in
to_vec
();
let
ys
=
xs
.to_vec
();
assert_eq!
(
ys
.as_slice
(),
[
1u
,
2
,
3
]
.as_slice
());
}
}
...
...
src/libcollections/vec.rs
浏览文件 @
6e29f86b
...
...
@@ -614,13 +614,6 @@ fn len(&self) -> uint {
}
}
impl
<
T
:
Clone
>
CloneableVector
<
T
>
for
Vec
<
T
>
{
#[deprecated
=
"call .clone() instead"
]
fn
to_vec
(
&
self
)
->
Vec
<
T
>
{
self
.clone
()
}
#[deprecated
=
"move the vector instead"
]
fn
into_vec
(
self
)
->
Vec
<
T
>
{
self
}
}
// FIXME: #13996: need a way to mark the return value as `noalias`
#[inline(never)]
unsafe
fn
alloc_or_realloc
<
T
>
(
ptr
:
*
mut
T
,
old_size
:
uint
,
size
:
uint
)
->
*
mut
T
{
...
...
src/libgraphviz/maybe_owned_vec.rs
浏览文件 @
6e29f86b
...
...
@@ -140,7 +140,7 @@ fn into_vec(self) -> Vec<T> {
impl
<
'a
,
T
:
Clone
>
Clone
for
MaybeOwnedVector
<
'a
,
T
>
{
fn
clone
(
&
self
)
->
MaybeOwnedVector
<
'a
,
T
>
{
match
*
self
{
Growable
(
ref
v
)
=>
Growable
(
v
.
to_vec
()),
Growable
(
ref
v
)
=>
Growable
(
v
.
clone
()),
Borrowed
(
v
)
=>
Borrowed
(
v
)
}
}
...
...
src/librustc/middle/traits/select.rs
浏览文件 @
6e29f86b
...
...
@@ -1014,7 +1014,7 @@ fn builtin_bound(&mut self,
ty
::
ty_tup
(
ref
tys
)
=>
{
// (T1, ..., Tn) -- meets any bound that all of T1...Tn meet
Ok
(
If
(
tys
.
to_owned
()))
Ok
(
If
(
tys
.
clone
()))
}
ty
::
ty_unboxed_closure
(
def_id
,
_
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录