| 1 |
# Changelog |
| 2 |
|
| 3 |
All notable changes to this crate will be documented in this file. |
| 4 |
|
| 5 |
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| 6 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 |
|
| 8 |
## [1.0.13] - 2026-08-09 |
| 9 |
|
| 10 |
### Changed |
| 11 |
|
| 12 |
- Bump `linktime-proc-macro` dependency to 0.2.3 (consistent 64-bit hash chunks |
| 13 |
and cross-crate section-name fix). |
| 14 |
|
| 15 |
### Documentation |
| 16 |
|
| 17 |
- Documented the `crate_path` override for re-exporting the macro from another |
| 18 |
crate. |
| 19 |
|
| 20 |
## [1.0.12] - 2026-07-29 |
| 21 |
|
| 22 |
### Changed |
| 23 |
|
| 24 |
- Bump `linktime-proc-macro` dependency to 0.2.1 (makes link-section names more stable). |
| 25 |
|
| 26 |
## [1.0.11] - 2026-07-26 |
| 27 |
|
| 28 |
### Fixed |
| 29 |
|
| 30 |
- Pointer-align the priority ctor anchor on Apple platforms (#502). |
| 31 |
|
| 32 |
## [1.0.10] - 2026-07-21 |
| 33 |
|
| 34 |
### Changed |
| 35 |
|
| 36 |
- Faster atomics and #[cold] for `Static::deref` initialization (@yvt PR #501) |
| 37 |
|
| 38 |
## [1.0.9] - 2026-07-15 |
| 39 |
|
| 40 |
### Fixed |
| 41 |
|
| 42 |
- Ensure the single executing priority ctor is kept alive on Apple platforms (#496). |
| 43 |
|
| 44 |
## [1.0.8] - 2026-07-06 |
| 45 |
|
| 46 |
### Changed |
| 47 |
|
| 48 |
- Bump `link-section` dependency to 0.19.0. |
| 49 |
|
| 50 |
## [1.0.7] - 2026-05-28 |
| 51 |
|
| 52 |
### Changed |
| 53 |
|
| 54 |
- Bump `link-section` dependency to 0.18.0. |
| 55 |
- Improve error messages for bad attribute values. |
| 56 |
|
| 57 |
## [1.0.6] - 2026-05-16 |
| 58 |
|
| 59 |
### Changed |
| 60 |
|
| 61 |
- Bump `link-section` dependency to 0.17.0. |
| 62 |
- MSRV bumped to 1.85.0 (if `priority` feature is enabled), otherwise remains at |
| 63 |
1.60.0. |
| 64 |
- To restore MSRV to 1.60.0, use `ctor = { version = "1.0.6", default-features |
| 65 |
= false, features = ["proc_macro", "std"] }` in your Cargo.toml. |
| 66 |
|
| 67 |
### Fixed |
| 68 |
|
| 69 |
- `#[ctor]` requires significantly less macro recursion. |
| 70 |
|
| 71 |
## [1.0.5] - 2026-05-11 |
| 72 |
|
| 73 |
### Changed |
| 74 |
|
| 75 |
- Repair MSRV breakage for WASM targets. |
| 76 |
|
| 77 |
## [1.0.4] - 2026-05-08 |
| 78 |
|
| 79 |
### Added |
| 80 |
|
| 81 |
- Support for win7, uwp and other windows targets |
| 82 |
- Support for UEFI targets (`.init_array` matching gnu-efi) |
| 83 |
- Fallback to `.init_array` for unsupported targets (with a warning) |
| 84 |
|
| 85 |
### Changed |
| 86 |
|
| 87 |
- `target_vendor = "pc"` is now `target_os = "windows"`. This should be a |
| 88 |
strictly increasing set of support for windows targets. |
| 89 |
|
| 90 |
## [1.0.3] - 2026-05-07 |
| 91 |
|
| 92 |
### Fixed |
| 93 |
|
| 94 |
- A `default` priority value is now supported and is the default. This is |
| 95 |
equivalent to a priority of 500 on most platforms. The previous `priority` |
| 96 |
default of 0 was unsafe for C library access on some platforms. |
| 97 |
- The `early` priority value is now equivalent to a priority of 101 on most platforms. |
| 98 |
|
| 99 |
## [1.0.2] - 2026-05-06 |
| 100 |
|
| 101 |
### Changed |
| 102 |
|
| 103 |
- Bump `link-section` dependency to 0.15.0. |
| 104 |
- Use `const` rather than `static` items for collected constructors on macOS. |
| 105 |
- Allow various forms of `&'static` for `#[ctor]` statics which desugar to |
| 106 |
`&'static Static`. |
| 107 |
- Static items delegate `Display` directly as well. |
| 108 |
- Support for multiple `#[ctor]` items in a single `#[ctor]` block: |
| 109 |
```rust |
| 110 |
#[ctor] |
| 111 |
static CTOR: &[fn()] = const { |
| 112 |
// ... |
| 113 |
} |
| 114 |
``` |
| 115 |
|
| 116 |
## [1.0.1] - 2026-05-04 |
| 117 |
|
| 118 |
### Changed |
| 119 |
|
| 120 |
- `wasm32-unknown-unknown` would run ctor items on each call of an exported |
| 121 |
function. |
| 122 |
|
| 123 |
## [1.0.0] - 2026-05-03 |
| 124 |
|
| 125 |
### Changed |
| 126 |
|
| 127 |
- Stabilized (yay!). Identical to 0.13.1. Thanks to all the contributors who |
| 128 |
helped along the way! Please file any upgrade issues in |
| 129 |
<https://github.com/mmastrac/linktime/issues>. |
| 130 |
- For those upgrading from earlier versions, the major changes for you to note |
| 131 |
are: |
| 132 |
- `dtor` was split into the `dtor` crate. You'll need to add it to your |
| 133 |
dependencies like so: |
| 134 |
```toml |
| 135 |
[dependencies] |
| 136 |
dtor = "1.0.0" # or later |
| 137 |
``` |
| 138 |
- `#[ctor(unsafe)]` is now required for `#[ctor]` items. If you are building a |
| 139 |
binary, you can use `RUSTFLAGS="--cfg linktime_no_fail_on_missing_unsafe"` |
| 140 |
(or alternatively, specify this in your `config.toml` file) to bypass the |
| 141 |
error. |
| 142 |
- For those re-exporting `ctor` from their own crates: the |
| 143 |
`ctor::declarative::ctor!` macro should be preferred over |
| 144 |
`#[ctor(crate_path = ...)]`. The latter form will continue to work, but |
| 145 |
the declarative macro is far more stable for most use cases. See |
| 146 |
<https://docs.rs/ctor/latest/ctor/declarative/macro.ctor.html> for more |
| 147 |
details. |
| 148 |
|
| 149 |
## [0.13.1] - 2026-05-02 |
| 150 |
|
| 151 |
### Changed |
| 152 |
|
| 153 |
- Crate examples were reorganized. |
| 154 |
|
| 155 |
### Fixed |
| 156 |
|
| 157 |
- Documentation fixes (`--cfg` flags were incorrect). |
| 158 |
- Incorrect crate feature in docs. |
| 159 |
|
| 160 |
## [0.13.0] - 2026-05-02 |
| 161 |
|
| 162 |
### Changed |
| 163 |
|
| 164 |
- `#[ctor(priority = naked)]` is now `#[ctor(naked)]`. |
| 165 |
- `unsafe` is now required for `#[ctor]` items and the |
| 166 |
`no_warn_on_missing_unsafe` feature is gone. |
| 167 |
- `RUSTFLAGS="--cfg linktime_no_fail_on_missing_unsafe"` can bypass the error. |
| 168 |
- `used_linker` feature moved to `--cfg linktime_used_linker` flag. |
| 169 |
|
| 170 |
### Added |
| 171 |
|
| 172 |
- Re-added link section option for body of `#[ctor]` items (supported for Linux/Android/FreeBSD/Apple). |
| 173 |
|
| 174 |
## [0.12.0] - 2026-04-30 |
| 175 |
|
| 176 |
### Added |
| 177 |
|
| 178 |
- Support for `#[ctor]` on `impl` items. To be valid, the `fn` must have no |
| 179 |
`self` parameter and must not access any generic parameters from the outer |
| 180 |
item. |
| 181 |
- Added `life before main` documentation to all crates. |
| 182 |
- `early` and `late` priority values are now supported on all platforms. |
| 183 |
|
| 184 |
### Removed |
| 185 |
|
| 186 |
- Deprecated `dtor` feature and crate dependency from `ctor` crate (use the |
| 187 |
`dtor` crate directly). |
| 188 |
|
| 189 |
### Fixed |
| 190 |
|
| 191 |
- AIX uses "standard" priority values from 0 to 999, early and late (mapped to |
| 192 |
80000000 to 80000999). |
| 193 |
|
| 194 |
### Changed |
| 195 |
|
| 196 |
- If the `priority` feature is enabled, `ctor` priority sorting is now stable |
| 197 |
and consistent across platforms: `early`/`0`/`unspecified`, then `1 <= N < |
| 198 |
1000`, then `late`. |
| 199 |
- If a `link_section` or `export_name_prefix` is specified, a `priority` value |
| 200 |
must not be specified (now a compiler error). |
| 201 |
- Migrated to using the `linktime-proc-macro` crate for proc-macro support. |
| 202 |
|
| 203 |
## [0.11.1] - 2026-04-28 |
| 204 |
|
| 205 |
### Changed |
| 206 |
|
| 207 |
- Deprecated `dtor` macros in favor of the `dtor` crate. |
| 208 |
- Migrated to using the `linktime-proc-macro` crate for proc-macro support. |
| 209 |
|
| 210 |
### Fixed |
| 211 |
|
| 212 |
- Fixed some stray `dtor` references in ctor docs. |
| 213 |
|
| 214 |
## [0.11.0] - 2026-04-28 |
| 215 |
|
| 216 |
### Added |
| 217 |
|
| 218 |
- AIX support for `ctor`/`dtor` crates. |
| 219 |
|
| 220 |
### Changed |
| 221 |
|
| 222 |
- Significant rewrite to ctor/dtor macros and documentation. |
| 223 |
- Macro attributes and crate features are auto-documented. |
| 224 |
- Rewrote `statics` code in `ctor` to not require `std`. |
| 225 |
|
| 226 |
## [0.10.1] - 2026-04-22 |
| 227 |
|
| 228 |
### Added |
| 229 |
|
| 230 |
- Included licenses in all files. |
| 231 |
- Bumped proc-macro dependency versions. |
| 232 |
|
| 233 |
### Fixed |
| 234 |
|
| 235 |
- Fix MSRV in ctor docs. |
| 236 |
- Various hardening fixes under Miri. |
| 237 |
- Adding priority to `ctor`s accidentally enabled the anonymous flag. |
| 238 |
|
| 239 |
### Changed |
| 240 |
|
| 241 |
- `ctor` exports all `dtor` macros from `dtor` crate rather than reimplementing them. |