未验证 提交 40913c60 编写于 作者: Y Yuki Okushi

Remove related tests

上级 153f01e4
// Needs an explicit where clause stating outlives condition. (RFC 2093)
// Type T needs to outlive lifetime 'static.
struct Foo<U> {
bar: Bar<U> //~ ERROR the parameter type `U` may not live long enough [E0310]
}
struct Bar<T: 'static> {
x: T,
}
fn main() { }
error[E0310]: the parameter type `U` may not live long enough
--> $DIR/feature-gate-infer_static_outlives_requirements.rs:5:10
|
LL | bar: Bar<U>
| ^^^^^^ ...so that the type `U` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> $DIR/feature-gate-infer_static_outlives_requirements.rs:7:15
|
LL | struct Bar<T: 'static> {
| ^^^^^^^
help: consider adding an explicit lifetime bound...
|
LL | struct Foo<U: 'static> {
| +++++++++
error: aborting due to previous error
For more information about this error, try `rustc --explain E0310`.
/*
* We don't infer `T: 'static` outlives relationships by default.
* Instead an additional feature gate `infer_static_outlives_requirements`
* is required.
* We don't infer `T: 'static` outlives relationships.
*/
struct Foo<U> {
......
error[E0310]: the parameter type `U` may not live long enough
--> $DIR/dont-infer-static.rs:8:10
--> $DIR/dont-infer-static.rs:6:10
|
LL | bar: Bar<U>
| ^^^^^^ ...so that the type `U` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> $DIR/dont-infer-static.rs:10:15
--> $DIR/dont-infer-static.rs:8:15
|
LL | struct Bar<T: 'static> {
| ^^^^^^^
......
#![feature(rustc_attrs)]
#![feature(infer_static_outlives_requirements)]
#[rustc_outlives]
struct Foo<U> { //~ ERROR rustc_outlives
bar: Bar<U>
}
struct Bar<T: 'static> {
x: T,
}
fn main() {}
error: rustc_outlives
--> $DIR/infer-static.rs:5:1
|
LL | / struct Foo<U> {
LL | | bar: Bar<U>
LL | | }
| |_^
|
= note: U: 'static
error: aborting due to previous error
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册