We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pin!()
1 parent 4c60a0e commit 6d523e9Copy full SHA for 6d523e9
library/core/src/pin.rs
@@ -1006,9 +1006,10 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
1006
/// // Allow generator to be self-referential (not `Unpin`)
1007
/// // vvvvvv so that locals can cross yield points.
1008
/// static || {
1009
-/// let foo = String::from("foo"); // --+
1010
-/// yield 0; // | <- crosses yield point!
1011
-/// println!("{}", &foo); // <----------+
+/// let foo = String::from("foo");
+/// let foo_ref = &foo; // ------+
+/// yield 0; // | <- crosses yield point!
1012
+/// println!("{foo_ref}"); // <--+
1013
/// yield foo.len();
1014
/// }
1015
0 commit comments