-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes related tests and documentation pages.
- Loading branch information
Showing
8 changed files
with
230 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# `f128` | ||
|
||
The tracking issue for this feature is: [#116909] | ||
|
||
[#116909]: https://github.com/rust-lang/rust/issues/116909 | ||
|
||
--- | ||
|
||
Enable the `f128` type for IEEE 128-bit floating numbers (quad precision). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# `f16` | ||
|
||
The tracking issue for this feature is: [#116909] | ||
|
||
[#116909]: https://github.com/rust-lang/rust/issues/116909 | ||
|
||
--- | ||
|
||
Enable the `f16` type for IEEE 16-bit floating numbers (half precision). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#![allow(unused)] | ||
|
||
// ensure gating for primitive use | ||
mod m1 { | ||
const A: f128 = 10.0; //~ ERROR the feature `f128` is unstable | ||
|
||
pub fn main() { | ||
let a: f128 = 100.0; //~ ERROR the feature `f128` is unstable | ||
let b = 0.0f128; //~ ERROR the feature `f128` is unstable | ||
foo(1.23); | ||
} | ||
|
||
fn foo(a: f128) {} //~ ERROR the feature `f128` is unstable | ||
|
||
struct Bar { | ||
a: f128, //~ ERROR the feature `f128` is unstable | ||
} | ||
} | ||
|
||
// ensure we don't restrict name as an identifier or custom types | ||
mod mod1 { | ||
#[allow(non_camel_case_types)] | ||
struct f128 { | ||
a: i32, | ||
} | ||
|
||
fn foo() { | ||
let f128 = (); | ||
} | ||
|
||
fn bar(a: f128) -> i32 { | ||
a.a | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error[E0658]: the feature `f128` is unstable | ||
--> $DIR/feature-gate-f128.rs:5:14 | ||
| | ||
LL | const A: f128 = 10.0; | ||
| ^^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: the feature `f128` is unstable | ||
--> $DIR/feature-gate-f128.rs:13:15 | ||
| | ||
LL | fn foo(a: f128) {} | ||
| ^^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: the feature `f128` is unstable | ||
--> $DIR/feature-gate-f128.rs:16:12 | ||
| | ||
LL | a: f128, | ||
| ^^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: the feature `f128` is unstable | ||
--> $DIR/feature-gate-f128.rs:8:16 | ||
| | ||
LL | let a: f128 = 100.0; | ||
| ^^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#![allow(unused)] | ||
|
||
// ensure gating for primitive use | ||
mod m1 { | ||
const A: f16 = 10.0; //~ ERROR the feature `f16` is unstable | ||
|
||
pub fn main() { | ||
let a: f16 = 100.0; //~ ERROR the feature `f16` is unstable | ||
let b = 0.0f16; //~ ERROR the feature `f16` is unstable | ||
foo(1.23); | ||
} | ||
|
||
fn foo(a: f16) {} //~ ERROR the feature `f16` is unstable | ||
|
||
struct Bar { | ||
a: f16, //~ ERROR the feature `f16` is unstable | ||
} | ||
} | ||
|
||
// ensure we don't restrict name as an identifier or custom types | ||
mod m2 { | ||
#[allow(non_camel_case_types)] | ||
struct f16 { | ||
a: i32, | ||
} | ||
|
||
fn foo() { | ||
let f16 = (); | ||
} | ||
|
||
fn bar(a: f16) -> i32 { | ||
a.a | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error[E0658]: the feature `f16` is unstable | ||
--> $DIR/feature-gate-f16.rs:5:14 | ||
| | ||
LL | const A: f16 = 10.0; | ||
| ^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: the feature `f16` is unstable | ||
--> $DIR/feature-gate-f16.rs:13:15 | ||
| | ||
LL | fn foo(a: f16) {} | ||
| ^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: the feature `f16` is unstable | ||
--> $DIR/feature-gate-f16.rs:16:12 | ||
| | ||
LL | a: f16, | ||
| ^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: the feature `f16` is unstable | ||
--> $DIR/feature-gate-f16.rs:8:16 | ||
| | ||
LL | let a: f16 = 100.0; | ||
| ^^^ | ||
| | ||
= note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information | ||
= help: add `#![feature(f16)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |