Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
86e7b5c1
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,发现更多精彩内容 >>
提交
86e7b5c1
编写于
12月 06, 2017
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use `-Znll -Zborrowck=mir -Zverbose` consistently
上级
75cf4826
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
28 deletion
+9
-28
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
...e-requirements/region-lbr-anon-does-not-outlive-static.rs
+2
-3
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.stderr
...quirements/region-lbr-anon-does-not-outlive-static.stderr
+2
-20
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs
...-requirements/region-lbr-named-does-not-outlive-static.rs
+2
-2
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr
...uirements/region-lbr-named-does-not-outlive-static.stderr
+1
-1
src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
...closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
+1
-1
src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs
...ts/region-lbr1-does-outlive-lbr2-because-implied-bound.rs
+1
-1
未找到文件。
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
浏览文件 @
86e7b5c1
...
@@ -13,13 +13,12 @@
...
@@ -13,13 +13,12 @@
// a variety of errors from the older, AST-based machinery (notably
// a variety of errors from the older, AST-based machinery (notably
// borrowck), and then we get the NLL error at the end.
// borrowck), and then we get the NLL error at the end.
// compile-flags:-Znll
// compile-flags:-Znll
-Zborrowck=mir -Zverbose
fn
foo
(
x
:
&
u32
)
->
&
'static
u32
{
fn
foo
(
x
:
&
u32
)
->
&
'static
u32
{
&*
x
&*
x
//~^ WARN not reporting region error due to -Znll
//~^ WARN not reporting region error due to -Znll
//~| ERROR `*x` does not live long enough
//~| ERROR free region `'_#1r` does not outlive free region `ReStatic`
//~| ERROR free region `'_#1r` does not outlive free region `'static`
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.stderr
浏览文件 @
86e7b5c1
...
@@ -4,29 +4,11 @@ warning: not reporting region error due to -Znll
...
@@ -4,29 +4,11 @@ warning: not reporting region error due to -Znll
19 | &*x
19 | &*x
| ^^^
| ^^^
error[E0597]: `*x` does not live long enough
error: free region `'_#1r` does not outlive free region `ReStatic`
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:6
|
19 | &*x
| ^^ does not live long enough
|
= note: borrowed value must be valid for the static lifetime...
note: ...but borrowed value is only valid for the anonymous lifetime #1 defined on the function body at 18:1
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:18:1
|
18 | / fn foo(x: &u32) -> &'static u32 {
19 | | &*x
20 | | //~^ WARN not reporting region error due to -Znll
21 | | //~| ERROR `*x` does not live long enough
22 | | //~| ERROR free region `'_#1r` does not outlive free region `'static`
23 | | }
| |_^
error: free region `'_#1r` does not outlive free region `'static`
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
|
|
19 | &*x
19 | &*x
| ^^^
| ^^^
error: aborting due to
2 previous errors
error: aborting due to
previous error
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs
浏览文件 @
86e7b5c1
...
@@ -13,12 +13,12 @@
...
@@ -13,12 +13,12 @@
// a variety of errors from the older, AST-based machinery (notably
// a variety of errors from the older, AST-based machinery (notably
// borrowck), and then we get the NLL error at the end.
// borrowck), and then we get the NLL error at the end.
// compile-flags:-Znll -Zborrowck=mir
// compile-flags:-Znll -Zborrowck=mir
-Zverbose
fn
foo
<
'a
>
(
x
:
&
'a
u32
)
->
&
'static
u32
{
fn
foo
<
'a
>
(
x
:
&
'a
u32
)
->
&
'static
u32
{
&*
x
&*
x
//~^ WARN not reporting region error due to -Znll
//~^ WARN not reporting region error due to -Znll
//~| ERROR free region `'_#1r` does not outlive free region `
's
tatic`
//~| ERROR free region `'_#1r` does not outlive free region `
ReS
tatic`
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.stderr
浏览文件 @
86e7b5c1
...
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
...
@@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
19 | &*x
19 | &*x
| ^^^
| ^^^
error: free region `'_#1r` does not outlive free region `
's
tatic`
error: free region `'_#1r` does not outlive free region `
ReS
tatic`
--> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
--> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
|
|
19 | &*x
19 | &*x
...
...
src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
浏览文件 @
86e7b5c1
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
// a variety of errors from the older, AST-based machinery (notably
// a variety of errors from the older, AST-based machinery (notably
// borrowck), and then we get the NLL error at the end.
// borrowck), and then we get the NLL error at the end.
// compile-flags:-Znll -Zborrowck=mir
// compile-flags:-Znll -Zborrowck=mir
-Zverbose
fn
foo
<
'a
,
'b
>
(
x
:
&
'a
u32
,
y
:
&
'b
u32
)
->
&
'b
u32
{
fn
foo
<
'a
,
'b
>
(
x
:
&
'a
u32
,
y
:
&
'b
u32
)
->
&
'b
u32
{
&*
x
&*
x
...
...
src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs
浏览文件 @
86e7b5c1
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
// Basic test for free regions in the NLL code. This test does not
// Basic test for free regions in the NLL code. This test does not
// report an error because of the (implied) bound that `'b: 'a`.
// report an error because of the (implied) bound that `'b: 'a`.
// compile-flags:-Znll
// compile-flags:-Znll
-Zborrowck=mir -Zverbose
// must-compile-successfully
// must-compile-successfully
#![allow(warnings)]
#![allow(warnings)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录