1# Changelog 2 3All notable changes to this project will be documented in this file. 4 5This project adheres to [Semantic Versioning](https://semver.org). 6 7<!-- 8Note: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering. 9--> 10 11## [Unreleased] 12 13## [1.1.3] - 2023-08-06 14 15- Hide documentation of the `Unpin` implementation for `!Unpin` option to work around [rustdoc issue](https://github.com/rust-lang/rust/issues/80481). ([#355](https://github.com/taiki-e/pin-project/pull/355), thanks @matheus-consoli) 16 17## [1.1.2] - 2023-07-02 18 19- Inline project methods. 20 21## [1.1.1] - 2023-06-29 22 23- Fix build error from dependency when built with `-Z minimal-versions`. 24 25## [1.1.0] - 2023-05-13 26 27- Update `syn` dependency to 2. This increase the minimum supported Rust version from Rust 1.37 to Rust 1.56. ([#352](https://github.com/taiki-e/pin-project/pull/352), [#354](https://github.com/taiki-e/pin-project/pull/354), thanks @maurer and @daxpedda) 28 29## [1.0.12] - 2022-08-15 30 31- Suppress `unused_tuple_struct_fields` lint in generated code. 32 33## [1.0.11] - 2022-07-02 34 35- [Suppress `dead_code` lint in generated code.](https://github.com/taiki-e/pin-project/pull/346) 36 37## [1.0.10] - 2021-12-31 38 39- Revert the increase of the minimal version of `syn` that was done in 1.0.9. 40 41## [1.0.9] - 2021-12-26 42 43- [Prevent abuse of private module.](https://github.com/taiki-e/pin-project/pull/336) 44 45- Update minimal version of `syn` to 1.0.84. 46 47## [1.0.8] - 2021-07-21 48 49- [Suppress `clippy::use_self` and `clippy::type_repetition_in_bounds` lints in generated code.](https://github.com/taiki-e/pin-project/pull/331) 50 51## [1.0.7] - 2021-04-16 52 53- [Fix compile error when using `self::` as prefix of path inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/326) 54 55## [1.0.6] - 2021-03-25 56 57- [Suppress `clippy::semicolon_if_nothing_returned` lint in generated code.](https://github.com/taiki-e/pin-project/pull/318) 58 59## [1.0.5] - 2021-02-03 60 61- [Suppress `deprecated` lint in generated code.](https://github.com/taiki-e/pin-project/pull/313) 62 63## [1.0.4] - 2021-01-09 64 65- [Suppress `clippy::ref_option_ref` lint in generated code.](https://github.com/taiki-e/pin-project/pull/308) 66 67## [1.0.3] - 2021-01-05 68 69- Exclude unneeded files from crates.io. 70 71## [1.0.2] - 2020-11-18 72 73- [Suppress `clippy::unknown_clippy_lints` lint in generated code.](https://github.com/taiki-e/pin-project/pull/303) 74 75## [1.0.1] - 2020-10-15 76 77**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/commit/ddcd88079ba2d82857c365f2a3543ad146ade54c). 78 79- [Fix warnings when `#[pin_project]` attribute used within `macro_rules!` macros.](https://github.com/taiki-e/pin-project/pull/298) 80 81## [1.0.0] - 2020-10-13 82 83**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/commit/ddcd88079ba2d82857c365f2a3543ad146ade54c). 84 85- [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265) 86 87 Name the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead: 88 89 ```diff 90 - #[pin_project] 91 + #[pin_project(project = EnumProj)] 92 enum Enum<T> { 93 Variant(#[pin] T), 94 } 95 96 - #[project] 97 fn func<T>(x: Pin<&mut Enum<T>>) { 98 - #[project] 99 match x.project() { 100 - Enum::Variant(_) => { /* ... */ } 101 + EnumProj::Variant(_) => { /* ... */ } 102 } 103 } 104 ``` 105 106- [Remove deprecated `Replace` argument from `#[pin_project]` attribute.](https://github.com/taiki-e/pin-project/pull/266) Use `project_replace` argument instead. 107 108- [Optimize code generation when used on enums.](https://github.com/taiki-e/pin-project/pull/270) 109 110- [Raise the minimum supported Rust version of this crate from Rust 1.34 to Rust 1.37.](https://github.com/taiki-e/pin-project/pull/292) 111 112- Suppress `explicit_outlives_requirements`, `box_pointers`, `clippy::large_enum_variant`, `clippy::pattern_type_mismatch`, `clippy::implicit_return`, and `clippy::redundant_pub_crate` lints in generated code. ([#276](https://github.com/taiki-e/pin-project/pull/276), [#277](https://github.com/taiki-e/pin-project/pull/277), [#284](https://github.com/taiki-e/pin-project/pull/284)) 113 114- Diagnostic improvements. 115 116Changes since the 1.0.0-alpha.1 release: 117 118- [Fix drop order of pinned fields in `project_replace`.](https://github.com/taiki-e/pin-project/pull/287) 119 120- Update minimal version of `syn` to 1.0.44. 121 122## [1.0.0-alpha.1] - 2020-09-22 123 124- [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265) 125 126 Name the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead: 127 128 ```diff 129 - #[pin_project] 130 + #[pin_project(project = EnumProj)] 131 enum Enum<T> { 132 Variant(#[pin] T), 133 } 134 135 - #[project] 136 fn func<T>(x: Pin<&mut Enum<T>>) { 137 - #[project] 138 match x.project() { 139 - Enum::Variant(_) => { /* ... */ } 140 + EnumProj::Variant(_) => { /* ... */ } 141 } 142 } 143 ``` 144 145- [Remove deprecated `Replace` argument from `#[pin_project]` attribute.](https://github.com/taiki-e/pin-project/pull/266) Use `project_replace` argument instead. 146 147- [Optimize code generation when used on enums.](https://github.com/taiki-e/pin-project/pull/270) 148 149- Suppress `explicit_outlives_requirements`, `box_pointers`, `clippy::large_enum_variant`, `clippy::pattern_type_mismatch`, and `clippy::implicit_return` lints in generated code. ([#276](https://github.com/taiki-e/pin-project/pull/276), [#277](https://github.com/taiki-e/pin-project/pull/277)) 150 151- Diagnostic improvements. 152 153See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project/issues/264). 154 155## [0.4.30] - 2022-07-02 156 157- [Suppress `dead_code` lint in generated code.](https://github.com/taiki-e/pin-project/pull/347) 158 159## [0.4.29] - 2021-12-26 160 161- [Fix compile error with `syn` 1.0.84 and later.](https://github.com/taiki-e/pin-project/pull/335) 162 163## [0.4.28] - 2021-03-28 164 165**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 166 167- [Fix `unused_must_use` warning on unused borrows, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/322) See [#322](https://github.com/taiki-e/pin-project/pull/322) for more details. 168 169 (Note: 1.0 does not have this problem.) 170 171## [0.4.27] - 2020-10-11 172 173**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 174 175- Update minimal version of `syn` to 1.0.44. 176 177## [0.4.26] - 2020-10-04 178 179**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 180 181- [Fix drop order of pinned fields in `project_replace`.](https://github.com/taiki-e/pin-project/pull/287) 182 183## [0.4.25] - 2020-10-01 184 185**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 186 187- [Suppress `drop_bounds` lint, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/273) See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details. 188 189 (Note: 1.0.0-alpha.1 already contains this change.) 190 191## [0.4.24] - 2020-09-26 192 193**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 194 195- [Fix compatibility of generated code with `forbid(future_incompatible)`.](https://github.com/taiki-e/pin-project/pull/282) 196 197 Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future. 198 If rustc adds a new lint, we may not be able to keep this. 199 200## [0.4.23] - 2020-07-27 201 202**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 203 204- [Fix compile error with `?Sized` type parameters.](https://github.com/taiki-e/pin-project/pull/263) 205 206## [0.4.22] - 2020-06-14 207 208**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 209 210- Documentation improvements. 211 212## [0.4.21] - 2020-06-13 213 214**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 215 216- [Deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes due to some unfixable limitations.](https://github.com/taiki-e/pin-project/pull/244) 217 218 Consider naming the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead. 219 220 ```rust 221 #[pin_project(project = EnumProj)] 222 enum Enum<T> { 223 Variant(#[pin] T), 224 } 225 226 fn func<T>(x: Pin<&mut Enum<T>>) { 227 match x.project() { 228 EnumProj::Variant(y) => { 229 let _: Pin<&mut T> = y; 230 } 231 } 232 } 233 ``` 234 235 See [#225](https://github.com/taiki-e/pin-project/pull/225) for more details. 236 237- [Support `Self` in fields and generics in type definitions.](https://github.com/taiki-e/pin-project/pull/245) 238 239- [Fix errors involving *"`self` value is a keyword only available in methods with `self` parameter"* in apparently correct code.](https://github.com/taiki-e/pin-project/pull/250) 240 241- Diagnostic improvements. 242 243## [0.4.20] - 2020-06-07 244 245**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 246 247- [You can now use `project_replace` argument without Replace argument.](https://github.com/taiki-e/pin-project/pull/243) 248 This used to require you to specify both. 249 250 ```diff 251 - #[pin_project(Replace, project_replace = EnumProjOwn)] 252 + #[pin_project(project_replace = EnumProjOwn)] 253 enum Enum<T> { 254 Variant(#[pin] T) 255 } 256 ``` 257 258- [Make `project_replace` argument an alias for `Replace` argument so that it can be used without a value.](https://github.com/taiki-e/pin-project/pull/243) 259 260 ```rust 261 #[pin_project(project_replace)] 262 enum Enum<T> { 263 Variant(#[pin] T) 264 } 265 ``` 266 267 *The `Replace` argument will be deprecated in the future.* 268 269- [Suppress `unreachable_pub` lint in generated code.](https://github.com/taiki-e/pin-project/pull/240) 270 271## [0.4.19] - 2020-06-04 272 273**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 274 275- [Suppress `unused_results` lint in generated code.](https://github.com/taiki-e/pin-project/pull/239) 276 277## [0.4.18] - 2020-06-04 278 279**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 280 281- [Support `Self` in more syntax positions inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/230) 282 283- [Suppress `clippy::type_repetition_in_bounds` and `clippy::used_underscore_binding` lints in generated code.](https://github.com/taiki-e/pin-project/pull/233) 284 285- Documentation improvements. 286 287- Diagnostic improvements. 288 289## [0.4.17] - 2020-05-18 290 291**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 292 293- [Support naming the projection types.](https://github.com/taiki-e/pin-project/pull/202) 294 295 By passing an argument with the same name as the method to the attribute, you can name the projection type returned from the method: 296 297 ```rust 298 #[pin_project(project = EnumProj)] 299 enum Enum<T> { 300 Variant(#[pin] T), 301 } 302 303 fn func<T>(x: Pin<&mut Enum<T>>) { 304 match x.project() { 305 EnumProj::Variant(y) => { 306 let _: Pin<&mut T> = y; 307 } 308 } 309 } 310 ``` 311 312## [0.4.16] - 2020-05-11 313 314**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 315 316- [Fix an issue that users can call internal function generated by `#[pinned_drop]`.](https://github.com/taiki-e/pin-project/pull/223) 317 318## [0.4.15] - 2020-05-10 319 320**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 321 322- [`#[project]` attribute can now handle all `project*` attributes in that scope with one wrapper attribute.](https://github.com/taiki-e/pin-project/pull/220) 323 324## [0.4.14] - 2020-05-09 325 326**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 327 328- [Add `!Unpin` option to `#[pin_project]` attribute for guarantee the type is `!Unpin`.](https://github.com/taiki-e/pin-project/pull/219) 329 330 ```rust 331 #[pin_project(!Unpin)] 332 struct Struct<T, U> { 333 field: T, 334 } 335 ``` 336 337 This is equivalent to use `#[pin]` attribute for `PhantomPinned` field. 338 339 ```rust 340 #[pin_project] 341 struct Struct<T, U> { 342 field: T, 343 #[pin] // Note that using `PhantomPinned` without `#[pin]` attribute has no effect. 344 _pin: PhantomPinned, 345 } 346 ``` 347 348 *[Note: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)* 349 350- [Fix an issue where duplicate `#[project]` attributes were ignored.](https://github.com/taiki-e/pin-project/pull/218) 351 352- [Suppress `single_use_lifetimes` lint in generated code.](https://github.com/taiki-e/pin-project/pull/217) 353 354- [Support overlapping lifetime names in HRTB.](https://github.com/taiki-e/pin-project/pull/217) 355 356- [Hide generated items from --document-private-items.](https://github.com/taiki-e/pin-project/pull/211) See [#211](https://github.com/taiki-e/pin-project/pull/211) for details. 357 358- Documentation improvements. 359 360## [0.4.13] - 2020-05-07 361 362**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 363 364- [Fix a regression in 0.4.11.](https://github.com/taiki-e/pin-project/pull/207) 365 366 Changes from [0.4.10](https://github.com/taiki-e/pin-project/releases/tag/v0.4.10) and [0.4.12](https://github.com/taiki-e/pin-project/releases/tag/v0.4.12): 367 368 - [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) 369 370 - [Support overwriting the name of core crate.](https://github.com/taiki-e/pin-project/pull/199) 371 372 - [Suppress `clippy::needless_pass_by_value` lint in generated code of `#[pinned_drop]`.](https://github.com/taiki-e/pin-project/pull/200) 373 374 - Documentation improvements. 375 376 - Diagnostic improvements. 377 378## [0.4.12] - 2020-05-07 379 380**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 381 382- A release to avoid [a regression in 0.4.11](https://github.com/taiki-e/pin-project/issues/206). No code changes from [0.4.10](https://github.com/taiki-e/pin-project/releases/tag/v0.4.10). 383 384## [0.4.11] - 2020-05-07 385 386**Note:** This release has been yanked. See [#206](https://github.com/taiki-e/pin-project/issues/206) for details. 387 388- [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) 389 390- [Support overwriting the name of core crate.](https://github.com/taiki-e/pin-project/pull/199) 391 392- [Suppress `clippy::needless_pass_by_value` lint in generated code of `#[pinned_drop]`.](https://github.com/taiki-e/pin-project/pull/200) 393 394- Documentation improvements. 395 396- Diagnostic improvements. 397 398## [0.4.10] - 2020-05-04 399 400**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 401 402- [Add `project_replace` method and `#[project_replace]` attribute.](https://github.com/taiki-e/pin-project/pull/194) 403 `project_replace` method is optional and can be enabled by passing the `Replace` argument to `#[pin_project]` attribute. 404 See [the documentation](https://docs.rs/pin-project/0.4/pin_project/attr.pin_project.html#project_replace) for more details. 405 406- [Support `Self` and `self` in more syntax positions inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/190) 407 408- [Hide all generated items except for projected types from calling code.](https://github.com/taiki-e/pin-project/pull/192) See [#192](https://github.com/taiki-e/pin-project/pull/192) for details. 409 410## [0.4.9] - 2020-04-14 411 412**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 413 414- [Fix lifetime inference error when associated types are used in fields.](https://github.com/taiki-e/pin-project/pull/188) 415 416- [Fix compile error with tuple structs with `where` clauses.](https://github.com/taiki-e/pin-project/pull/186) 417 418- [`#[project]` attribute can now be used for `if let` expressions.](https://github.com/taiki-e/pin-project/pull/181) 419 420## [0.4.8] - 2020-01-27 421 422**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 423 424- [Ensure that users cannot implement `PinnedDrop` without proper attribute argument.](https://github.com/taiki-e/pin-project/pull/180) 425 426- [Fix use of `Self` in expression position inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/177) 427 428## [0.4.7] - 2020-01-20 429 430**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 431 432- [Fix support for lifetime bounds.](https://github.com/taiki-e/pin-project/pull/176) 433 434## [0.4.6] - 2019-11-20 435 436**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 437 438- [Fix compile error when there is `Self` in the where clause.](https://github.com/taiki-e/pin-project/pull/169) 439 440## [0.4.5] - 2019-10-21 441 442**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 443 444- [Fix compile error with `dyn` types.](https://github.com/taiki-e/pin-project/pull/158) 445 446## [0.4.4] - 2019-10-17 447 448**Note:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335). 449 450- [Fix an issue where `PinnedDrop` implementations can call unsafe code without an unsafe block.](https://github.com/taiki-e/pin-project/pull/149) 451 452## [0.4.3] - 2019-10-15 453 454**Note:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. 455 456- [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.](https://github.com/taiki-e/pin-project/pull/135) 457 458- [`#[pin_project]` can now interoperate with `#[cfg()]` on tuple structs and tuple variants.](https://github.com/taiki-e/pin-project/pull/135) 459 460- [Fix support for DSTs(Dynamically Sized Types) on `#[pin_project(UnsafeUnpin)]`](https://github.com/taiki-e/pin-project/pull/120) 461 462- Diagnostic improvements. 463 464## [0.4.2] - 2019-09-29 465 466**Note:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. 467 468- [Fix support for DSTs(Dynamically Sized Types).](https://github.com/taiki-e/pin-project/pull/113) 469 470## [0.4.1] - 2019-09-26 471 472**Note:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. 473 474- [Fix an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.](https://github.com/taiki-e/pin-project/pull/111) 475 476## [0.4.0] - 2019-09-25 477 478**Note:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. 479 480- [**Pin projection has become a safe operation.**](https://github.com/taiki-e/pin-project/pull/18) In the absence of other unsafe code that you write, it is impossible to cause undefined behavior. 481 482- `#[unsafe_project]` attribute has been replaced with `#[pin_project]` attribute. ([#18](https://github.com/taiki-e/pin-project/pull/18), [#33](https://github.com/taiki-e/pin-project/pull/33)) 483 484- [The `Unpin` argument has been removed - an `Unpin` impl is now generated by default.](https://github.com/taiki-e/pin-project/pull/18) 485 486- Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl. ([#18](https://github.com/taiki-e/pin-project/pull/18), [#33](https://github.com/taiki-e/pin-project/pull/33), [#86](https://github.com/taiki-e/pin-project/pull/86)) 487 488- [`Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.](https://github.com/taiki-e/pin-project/pull/18) 489 490- [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.](https://github.com/taiki-e/pin-project/pull/96) 491 492- [`#[pin_project]` can now be used for public type with private field types.](https://github.com/taiki-e/pin-project/pull/53) 493 494- [`#[pin_project]` can now interoperate with `#[cfg()]`.](https://github.com/taiki-e/pin-project/pull/77) 495 496- [Add `project_ref` method to `#[pin_project]` types.](https://github.com/taiki-e/pin-project/pull/93) 497 498- [Add `#[project_ref]` attribute.](https://github.com/taiki-e/pin-project/pull/93) 499 500- [Remove "project_attr" feature and always enable `#[project]` attribute.](https://github.com/taiki-e/pin-project/pull/94) 501 502- [`#[project]` attribute can now be used for `impl` blocks.](https://github.com/taiki-e/pin-project/pull/46) 503 504- [`#[project]` attribute can now be used for `use` statements.](https://github.com/taiki-e/pin-project/pull/85) 505 506- [`#[project]` attribute now supports `match` expressions at the position of the initializer expression of `let` expressions.](https://github.com/taiki-e/pin-project/pull/51) 507 508Changes since the 0.4.0-beta.1 release: 509 510- [Fix an issue that caused an error when using `#[pin_project(UnsafeUnpin)]` and not providing a manual `UnsafeUnpin` implementation on a type with no generics or lifetime.](https://github.com/taiki-e/pin-project/pull/107) 511 512## [0.4.0-beta.1] - 2019-09-21 513 514- [Change the argument type of project method back to `self: Pin<&mut Self>`.](https://github.com/taiki-e/pin-project/pull/90) 515 516- [Remove "project_attr" feature and always enable `#[project]` attribute.](https://github.com/taiki-e/pin-project/pull/94) 517 518- [Remove "renamed" feature.](https://github.com/taiki-e/pin-project/pull/100) 519 520- [`#[project]` attribute can now be used for `use` statements.](https://github.com/taiki-e/pin-project/pull/85) 521 522- [Add `project_ref` method and `#[project_ref]` attribute.](https://github.com/taiki-e/pin-project/pull/93) 523 524- [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.](https://github.com/taiki-e/pin-project/pull/96) 525 526## [0.4.0-alpha.11] - 2019-09-11 527 528- [Change #[pinned_drop] to trait implementation.](https://github.com/taiki-e/pin-project/pull/86) 529 530 ```rust 531 #[pinned_drop] 532 impl<T> PinnedDrop for Foo<'_, T> { 533 fn drop(mut self: Pin<&mut Self>) { 534 **self.project().was_dropped = true; 535 } 536 } 537 ``` 538 539- Add some examples and generated code. 540 541- Diagnostic improvements. 542 543## [0.4.0-alpha.10] - 2019-09-07 544 545- [`#[pin_project]` can now interoperate with `#[cfg()]`.](https://github.com/taiki-e/pin-project/pull/77) 546 547- Documentation improvements. 548 549## [0.4.0-alpha.9] - 2019-09-05 550 551- [Add `project_into` method to `#[pin_project]` types](https://github.com/taiki-e/pin-project/pull/69). This can be useful when returning a pin projection from a method. 552 553 ```rust 554 fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> { 555 self.project_into().pinned 556 } 557 ``` 558 559- [Prevent `UnpinStruct` from appearing in the document by default.](https://github.com/taiki-e/pin-project/pull/71) See [#71](https://github.com/taiki-e/pin-project/pull/71) for more details. 560 561## [0.4.0-alpha.8] - 2019-09-03 562 563- [Improve document of generated code.](https://github.com/taiki-e/pin-project/pull/62). Also added an option to control the document of generated code. See [#62](https://github.com/taiki-e/pin-project/pull/62) for more details. 564 565- [Diagnostic improvements.](https://github.com/taiki-e/pin-project/pull/61) 566 567## [0.4.0-alpha.7] - 2019-09-02 568 569- [Suppress `dead_code` lint in generated types.](https://github.com/taiki-e/pin-project/pull/57) 570 571## [0.4.0-alpha.6] - 2019-09-01 572 573- [Allow using `#[pin_project]` type with private field types](https://github.com/taiki-e/pin-project/pull/53) 574 575## [0.4.0-alpha.5] - 2019-08-24 576 577- [`#[project]` attribute now supports `match` expressions at the position of the initializer expression of `let` expressions.](https://github.com/taiki-e/pin-project/pull/51) 578 579## [0.4.0-alpha.4] - 2019-08-23 580 581- Suppress `clippy::drop_bounds` lint in generated code. 582 583## [0.4.0-alpha.3] - 2019-08-23 584 585- [Change `project` method generated by `#[pin_project]` attribute to take an `&mut Pin<&mut Self>` argument.](https://github.com/taiki-e/pin-project/pull/47) 586 587- [`#[project]` attribute can now be used for impl blocks.](https://github.com/taiki-e/pin-project/pull/46) 588 589- [`#[pin_project]` attribute can now detect that the type used does not have its own drop implementation without actually implementing drop.](https://github.com/taiki-e/pin-project/pull/48) This removed some restrictions. 590 591## [0.4.0-alpha.2] - 2019-08-13 592 593- Update `proc-macro2`, `syn`, and `quote` to 1.0. 594 595## [0.4.0-alpha.1] - 2019-08-11 596 597- **Pin projection has become a safe operation.** 598 599- `#[unsafe_project]` has been replaced with `#[pin_project]`. 600 601- The `Unpin` argument has been removed - an `Unpin` impl is now generated by default. 602 603- Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl. 604 605- `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait. 606 607- Make `#[project]` attribute disabled by default. 608 609See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21). 610 611## [0.3.5] - 2019-08-14 612 613- Update `proc-macro2`, `syn`, and `quote` to 1.0. 614 615## [0.3.4] - 2019-07-21 616 617- Diagnostic improvements. 618 619## [0.3.3] - 2019-07-15 620 621**Note:** This release has been yanked. See [#16](https://github.com/taiki-e/pin-project/issues/16) for details. 622 623- Diagnostic improvements. 624 625## [0.3.2] - 2019-03-30 626 627- Avoid suffixes on tuple index. 628 629## [0.3.1] - 2019-03-02 630 631- Documentation improvements. 632 633- Update minimum `syn` version to 0.15.22. 634 635## [0.3.0] - 2019-02-20 636 637- Remove `unsafe_fields` attribute. 638 639- Remove `unsafe_variants` attribute. 640 641## [0.2.2] - 2019-02-20 642 643- Fix a bug that generates incorrect code for the some structures with trait bounds on type generics. 644 645## [0.2.1] - 2019-02-20 646 647- Fix a bug that generates incorrect code for the structures with where clause and associated type fields. 648 649## [0.2.0] - 2019-02-11 650 651- Make `unsafe_fields` optional. 652 653- Documentation improvements. 654 655## [0.1.8] - 2019-02-02 656 657- Add the feature to create projected enums to `unsafe_project`. 658 659- Add `project` attribute to support pattern matching. 660 661## [0.1.7] - 2019-01-19 662 663- Fix documentation. 664 665## [0.1.6] - 2019-01-19 666 667- `unsafe_fields` can now opt-out. 668 669- Add `unsafe_variants` attribute. This attribute is available if pin-project is built with the "unsafe_variants" feature. 670 671## [0.1.5] - 2019-01-17 672 673- Add support for tuple struct to `unsafe_project`. 674 675## [0.1.4] - 2019-01-12 676 677- Add options for automatically implementing `Unpin` to both `unsafe_project` and `unsafe_fields`. 678 679## [0.1.3] - 2019-01-11 680 681- Fix dependencies. 682 683- Add `unsafe_fields` attribute. 684 685## [0.1.2] - 2019-01-09 686 687- Documentation improvements. 688 689## [0.1.1] - 2019-01-08 690 691- Rename from `unsafe_pin_project` to `unsafe_project`. 692 693## [0.1.0] - 2019-01-08 694 695**Note:** This release has been yanked. 696 697Initial release 698 699[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.1.3...HEAD 700[1.1.3]: https://github.com/taiki-e/pin-project/compare/v1.1.2...v1.1.3 701[1.1.2]: https://github.com/taiki-e/pin-project/compare/v1.1.1...v1.1.2 702[1.1.1]: https://github.com/taiki-e/pin-project/compare/v1.1.0...v1.1.1 703[1.1.0]: https://github.com/taiki-e/pin-project/compare/v1.0.12...v1.1.0 704[1.0.12]: https://github.com/taiki-e/pin-project/compare/v1.0.11...v1.0.12 705[1.0.11]: https://github.com/taiki-e/pin-project/compare/v1.0.10...v1.0.11 706[1.0.10]: https://github.com/taiki-e/pin-project/compare/v1.0.9...v1.0.10 707[1.0.9]: https://github.com/taiki-e/pin-project/compare/v1.0.8...v1.0.9 708[1.0.8]: https://github.com/taiki-e/pin-project/compare/v1.0.7...v1.0.8 709[1.0.7]: https://github.com/taiki-e/pin-project/compare/v1.0.6...v1.0.7 710[1.0.6]: https://github.com/taiki-e/pin-project/compare/v1.0.5...v1.0.6 711[1.0.5]: https://github.com/taiki-e/pin-project/compare/v1.0.4...v1.0.5 712[1.0.4]: https://github.com/taiki-e/pin-project/compare/v1.0.3...v1.0.4 713[1.0.3]: https://github.com/taiki-e/pin-project/compare/v1.0.2...v1.0.3 714[1.0.2]: https://github.com/taiki-e/pin-project/compare/v1.0.1...v1.0.2 715[1.0.1]: https://github.com/taiki-e/pin-project/compare/v1.0.0...v1.0.1 716[1.0.0]: https://github.com/taiki-e/pin-project/compare/v1.0.0-alpha.1...v1.0.0 717[1.0.0-alpha.1]: https://github.com/taiki-e/pin-project/compare/v0.4.23...v1.0.0-alpha.1 718[0.4.30]: https://github.com/taiki-e/pin-project/compare/v0.4.29...v0.4.30 719[0.4.29]: https://github.com/taiki-e/pin-project/compare/v0.4.28...v0.4.29 720[0.4.28]: https://github.com/taiki-e/pin-project/compare/v0.4.27...v0.4.28 721[0.4.27]: https://github.com/taiki-e/pin-project/compare/v0.4.26...v0.4.27 722[0.4.26]: https://github.com/taiki-e/pin-project/compare/v0.4.25...v0.4.26 723[0.4.25]: https://github.com/taiki-e/pin-project/compare/v0.4.24...v0.4.25 724[0.4.24]: https://github.com/taiki-e/pin-project/compare/v0.4.23...v0.4.24 725[0.4.23]: https://github.com/taiki-e/pin-project/compare/v0.4.22...v0.4.23 726[0.4.22]: https://github.com/taiki-e/pin-project/compare/v0.4.21...v0.4.22 727[0.4.21]: https://github.com/taiki-e/pin-project/compare/v0.4.20...v0.4.21 728[0.4.20]: https://github.com/taiki-e/pin-project/compare/v0.4.19...v0.4.20 729[0.4.19]: https://github.com/taiki-e/pin-project/compare/v0.4.18...v0.4.19 730[0.4.18]: https://github.com/taiki-e/pin-project/compare/v0.4.17...v0.4.18 731[0.4.17]: https://github.com/taiki-e/pin-project/compare/v0.4.16...v0.4.17 732[0.4.16]: https://github.com/taiki-e/pin-project/compare/v0.4.15...v0.4.16 733[0.4.15]: https://github.com/taiki-e/pin-project/compare/v0.4.14...v0.4.15 734[0.4.14]: https://github.com/taiki-e/pin-project/compare/v0.4.13...v0.4.14 735[0.4.13]: https://github.com/taiki-e/pin-project/compare/v0.4.11...v0.4.13 736[0.4.12]: https://github.com/taiki-e/pin-project/compare/v0.4.10...v0.4.12 737[0.4.11]: https://github.com/taiki-e/pin-project/compare/v0.4.10...v0.4.11 738[0.4.10]: https://github.com/taiki-e/pin-project/compare/v0.4.9...v0.4.10 739[0.4.9]: https://github.com/taiki-e/pin-project/compare/v0.4.8...v0.4.9 740[0.4.8]: https://github.com/taiki-e/pin-project/compare/v0.4.7...v0.4.8 741[0.4.7]: https://github.com/taiki-e/pin-project/compare/v0.4.6...v0.4.7 742[0.4.6]: https://github.com/taiki-e/pin-project/compare/v0.4.5...v0.4.6 743[0.4.5]: https://github.com/taiki-e/pin-project/compare/v0.4.4...v0.4.5 744[0.4.4]: https://github.com/taiki-e/pin-project/compare/v0.4.3...v0.4.4 745[0.4.3]: https://github.com/taiki-e/pin-project/compare/v0.4.2...v0.4.3 746[0.4.2]: https://github.com/taiki-e/pin-project/compare/v0.4.1...v0.4.2 747[0.4.1]: https://github.com/taiki-e/pin-project/compare/v0.4.0...v0.4.1 748[0.4.0]: https://github.com/taiki-e/pin-project/compare/v0.4.0-beta.1...v0.4.0 749[0.4.0-beta.1]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.11...v0.4.0-beta.1 750[0.4.0-alpha.11]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.10...v0.4.0-alpha.11 751[0.4.0-alpha.10]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.9...v0.4.0-alpha.10 752[0.4.0-alpha.9]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.8...v0.4.0-alpha.9 753[0.4.0-alpha.8]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.7...v0.4.0-alpha.8 754[0.4.0-alpha.7]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.6...v0.4.0-alpha.7 755[0.4.0-alpha.6]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.5...v0.4.0-alpha.6 756[0.4.0-alpha.5]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.4...v0.4.0-alpha.5 757[0.4.0-alpha.4]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.3...v0.4.0-alpha.4 758[0.4.0-alpha.3]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.2...v0.4.0-alpha.3 759[0.4.0-alpha.2]: https://github.com/taiki-e/pin-project/compare/v0.4.0-alpha.1...v0.4.0-alpha.2 760[0.4.0-alpha.1]: https://github.com/taiki-e/pin-project/compare/v0.3.5...v0.4.0-alpha.1 761[0.3.5]: https://github.com/taiki-e/pin-project/compare/v0.3.4...v0.3.5 762[0.3.4]: https://github.com/taiki-e/pin-project/compare/v0.3.3...v0.3.4 763[0.3.3]: https://github.com/taiki-e/pin-project/compare/v0.3.2...v0.3.3 764[0.3.2]: https://github.com/taiki-e/pin-project/compare/v0.3.1...v0.3.2 765[0.3.1]: https://github.com/taiki-e/pin-project/compare/v0.3.0...v0.3.1 766[0.3.0]: https://github.com/taiki-e/pin-project/compare/v0.2.2...v0.3.0 767[0.2.2]: https://github.com/taiki-e/pin-project/compare/v0.2.1...v0.2.2 768[0.2.1]: https://github.com/taiki-e/pin-project/compare/v0.2.0...v0.2.1 769[0.2.0]: https://github.com/taiki-e/pin-project/compare/v0.1.8...v0.2.0 770[0.1.8]: https://github.com/taiki-e/pin-project/compare/v0.1.7...v0.1.8 771[0.1.7]: https://github.com/taiki-e/pin-project/compare/v0.1.6...v0.1.7 772[0.1.6]: https://github.com/taiki-e/pin-project/compare/v0.1.5...v0.1.6 773[0.1.5]: https://github.com/taiki-e/pin-project/compare/v0.1.4...v0.1.5 774[0.1.4]: https://github.com/taiki-e/pin-project/compare/v0.1.3...v0.1.4 775[0.1.3]: https://github.com/taiki-e/pin-project/compare/v0.1.2...v0.1.3 776[0.1.2]: https://github.com/taiki-e/pin-project/compare/v0.1.1...v0.1.2 777[0.1.1]: https://github.com/taiki-e/pin-project/compare/v0.1.0...v0.1.1 778[0.1.0]: https://github.com/taiki-e/pin-project/releases/tag/v0.1.0 779