Skip to content

Commit 9694749

Browse files
committed
Revert "Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakis"
This reverts commit 6810f52, reversing changes made to 8586ec6.
1 parent 96a2298 commit 9694749

File tree

138 files changed

+753
-802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+753
-802
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# `infer_outlives_requirements`
2+
3+
The tracking issue for this feature is: [#44493]
4+
5+
[#44493]: https://github.com/rust-lang/rust/issues/44493
6+
7+
------------------------
8+
The `infer_outlives_requirements` feature indicates that certain
9+
outlives requirements can be inferred by the compiler rather than
10+
stating them explicitly.
11+
12+
For example, currently generic struct definitions that contain
13+
references, require where-clauses of the form T: 'a. By using
14+
this feature the outlives predicates will be inferred, although
15+
they may still be written explicitly.
16+
17+
```rust,ignore (pseudo-Rust)
18+
struct Foo<'a, T>
19+
where T: 'a // <-- currently required
20+
{
21+
bar: &'a T,
22+
}
23+
```
24+
25+
26+
## Examples:
27+
28+
29+
```rust,ignore (pseudo-Rust)
30+
#![feature(infer_outlives_requirements)]
31+
32+
// Implicitly infer T: 'a
33+
struct Foo<'a, T> {
34+
bar: &'a T,
35+
}
36+
```
37+
38+
```rust,ignore (pseudo-Rust)
39+
#![feature(infer_outlives_requirements)]
40+
41+
// Implicitly infer `U: 'b`
42+
struct Foo<'b, U> {
43+
bar: Bar<'b, U>
44+
}
45+
46+
struct Bar<'a, T> where T: 'a {
47+
x: &'a (),
48+
y: T,
49+
}
50+
```
51+
52+
```rust,ignore (pseudo-Rust)
53+
#![feature(infer_outlives_requirements)]
54+
55+
// Implicitly infer `b': 'a`
56+
struct Foo<'a, 'b, T> {
57+
x: &'a &'b T
58+
}
59+
```
60+
61+
```rust,ignore (pseudo-Rust)
62+
#![feature(infer_outlives_requirements)]
63+
64+
// Implicitly infer `<T as std::iter::Iterator>::Item : 'a`
65+
struct Foo<'a, T: Iterator> {
66+
bar: &'a T::Item
67+
```

src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
#![cfg_attr(not(test), feature(fn_traits))]
7878
#![cfg_attr(not(test), feature(generator_trait))]
7979
#![cfg_attr(not(stage0), feature(nll))]
80+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
8081
#![cfg_attr(test, feature(test))]
8182

8283
#![feature(allocator_api)]

src/liballoc_jemalloc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#![feature(libc)]
1818
#![feature(linkage)]
1919
#![cfg_attr(not(stage0), feature(nll))]
20+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
2021
#![feature(staged_api)]
2122
#![feature(rustc_attrs)]
2223
#![cfg_attr(dummy_jemalloc, allow(dead_code, unused_extern_crates))]

src/liballoc_system/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![feature(allocator_api)]
1919
#![feature(core_intrinsics)]
2020
#![cfg_attr(not(stage0), feature(nll))]
21+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
2122
#![feature(staged_api)]
2223
#![feature(rustc_attrs)]
2324
#![cfg_attr(any(unix, target_os = "cloudabi", target_os = "redox"), feature(libc))]

src/libarena/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#![feature(core_intrinsics)]
2828
#![feature(dropck_eyepatch)]
2929
#![cfg_attr(not(stage0), feature(nll))]
30+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
3031
#![feature(raw_vec_internals)]
3132
#![cfg_attr(test, feature(test))]
3233

src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
#![feature(link_llvm_intrinsics)]
9393
#![feature(never_type)]
9494
#![cfg_attr(not(stage0), feature(nll))]
95+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
9596
#![feature(exhaustive_patterns)]
9697
#![feature(macro_at_most_once_rep)]
9798
#![feature(no_core)]

src/libfmt_macros/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
test(attr(deny(warnings))))]
2222

2323
#![cfg_attr(not(stage0), feature(nll))]
24+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
2425

2526
pub use self::Piece::*;
2627
pub use self::Position::*;

src/libgraphviz/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
test(attr(allow(unused_variables), deny(warnings))))]
290290

291291
#![cfg_attr(not(stage0), feature(nll))]
292+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
292293
#![feature(str_escape)]
293294

294295
use self::LabelText::*;

src/libpanic_abort/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#![feature(core_intrinsics)]
2626
#![feature(libc)]
2727
#![cfg_attr(not(stage0), feature(nll))]
28+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
2829
#![feature(panic_runtime)]
2930
#![feature(staged_api)]
3031
#![feature(rustc_attrs)]

src/libpanic_unwind/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#![feature(lang_items)]
3636
#![feature(libc)]
3737
#![cfg_attr(not(stage0), feature(nll))]
38+
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
3839
#![feature(panic_unwind)]
3940
#![feature(raw)]
4041
#![feature(staged_api)]

0 commit comments

Comments
 (0)