fN::BITS constants for feature float_bits_const Also enables the feature for compiler_builtins as otherwise this causes a warning and conflicts with the Float extension trait. --- Implementation for rust-lang/rust#151073 Feature flag: `#![feature(float_bits_const)]` Note that this is likely to conflict with some extension traits, as it has with compiler builtins. However, assuming correct values for the constants, they are either `u32`, the same type, which should not cause a problem (as shown by enabling the feature for compiler_builtins), or a different type (e.g. `usize`), which should cause a compiler error. Either way this should never change behaviour unless the extension trait implemented an incorrect value. Also note that it doesn't seem to be possible to put multiple unstable attributes on an item, so `f128::BITS` and `f16::BITS` are gated behind the feature flags for those primitives, rather than `#![feature(float_bits_const)]` |
||
|---|---|---|
| .. | ||
| .github/workflows | ||
| builtins-shim | ||
| builtins-test | ||
| builtins-test-intrinsics | ||
| ci | ||
| compiler-builtins | ||
| crates | ||
| etc | ||
| libm | ||
| libm-test | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitignore | ||
| .rustfmt.toml | ||
| Cargo.toml | ||
| CONTRIBUTING.md | ||
| josh-sync.toml | ||
| LICENSE.txt | ||
| PUBLISHING.md | ||
| README.md | ||
| rust-version | ||
| triagebot.toml | ||
compiler-builtins and libm
This repository contains two main crates:
compiler-builtins: symbols that the compiler expects to be available at link timelibm: a Rust implementation of C math libraries, used to provide implementations incore.
More details are at compiler-builtins/README.md and libm/README.md.
For instructions on contributing, see CONTRIBUTING.md.
License
libmmay be used under the MIT Licensecompiler-builtinsmay be used under the MIT License and the Apache License, Version 2.0 with the LLVM exception.- All original contributions must be under all of: the MIT license, the Apache-2.0 license, and the Apache-2.0 license with the LLVM exception.
More details are in LICENSE.txt and libm/LICENSE.txt.