Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
140e2d3a
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,发现更多精彩内容 >>
提交
140e2d3a
编写于
9月 20, 2015
作者:
L
Lee Jeffery
提交者:
Eljay
9月 20, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Miscellaneous cleanup for old issues.
上级
fd38a750
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
44 addition
and
108 deletion
+44
-108
src/libcollectionstest/btree/set.rs
src/libcollectionstest/btree/set.rs
+3
-9
src/libcoretest/cell.rs
src/libcoretest/cell.rs
+11
-12
src/librustc/lint/mod.rs
src/librustc/lint/mod.rs
+0
-1
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+1
-1
src/libserialize/json.rs
src/libserialize/json.rs
+3
-6
src/libstd/sync/mutex.rs
src/libstd/sync/mutex.rs
+11
-12
src/libstd/sync/rwlock.rs
src/libstd/sync/rwlock.rs
+11
-12
src/libstd/sys/common/wtf8.rs
src/libstd/sys/common/wtf8.rs
+1
-31
src/rustbook/main.rs
src/rustbook/main.rs
+0
-1
src/test/bench/core-map.rs
src/test/bench/core-map.rs
+2
-4
src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs
...compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs
+0
-3
src/test/compile-fail/feature-gated-feature-in-macro-arg.rs
src/test/compile-fail/feature-gated-feature-in-macro-arg.rs
+0
-8
src/test/run-pass/issue-5060.rs
src/test/run-pass/issue-5060.rs
+1
-2
src/test/run-pass/lambda-var-hygiene.rs
src/test/run-pass/lambda-var-hygiene.rs
+0
-2
src/test/rustdoc/hidden-line.rs
src/test/rustdoc/hidden-line.rs
+0
-4
未找到文件。
src/libcollectionstest/btree/set.rs
浏览文件 @
140e2d3a
...
...
@@ -148,15 +148,9 @@ fn test_zip() {
let
y
=
y
;
let
mut
z
=
x
.iter
()
.zip
(
&
y
);
// FIXME: #5801: this needs a type hint to compile...
let
result
:
Option
<
(
&
usize
,
&
&
'static
str
)
>
=
z
.next
();
assert_eq!
(
result
.unwrap
(),
(
&
5
,
&
(
"bar"
)));
let
result
:
Option
<
(
&
usize
,
&
&
'static
str
)
>
=
z
.next
();
assert_eq!
(
result
.unwrap
(),
(
&
11
,
&
(
"foo"
)));
let
result
:
Option
<
(
&
usize
,
&
&
'static
str
)
>
=
z
.next
();
assert
!
(
result
.is_none
());
assert_eq!
(
z
.next
()
.unwrap
(),
(
&
5
,
&
(
"bar"
)));
assert_eq!
(
z
.next
()
.unwrap
(),
(
&
11
,
&
(
"foo"
)));
assert
!
(
z
.next
()
.is_none
());
}
#[test]
...
...
src/libcoretest/cell.rs
浏览文件 @
140e2d3a
...
...
@@ -248,15 +248,14 @@ fn unsafe_cell_unsized() {
assert_eq!
(
unsafe
{
&
mut
*
cell
.get
()
},
comp
);
}
// FIXME(#25351) needs deeply nested coercions of DST structs.
// #[test]
// fn refcell_unsized() {
// let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
// {
// let b = &mut *cell.borrow_mut();
// b[0] = 4;
// b[2] = 5;
// }
// let comp: &mut [i32] = &mut [4, 2, 5];
// assert_eq!(&*cell.borrow(), comp);
// }
#[test]
fn
refcell_unsized
()
{
let
cell
:
&
RefCell
<
[
i32
]
>
=
&
RefCell
::
new
([
1
,
2
,
3
]);
{
let
b
=
&
mut
*
cell
.borrow_mut
();
b
[
0
]
=
4
;
b
[
2
]
=
5
;
}
let
comp
:
&
mut
[
i32
]
=
&
mut
[
4
,
2
,
5
];
assert_eq!
(
&*
cell
.borrow
(),
comp
);
}
src/librustc/lint/mod.rs
浏览文件 @
140e2d3a
...
...
@@ -89,7 +89,6 @@ pub fn name_lower(&self) -> String {
/// Declare a static item of type `&'static Lint`.
#[macro_export]
macro_rules!
declare_lint
{
// FIXME(#14660): deduplicate
(
pub
$name:ident
,
$level:ident
,
$desc:expr
)
=>
(
pub
static
$name
:
&
'static
::
rustc
::
lint
::
Lint
=
&
lint_initializer!
(
$name
,
$level
,
$desc
);
...
...
src/librustdoc/lib.rs
浏览文件 @
140e2d3a
...
...
@@ -211,7 +211,7 @@ pub fn main_args(args: &[String]) -> isize {
for
&
(
name
,
_
,
description
)
in
PASSES
{
println!
(
"{:>20} - {}"
,
name
,
description
);
}
println!
(
"
{}"
,
"
\n
Default passes for rustdoc:"
);
// FIXME: #9970
println!
(
"
\n
Default passes for rustdoc:"
);
for
&
name
in
DEFAULT_PASSES
{
println!
(
"{:>20}"
,
name
);
}
...
...
src/libserialize/json.rs
浏览文件 @
140e2d3a
...
...
@@ -76,8 +76,7 @@
//! Create a struct called `TestStruct` and serialize and deserialize it to and from JSON using the
//! serialization API, using the derived serialization code.
//!
//! ```notrust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! ```rust
//! extern crate serialize;
//! use serialize::json;
//!
...
...
@@ -111,8 +110,7 @@
//!
//! ### Simple example of `ToJson` usage
//!
//! ```notrust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! ```rust
//! extern crate serialize;
//! use serialize::json::{self, ToJson, Json};
//!
...
...
@@ -151,8 +149,7 @@
//!
//! ### Verbose example of `ToJson` usage
//!
//! ```notrust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! ```rust
//! extern crate serialize;
//! use std::collections::BTreeMap;
//! use serialize::json::{self, Json, ToJson};
...
...
src/libstd/sync/mutex.rs
浏览文件 @
140e2d3a
...
...
@@ -536,16 +536,15 @@ fn drop(&mut self) {
assert_eq!
(
*
lock
,
2
);
}
// FIXME(#25351) needs deeply nested coercions of DST structs.
// #[test]
// fn test_mutex_unsized() {
// let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]);
// {
// let b = &mut *mutex.lock().unwrap();
// b[0] = 4;
// b[2] = 5;
// }
// let comp: &[i32] = &[4, 2, 5];
// assert_eq!(&*mutex.lock().unwrap(), comp);
// }
#[test]
fn
test_mutex_unsized
()
{
let
mutex
:
&
Mutex
<
[
i32
]
>
=
&
Mutex
::
new
([
1
,
2
,
3
]);
{
let
b
=
&
mut
*
mutex
.lock
()
.unwrap
();
b
[
0
]
=
4
;
b
[
2
]
=
5
;
}
let
comp
:
&
[
i32
]
=
&
[
4
,
2
,
5
];
assert_eq!
(
&*
mutex
.lock
()
.unwrap
(),
comp
);
}
}
src/libstd/sync/rwlock.rs
浏览文件 @
140e2d3a
...
...
@@ -578,18 +578,17 @@ fn drop(&mut self) {
assert_eq!
(
*
lock
,
2
);
}
// FIXME(#25351) needs deeply nested coercions of DST structs.
// #[test]
// fn test_rwlock_unsized() {
// let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]);
// {
// let b = &mut *rw.write().unwrap();
// b[0] = 4;
// b[2] = 5;
// }
// let comp: &[i32] = &[4, 2, 5];
// assert_eq!(&*rw.read().unwrap(), comp);
// }
#[test]
fn
test_rwlock_unsized
()
{
let
rw
:
&
RwLock
<
[
i32
]
>
=
&
RwLock
::
new
([
1
,
2
,
3
]);
{
let
b
=
&
mut
*
rw
.write
()
.unwrap
();
b
[
0
]
=
4
;
b
[
2
]
=
5
;
}
let
comp
:
&
[
i32
]
=
&
[
4
,
2
,
5
];
assert_eq!
(
&*
rw
.read
()
.unwrap
(),
comp
);
}
#[test]
fn
test_rwlock_try_write
()
{
...
...
src/libstd/sys/common/wtf8.rs
浏览文件 @
140e2d3a
...
...
@@ -31,7 +31,6 @@
use
ascii
::
*
;
use
borrow
::
Cow
;
use
char
;
use
cmp
;
use
fmt
;
use
hash
::{
Hash
,
Hasher
};
use
iter
::
FromIterator
;
...
...
@@ -375,6 +374,7 @@ fn extend<T: IntoIterator<Item=CodePoint>>(&mut self, iterable: T) {
///
/// Similar to `&str`, but can additionally contain surrogate code points
/// if they’re not in a surrogate pair.
#[derive(Eq,
Ord,
PartialEq,
PartialOrd)]
pub
struct
Wtf8
{
bytes
:
[
u8
]
}
...
...
@@ -383,36 +383,6 @@ impl AsInner<[u8]> for Wtf8 {
fn
as_inner
(
&
self
)
->
&
[
u8
]
{
&
self
.bytes
}
}
// FIXME: https://github.com/rust-lang/rust/issues/18805
impl
PartialEq
for
Wtf8
{
fn
eq
(
&
self
,
other
:
&
Wtf8
)
->
bool
{
self
.bytes
.eq
(
&
other
.bytes
)
}
}
// FIXME: https://github.com/rust-lang/rust/issues/18805
impl
Eq
for
Wtf8
{}
// FIXME: https://github.com/rust-lang/rust/issues/18738
impl
PartialOrd
for
Wtf8
{
#[inline]
fn
partial_cmp
(
&
self
,
other
:
&
Wtf8
)
->
Option
<
cmp
::
Ordering
>
{
self
.bytes
.partial_cmp
(
&
other
.bytes
)
}
#[inline]
fn
lt
(
&
self
,
other
:
&
Wtf8
)
->
bool
{
self
.bytes
.lt
(
&
other
.bytes
)
}
#[inline]
fn
le
(
&
self
,
other
:
&
Wtf8
)
->
bool
{
self
.bytes
.le
(
&
other
.bytes
)
}
#[inline]
fn
gt
(
&
self
,
other
:
&
Wtf8
)
->
bool
{
self
.bytes
.gt
(
&
other
.bytes
)
}
#[inline]
fn
ge
(
&
self
,
other
:
&
Wtf8
)
->
bool
{
self
.bytes
.ge
(
&
other
.bytes
)
}
}
// FIXME: https://github.com/rust-lang/rust/issues/18738
impl
Ord
for
Wtf8
{
#[inline]
fn
cmp
(
&
self
,
other
:
&
Wtf8
)
->
cmp
::
Ordering
{
self
.bytes
.cmp
(
&
other
.bytes
)
}
}
/// Format the slice with double quotes,
/// and surrogates as `\u` followed by four hexadecimal digits.
/// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800]
...
...
src/rustbook/main.rs
浏览文件 @
140e2d3a
...
...
@@ -39,7 +39,6 @@
static
EXIT_STATUS
:
AtomicIsize
=
ATOMIC_ISIZE_INIT
;
#[cfg(not(test))]
// thanks #12327
fn
main
()
{
let
mut
term
=
Term
::
new
();
let
cmd
:
Vec
<
_
>
=
env
::
args
()
.collect
();
...
...
src/test/bench/core-map.rs
浏览文件 @
140e2d3a
...
...
@@ -126,8 +126,7 @@ fn main() {
println!
(
"{} keys"
,
n_keys
);
// FIXME: #9970
println!
(
"{}"
,
"
\n
BTreeMap:"
);
println!
(
"
\n
BTreeMap:"
);
{
let
mut
map
:
BTreeMap
<
usize
,
usize
>
=
BTreeMap
::
new
();
...
...
@@ -145,8 +144,7 @@ fn main() {
vector
(
&
mut
map
,
n_keys
,
&
rand
);
}
// FIXME: #9970
println!
(
"{}"
,
"
\n
HashMap:"
);
println!
(
"
\n
HashMap:"
);
{
let
mut
map
:
HashMap
<
usize
,
usize
>
=
HashMap
::
new
();
...
...
src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs
浏览文件 @
140e2d3a
...
...
@@ -111,12 +111,9 @@ fn assign_field4<'a>(x: &'a mut Own<Point>) {
x
.y
=
3
;
//~ ERROR cannot borrow
}
// FIXME(eddyb) #12825 This shouldn't attempt to call deref_mut.
/*
fn
deref_imm_method
(
x
:
Own
<
Point
>
)
{
let
__
isize
=
x
.get
();
}
*/
fn
deref_mut_method1
(
x
:
Own
<
Point
>
)
{
x
.set
(
0
,
0
);
//~ ERROR cannot borrow
...
...
src/test/compile-fail/feature-gated-feature-in-macro-arg.rs
浏览文件 @
140e2d3a
...
...
@@ -8,14 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// FIXME #20661: format_args! emits calls to the unstable std::fmt::rt
// module, so the compiler has some hacks to make that possible
// (in span_is_internal). Unnfortunately those hacks defeat this
// particular scenario of checking feature gates in arguments to
// println!().
// ignore-test
// tests that input to a macro is checked for use of gated features. If this
// test succeeds due to the acceptance of a feature, pick a new feature to
// test. Not ideal, but oh well :(
...
...
src/test/run-pass/issue-5060.rs
浏览文件 @
140e2d3a
...
...
@@ -16,8 +16,7 @@
print!
(
"{}"
,
stringify!
(
$field_tl
));
print!
(
", "
);
)
+
// FIXME: #9970
print!
(
"{}"
,
"]
\n
"
);
print!
(
"]
\n
"
);
})
}
...
...
src/test/run-pass/lambda-var-hygiene.rs
浏览文件 @
140e2d3a
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-test #9383
// shouldn't affect evaluation of $ex:
macro_rules!
bad_macro
{
(
$ex:expr
)
=>
({(|
_
x
|
{
$ex
})
(
9
)
})
...
...
src/test/rustdoc/hidden-line.rs
浏览文件 @
140e2d3a
...
...
@@ -12,8 +12,6 @@
/// retained.
///
/// ```rust
/// mod to_make_deriving_work { // FIXME #4913
///
/// # #[derive(PartialEq)] // invisible
/// # struct Foo; // invisible
///
...
...
@@ -24,8 +22,6 @@
/// let x = Bar(Foo);
/// assert_eq!(x, x); // check that the derivings worked
/// }
///
/// }
/// ```
pub
fn
foo
()
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录