mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
some comment about not infering static lifetimes test
This commit is contained in:
parent
44df36567b
commit
429ae93c09
@ -12,8 +12,14 @@
|
||||
|
||||
#![feature(infer_outlives_requirements)]
|
||||
|
||||
/*
|
||||
* We don't infer `T: 'static` outlives relationships by default.
|
||||
* Instead an additional feature gate `infer_static_outlives_requirements`
|
||||
* is required.
|
||||
*/
|
||||
|
||||
struct Foo<U> {
|
||||
bar: Bar<U> //~ ERROR 16:5: 16:16: the parameter type `U` may not live long enough [E0310]
|
||||
bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
|
||||
}
|
||||
struct Bar<T: 'static> {
|
||||
x: T,
|
||||
|
Loading…
Reference in New Issue
Block a user