Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6842316f
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,发现更多精彩内容 >>
提交
6842316f
编写于
7月 14, 2019
作者:
L
Lzu Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow deprecated try macro in test crates
上级
90fa7901
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
10 deletion
+13
-10
src/test/ui/associated-types/cache/chrono-scan.rs
src/test/ui/associated-types/cache/chrono-scan.rs
+3
-1
src/test/ui/derived-errors/issue-31997.rs
src/test/ui/derived-errors/issue-31997.rs
+2
-1
src/test/ui/derived-errors/issue-31997.stderr
src/test/ui/derived-errors/issue-31997.stderr
+3
-3
src/test/ui/lint/lint-qualification.rs
src/test/ui/lint/lint-qualification.rs
+2
-1
src/test/ui/lint/lint-qualification.stderr
src/test/ui/lint/lint-qualification.stderr
+1
-1
src/test/ui/macros/macro-comma-support-rpass.rs
src/test/ui/macros/macro-comma-support-rpass.rs
+1
-2
src/test/ui/macros/try-macro.rs
src/test/ui/macros/try-macro.rs
+1
-1
未找到文件。
src/test/ui/associated-types/cache/chrono-scan.rs
浏览文件 @
6842316f
// check-pass
#![allow(deprecated)]
pub
type
ParseResult
<
T
>
=
Result
<
T
,
()
>
;
pub
enum
Item
<
'a
>
{
...
...
@@ -18,7 +20,7 @@ pub fn timezone_offset_zulu<F>(s: &str, colon: F) -> ParseResult<(&str, i32)>
pub
fn
parse
<
'a
,
I
>
(
mut
s
:
&
str
,
items
:
I
)
->
ParseResult
<
()
>
where
I
:
Iterator
<
Item
=
Item
<
'a
>>
{
macro_rules!
try_consume
{
(
$e:expr
)
=>
({
let
(
s_
,
v
)
=
$e
?
;
s
=
s_
;
v
})
(
$e:expr
)
=>
({
let
(
s_
,
v
)
=
try!
(
$e
)
;
s
=
s_
;
v
})
}
let
offset
=
try_consume!
(
timezone_offset_zulu
(
s
.trim_start
(),
colon_or_space
));
let
offset
=
try_consume!
(
timezone_offset_zulu
(
s
.trim_start
(),
colon_or_space
));
...
...
src/test/ui/derived-errors/issue-31997.rs
浏览文件 @
6842316f
// Test that the resolve failure does not lead to downstream type errors.
// See issue #31997.
#![allow(deprecated)]
trait
TheTrait
{
}
...
...
@@ -10,7 +11,7 @@ fn closure<F, T>(x: F) -> Result<T, ()>
}
fn
foo
()
->
Result
<
(),
()
>
{
closure
(||
bar
(
core
::
ptr
::
null_mut
()))
?
;
//~ ERROR cannot find function `bar` in this scope
try!
(
closure
(||
bar
(
core
::
ptr
::
null_mut
())))
;
//~ ERROR cannot find function `bar` in this scope
Ok
(())
}
...
...
src/test/ui/derived-errors/issue-31997.stderr
浏览文件 @
6842316f
error[E0425]: cannot find function `bar` in this scope
--> $DIR/issue-31997.rs:1
3:16
--> $DIR/issue-31997.rs:1
4:21
|
LL |
closure(|| bar(core::ptr::null_mut()))?
;
| ^^^ not found in this scope
LL |
try!(closure(|| bar(core::ptr::null_mut())))
;
|
^^^ not found in this scope
error: aborting due to previous error
...
...
src/test/ui/lint/lint-qualification.rs
浏览文件 @
6842316f
#![deny(unused_qualifications)]
#[allow(deprecated)]
mod
foo
{
pub
fn
bar
()
{}
...
...
@@ -9,7 +10,7 @@ fn main() {
foo
::
bar
();
//~ ERROR: unnecessary qualification
bar
();
let
_
=
||
->
Result
<
(),
()
>
{
Ok
(())
?
;
Ok
(())
};
// issue #37345
let
_
=
||
->
Result
<
(),
()
>
{
try!
(
Ok
(()))
;
Ok
(())
};
// issue #37345
macro_rules!
m
{
()
=>
{
$crate
::
foo
::
bar
();
// issue #37357
...
...
src/test/ui/lint/lint-qualification.stderr
浏览文件 @
6842316f
error: unnecessary qualification
--> $DIR/lint-qualification.rs:
9
:5
--> $DIR/lint-qualification.rs:
10
:5
|
LL | foo::bar();
| ^^^^^^^^
...
...
src/test/ui/macros/macro-comma-support-rpass.rs
浏览文件 @
6842316f
...
...
@@ -15,6 +15,7 @@
#![cfg_attr(core,
no_std)]
#![allow(deprecated)]
// for deprecated `try!()` macro
#![feature(concat_idents)]
#[cfg(std)]
use
std
::
fmt
;
...
...
@@ -261,9 +262,7 @@ fn thread_local() {
#[test]
fn
try
()
{
fn
inner
()
->
Result
<
(),
()
>
{
#[allow(deprecated)]
try!
(
Ok
(()));
#[allow(deprecated)]
try!
(
Ok
(()),);
Ok
(())
}
...
...
src/test/ui/macros/try-macro.rs
浏览文件 @
6842316f
// run-pass
#
[allow(deprecated)]
#
![allow(deprecated)]
// for deprecated `try!()` macro
use
std
::
num
::{
ParseFloatError
,
ParseIntError
};
fn
main
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录