File tree 2 files changed +34
-7
lines changed
2 files changed +34
-7
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,27 @@ fn main() {
8
8
// Set cfg flags depending on release channel
9
9
match version_meta ( ) . unwrap ( ) . channel {
10
10
// Enable our feature on nightly, or when using a
11
- // locally build rustc, unless `-Zallow-features`
12
- // in RUSTFLAGS disallows unstable features.
13
- Channel :: Nightly | Channel :: Dev if feature_allowed ( "proc_macro_def_site" ) => {
11
+ // locally build rustc.
12
+ //
13
+ // This is intended to avoid the issue that cannot know the actual
14
+ // trait implementation bounds of the `Unpin` implementation from the
15
+ // document of generated code.
16
+ // See [taiki-e/pin-project#53] and [rust-lang/rust#63281] for more details.
17
+ //
18
+ // [taiki-e/pin-project#53]: https://github.com/taiki-e/pin-project/pull/53#issuecomment-525906867
19
+ // [rust-lang/rust#63281]: https://github.com/rust-lang/rust/issues/63281
20
+ //
21
+ // You can opt-out of this in one of the followg ways:
22
+ // * Use `--cfg pin_project_stable_docs` in RUSTFLAGS.
23
+ // ```toml
24
+ // # in Cargo.toml
25
+ // [package.metadata.docs.rs]
26
+ // rustdoc-args = ["--cfg", "pin_project_stable_docs"]
27
+ // ```
28
+ // * Use `-Zallow-features` in RUSTFLAGS to disallow unstable features.
29
+ Channel :: Nightly | Channel :: Dev
30
+ if feature_allowed ( "proc_macro_def_site" ) && !cfg ! ( pin_project_stable_docs) =>
31
+ {
14
32
println ! ( "cargo:rustc-cfg=proc_macro_def_site" ) ;
15
33
}
16
34
_ => { }
Original file line number Diff line number Diff line change @@ -233,10 +233,19 @@ impl Context {
233
233
// '__UnpinStruct' type must also be public. However, we take
234
234
// steps to ensure that the user can never actually reference
235
235
// this 'public' type. These steps are described below
236
- /// A struct generated by pin-project to provide an appropriate
237
- /// `Unpin` implementation, this type's `Unpin` implementation
238
- /// uses exactly the same conditions as the original type's
239
- /// `Unpin` implementation.
236
+ //
237
+ /// A struct generated by pin-project to correctly document the
238
+ /// automatically generated `Unpin` implementation.
239
+ ///
240
+ /// This struct exists to correctly document the actual trait
241
+ /// implementation bounds of the `Unpin` implementation of the
242
+ /// original type. Note that users cannot access this struct,
243
+ /// even if it is public.
244
+ ///
245
+ /// See [taiki-e/pin-project#53] and [rust-lang/rust#63281] for more details.
246
+ ///
247
+ /// [taiki-e/pin-project#53]: https://github.com/taiki-e/pin-project/pull/53#issuecomment-525906867
248
+ /// [rust-lang/rust#63281]: https://github.com/rust-lang/rust/issues/63281
240
249
#vis struct #struct_ident #full_generics #where_clause {
241
250
__pin_project_use_generics: #always_unpin_ident <( #( #type_params) , * ) >,
242
251
You can’t perform that action at this time.
0 commit comments