|
| 1 | +{"$message_type":"diagnostic","message":"`for<...>` binders for closures are experimental","code":{"code":"E0658","explanation":"An unstable feature was used. |
| 2 | + |
| 3 | +Erroneous code example: |
| 4 | + |
| 5 | +```compile_fail,E0658 |
| 6 | +use std::intrinsics; // error: use of unstable library feature `core_intrinsics` |
| 7 | +``` |
| 8 | + |
| 9 | +If you're using a stable or a beta version of rustc, you won't be able to use |
| 10 | +any unstable features. In order to do so, please switch to a nightly version of |
| 11 | +rustc (by using [rustup]). |
| 12 | + |
| 13 | +If you're using a nightly version of rustc, just add the corresponding feature |
| 14 | +to be able to use it: |
| 15 | + |
| 16 | +``` |
| 17 | +#![feature(core_intrinsics)] |
| 18 | + |
| 19 | +use std::intrinsics; // ok! |
| 20 | +``` |
| 21 | + |
| 22 | +[rustup]: https://rust-lang.github.io/rustup/concepts/channels.html |
| 23 | +"},"level":"error","spans":[{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":345,"byte_end":352,"line_start":10,"line_end":10,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":" let _capture = for<'a> |x: &'a i32| -> i32 { *x + y };","highlight_start":20,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider setting the binding type instead","code":null,"level":"help","spans":[{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":342,"byte_end":342,"line_start":10,"line_end":10,"column_start":17,"column_end":17,"is_primary":true,"text":[{"text":" let _capture = for<'a> |x: &'a i32| -> i32 { *x + y };","highlight_start":17,"highlight_end":17}],"label":null,"suggested_replacement":": for<'a> fn(&'a i32) -> i32","suggestion_applicability":"MaybeIncorrect","expansion":null},{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":345,"byte_end":372,"line_start":10,"line_end":10,"column_start":20,"column_end":47,"is_primary":true,"text":[{"text":" let _capture = for<'a> |x: &'a i32| -> i32 { *x + y };","highlight_start":20,"highlight_end":47}],"label":null,"suggested_replacement":"|x|","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0658]: `for<...>` binders for closures are experimental |
| 24 | + --> $DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs:10:20 |
| 25 | + | |
| 26 | +LL | let _capture = for<'a> |x: &'a i32| -> i32 { *x + y }; |
| 27 | + | ^^^^^^^ |
| 28 | + | |
| 29 | + = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information |
| 30 | + = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable |
| 31 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 32 | +help: consider setting the binding type instead |
| 33 | + | |
| 34 | +LL - let _capture = for<'a> |x: &'a i32| -> i32 { *x + y }; |
| 35 | +LL + let _capture: for<'a> fn(&'a i32) -> i32 = |x| { *x + y }; |
| 36 | + | |
| 37 | + |
| 38 | +"} |
| 39 | +{"$message_type":"diagnostic","message":"`for<...>` binders for closures are experimental","code":{"code":"E0658","explanation":"An unstable feature was used. |
| 40 | + |
| 41 | +Erroneous code example: |
| 42 | + |
| 43 | +```compile_fail,E0658 |
| 44 | +use std::intrinsics; // error: use of unstable library feature `core_intrinsics` |
| 45 | +``` |
| 46 | + |
| 47 | +If you're using a stable or a beta version of rustc, you won't be able to use |
| 48 | +any unstable features. In order to do so, please switch to a nightly version of |
| 49 | +rustc (by using [rustup]). |
| 50 | + |
| 51 | +If you're using a nightly version of rustc, just add the corresponding feature |
| 52 | +to be able to use it: |
| 53 | + |
| 54 | +``` |
| 55 | +#![feature(core_intrinsics)] |
| 56 | + |
| 57 | +use std::intrinsics; // ok! |
| 58 | +``` |
| 59 | + |
| 60 | +[rustup]: https://rust-lang.github.io/rustup/concepts/channels.html |
| 61 | +"},"level":"error","spans":[{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":496,"byte_end":503,"line_start":14,"line_end":14,"column_start":21,"column_end":28,"is_primary":true,"text":[{"text":" let _let_else = for<'a> |x: &'a i32| -> i32 {","highlight_start":21,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider setting the binding type instead","code":null,"level":"help","spans":[{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":493,"byte_end":493,"line_start":14,"line_end":14,"column_start":18,"column_end":18,"is_primary":true,"text":[{"text":" let _let_else = for<'a> |x: &'a i32| -> i32 {","highlight_start":18,"highlight_end":18}],"label":null,"suggested_replacement":": for<'a> fn(&'a i32) -> i32","suggestion_applicability":"MaybeIncorrect","expansion":null},{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":496,"byte_end":523,"line_start":14,"line_end":14,"column_start":21,"column_end":48,"is_primary":true,"text":[{"text":" let _let_else = for<'a> |x: &'a i32| -> i32 {","highlight_start":21,"highlight_end":48}],"label":null,"suggested_replacement":"|x|","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0658]: `for<...>` binders for closures are experimental |
| 62 | + --> $DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs:14:21 |
| 63 | + | |
| 64 | +LL | let _let_else = for<'a> |x: &'a i32| -> i32 { |
| 65 | + | ^^^^^^^ |
| 66 | + | |
| 67 | + = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information |
| 68 | + = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable |
| 69 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 70 | +help: consider setting the binding type instead |
| 71 | + | |
| 72 | +LL - let _let_else = for<'a> |x: &'a i32| -> i32 { |
| 73 | +LL + let _let_else: for<'a> fn(&'a i32) -> i32 = |x| { |
| 74 | + | |
| 75 | + |
| 76 | +"} |
| 77 | +{"$message_type":"diagnostic","message":"`for<...>` binders for closures are experimental","code":{"code":"E0658","explanation":"An unstable feature was used. |
| 78 | + |
| 79 | +Erroneous code example: |
| 80 | + |
| 81 | +```compile_fail,E0658 |
| 82 | +use std::intrinsics; // error: use of unstable library feature `core_intrinsics` |
| 83 | +``` |
| 84 | + |
| 85 | +If you're using a stable or a beta version of rustc, you won't be able to use |
| 86 | +any unstable features. In order to do so, please switch to a nightly version of |
| 87 | +rustc (by using [rustup]). |
| 88 | + |
| 89 | +If you're using a nightly version of rustc, just add the corresponding feature |
| 90 | +to be able to use it: |
| 91 | + |
| 92 | +``` |
| 93 | +#![feature(core_intrinsics)] |
| 94 | + |
| 95 | +use std::intrinsics; // ok! |
| 96 | +``` |
| 97 | + |
| 98 | +[rustup]: https://rust-lang.github.io/rustup/concepts/channels.html |
| 99 | +"},"level":"error","spans":[{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":791,"byte_end":798,"line_start":24,"line_end":24,"column_start":22,"column_end":29,"is_primary":true,"text":[{"text":" let _let_chain = for<'a> |x: &'a i32| -> i32 {","highlight_start":22,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider setting the binding type instead","code":null,"level":"help","spans":[{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":788,"byte_end":788,"line_start":24,"line_end":24,"column_start":19,"column_end":19,"is_primary":true,"text":[{"text":" let _let_chain = for<'a> |x: &'a i32| -> i32 {","highlight_start":19,"highlight_end":19}],"label":null,"suggested_replacement":": for<'a> fn(&'a i32) -> i32","suggestion_applicability":"MaybeIncorrect","expansion":null},{"file_name":"$DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs","byte_start":791,"byte_end":818,"line_start":24,"line_end":24,"column_start":22,"column_end":49,"is_primary":true,"text":[{"text":" let _let_chain = for<'a> |x: &'a i32| -> i32 {","highlight_start":22,"highlight_end":49}],"label":null,"suggested_replacement":"|x|","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0658]: `for<...>` binders for closures are experimental |
| 100 | + --> $DIR/feature-gate-closure_lifetime_binder-maybe-incorrect.rs:24:22 |
| 101 | + | |
| 102 | +LL | let _let_chain = for<'a> |x: &'a i32| -> i32 { |
| 103 | + | ^^^^^^^ |
| 104 | + | |
| 105 | + = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information |
| 106 | + = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable |
| 107 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 108 | +help: consider setting the binding type instead |
| 109 | + | |
| 110 | +LL - let _let_chain = for<'a> |x: &'a i32| -> i32 { |
| 111 | +LL + let _let_chain: for<'a> fn(&'a i32) -> i32 = |x| { |
| 112 | + | |
| 113 | + |
| 114 | +"} |
| 115 | +{"$message_type":"diagnostic","message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors |
| 116 | + |
| 117 | +"} |
| 118 | +{"$message_type":"diagnostic","message":"For more information about this error, try `rustc --explain E0658`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0658`. |
| 119 | +"} |
0 commit comments