Skip to content

Commit 346cd48

Browse files
Move feature docs to lib.rs and improve them
1 parent ac0cb85 commit 346cd48

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ embedded-hal = "0.2.4"
2424
[features]
2525
cm7-r0p1 = []
2626
inline-asm = []
27-
28-
# Link against prebuilt assembly blobs that are compatible with Linker-Plugin LTO.
29-
# When using this feature, you *must* pass `-Clinker-plugin-lto` to rustc. See this link for
30-
# details:
31-
# https://doc.rust-lang.org/stable/rustc/linker-plugin-lto.html
3227
linker-plugin-lto = []
3328

3429
[workspace]

src/lib.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,32 @@
2424
//!
2525
//! The disadvantage is that `inline-asm` requires a nightly toolchain.
2626
//!
27+
//! ## `cm7-r0p1`
28+
//!
29+
//! This feature enables workarounds for errata found on Cortex-M7 chips with revision r0p1. Some
30+
//! functions in this crate only work correctly on those chips if this Cargo feature is enabled
31+
//! (the functions are documented accordingly).
32+
//!
33+
//! ## `linker-plugin-lto`
34+
//!
35+
//! This feature links against prebuilt assembly blobs that are compatible with [Linker-Plugin LTO].
36+
//! This allows inlining assembly routines into the caller, even without the `inline-asm` feature,
37+
//! and works on stable Rust (but note the drawbacks below!).
38+
//!
39+
//! If you want to use this feature, you need to be aware of a few things:
40+
//!
41+
//! - You need to make sure that `-Clinker-plugin-lto` is passed to rustc. Please refer to the
42+
//! [Linker-Plugin LTO] documentation for details.
43+
//!
44+
//! - You have to use a Rust version whose LLVM version is compatible with the toolchain in
45+
//! `asm-toolchain`.
46+
//!
47+
//! - Due to a [Rust bug][rust-lang/rust#75940], this option does not work with optimization
48+
//! levels `s` and `z`.
49+
//!
50+
//! [Linker-Plugin LTO]: https://doc.rust-lang.org/stable/rustc/linker-plugin-lto.html
51+
//! [rust-lang/rust#75940]: https://github.com/rust-lang/rust/issues/75940
52+
//!
2753
//! # Minimum Supported Rust Version (MSRV)
2854
//!
2955
//! This crate is guaranteed to compile on stable Rust 1.31 and up. It *might*

0 commit comments

Comments
 (0)