Skip to content

Commit 03707aa

Browse files
committed
add field_projections feature gate
1 parent 95d2452 commit 03707aa

File tree

7 files changed

+26
-0
lines changed

7 files changed

+26
-0
lines changed

compiler/rustc_feature/src/unstable.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ declare_features! (
504504
(unstable, ffi_const, "1.45.0", Some(58328)),
505505
/// Allows the use of `#[ffi_pure]` on foreign functions.
506506
(unstable, ffi_pure, "1.45.0", Some(58329)),
507+
/// Experimental field projections.
508+
(incomplete, field_projections, "CURRENT_RUSTC_VERSION", Some(145383)),
507509
/// Controlling the behavior of fmt::Debug
508510
(unstable, fmt_debug, "1.82.0", Some(129709)),
509511
/// Allows using `#[align(...)]` on function items

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ symbols! {
10351035
ffi_returns_twice,
10361036
field,
10371037
field_init_shorthand,
1038+
field_projections,
10381039
file,
10391040
file_options,
10401041
flags,

library/core/src/field.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! Field Reflection

library/core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ pub mod bstr;
339339
pub mod cell;
340340
pub mod char;
341341
pub mod ffi;
342+
#[unstable(feature = "field_projections", issue = "145383")]
343+
pub mod field;
342344
#[unstable(feature = "core_io_borrowed_buf", issue = "117693")]
343345
pub mod io;
344346
pub mod iter;

library/std/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ pub use core::cmp;
508508
pub use core::convert;
509509
#[stable(feature = "rust1", since = "1.0.0")]
510510
pub use core::default;
511+
#[unstable(feature = "field_projections", issue = "145383")]
512+
pub use core::field;
511513
#[stable(feature = "futures_api", since = "1.36.0")]
512514
pub use core::future;
513515
#[stable(feature = "core_hint", since = "1.27.0")]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![allow(dead_code)]
2+
3+
use std::field; //~ ERROR: use of unstable library feature `field_projections`
4+
5+
fn main() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0658]: use of unstable library feature `field_projections`
2+
--> $DIR/feature-gate-field-projections.rs:3:5
3+
|
4+
LL | use std::field;
5+
| ^^^^^^^^^^
6+
|
7+
= note: see issue #145383 <https://github.com/rust-lang/rust/issues/145383> for more information
8+
= help: add `#![feature(field_projections)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error: aborting due to 1 previous error
12+
13+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)