Skip to content

Commit e56d4a1

Browse files
authored
Add crate version to docs.rs links used in compile_error!s (#639)
1 parent 34be1f9 commit e56d4a1

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.3.3] - UNRELEASED
8+
9+
### Changed
10+
- Doc improvements [#632] [#634] [#635]
11+
- Add crate version to docs.rs links used in `compile_error!`s [#639]
12+
13+
[#632]: https://github.com/rust-random/getrandom/pull/632
14+
[#634]: https://github.com/rust-random/getrandom/pull/634
15+
[#635]: https://github.com/rust-random/getrandom/pull/635
16+
[#639]: https://github.com/rust-random/getrandom/pull/639
17+
718
## [0.3.2] - 2025-03-17
819

920
### Added
@@ -566,6 +577,7 @@ Publish initial implementation.
566577
## [0.0.0] - 2019-01-19
567578
Publish an empty template library.
568579

580+
[0.3.3]: https://github.com/rust-random/getrandom/compare/v0.3.2...v0.3.3
569581
[0.3.2]: https://github.com/rust-random/getrandom/compare/v0.3.1...v0.3.2
570582
[0.3.1]: https://github.com/rust-random/getrandom/compare/v0.3.0...v0.3.1
571583
[0.3.0]: https://github.com/rust-random/getrandom/compare/v0.2.15...v0.3.0

src/backends.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ cfg_if! {
3131
mod wasm_js;
3232
pub use wasm_js::*;
3333
} else {
34-
compile_error!(
34+
compile_error!(concat!(
3535
"The \"wasm_js\" backend requires the `wasm_js` feature \
3636
for `getrandom`. For more information see: \
37-
https://docs.rs/getrandom/#webassembly-support"
38-
);
37+
https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#webassembly-support"
38+
));
3939
}
4040
}
4141
} else if #[cfg(all(target_os = "linux", target_env = ""))] {
@@ -165,17 +165,17 @@ cfg_if! {
165165
mod rdrand;
166166
pub use rdrand::*;
167167
} else if #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] {
168-
compile_error!(
168+
compile_error!(concat!(
169169
"The wasm32-unknown-unknown targets are not supported by default; \
170170
you may need to enable the \"wasm_js\" configuration flag. Note \
171171
that enabling the `wasm_js` feature flag alone is insufficient. \
172172
For more information see: \
173-
https://docs.rs/getrandom/#webassembly-support"
174-
);
173+
https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#webassembly-support"
174+
));
175175
} else {
176-
compile_error!(
176+
compile_error!(concat!(
177177
"target is not supported. You may need to define a custom backend see: \
178-
https://docs.rs/getrandom/#custom-backend"
179-
);
178+
https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#custom-backend"
179+
));
180180
}
181181
}

0 commit comments

Comments
 (0)