fork/rust
git clone https://git.julia.blue/fork/rust
4fb7144ed15
1.43.0
1note: external requirements 2 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 3 | 4LL | with_signature(a, b, |x, y| { 5 | __________________________^ 6LL | | 7LL | | // 8LL | | // See `correct_region`, which explains the point of this 9... | 10LL | | require(&x, &y) 11LL | | }) 12 | |_____^ 13 | 14 = note: defining type: no_region::<T>::{{closure}}#0 with closure substs [ 15 i32, 16 extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)), 17 ] 18 = note: late-bound region is '_#2r 19 = note: number of external vids: 3 20 = note: where T: '_#1r 21 22note: no external requirements 23 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1 24 | 25LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { 26LL | | with_signature(a, b, |x, y| { 27LL | | 28LL | | // 29... | 30LL | | }) 31LL | | } 32 | |_^ 33 | 34 = note: defining type: no_region::<T> 35 36error[E0309]: the parameter type `T` may not live long enough 37 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 38 | 39LL | with_signature(a, b, |x, y| { 40 | __________________________^ 41LL | | 42LL | | // 43LL | | // See `correct_region`, which explains the point of this 44... | 45LL | | require(&x, &y) 46LL | | }) 47 | |_____^ 48 | 49 = help: consider adding an explicit lifetime bound `T: 'a`... 50 51note: external requirements 52 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26 53 | 54LL | with_signature(a, b, |x, y| { 55 | __________________________^ 56LL | | // Key point of this test: 57LL | | // 58LL | | // The *closure* is being type-checked with all of its free 59... | 60LL | | require(&x, &y) 61LL | | }) 62 | |_____^ 63 | 64 = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure substs [ 65 i32, 66 extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), 67 ] 68 = note: number of external vids: 3 69 = note: where T: '_#2r 70 71note: no external requirements 72 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:39:1 73 | 74LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T) 75LL | | where 76LL | | T: 'a, 77LL | | { 78... | 79LL | | }) 80LL | | } 81 | |_^ 82 | 83 = note: defining type: correct_region::<'_#1r, T> 84 85note: external requirements 86 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 87 | 88LL | with_signature(a, b, |x, y| { 89 | __________________________^ 90LL | | 91LL | | // See `correct_region` 92LL | | require(&x, &y) 93LL | | }) 94 | |_____^ 95 | 96 = note: defining type: wrong_region::<'_#1r, T>::{{closure}}#0 with closure substs [ 97 i32, 98 extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), 99 ] 100 = note: late-bound region is '_#3r 101 = note: number of external vids: 4 102 = note: where T: '_#2r 103 104note: no external requirements 105 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:60:1 106 | 107LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) 108LL | | where 109LL | | T: 'b, 110LL | | { 111... | 112LL | | }) 113LL | | } 114 | |_^ 115 | 116 = note: defining type: wrong_region::<'_#1r, T> 117 118error[E0309]: the parameter type `T` may not live long enough 119 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 120 | 121LL | with_signature(a, b, |x, y| { 122 | __________________________^ 123LL | | 124LL | | // See `correct_region` 125LL | | require(&x, &y) 126LL | | }) 127 | |_____^ 128 | 129 = help: consider adding an explicit lifetime bound `T: 'a`... 130 131note: external requirements 132 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26 133 | 134LL | with_signature(a, b, |x, y| { 135 | __________________________^ 136LL | | // See `correct_region` 137LL | | require(&x, &y) 138LL | | }) 139 | |_____^ 140 | 141 = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ 142 i32, 143 extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), 144 ] 145 = note: number of external vids: 4 146 = note: where T: '_#3r 147 148note: no external requirements 149 --> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1 150 | 151LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) 152LL | | where 153LL | | T: 'b, 154LL | | 'b: 'a, 155... | 156LL | | }) 157LL | | } 158 | |_^ 159 | 160 = note: defining type: outlives_region::<'_#1r, '_#2r, T> 161 162error: aborting due to 2 previous errors 163 164For more information about this error, try `rustc --explain E0309`.