Skip to content

Commit 8c1b6bb

Browse files
bors[bot]taiki-e
andauthored
Merge #176
176: Fix support for lifetime bounds r=taiki-e a=taiki-e Co-authored-by: Taiki Endo <te316e89@gmail.com>
2 parents 8a5ed63 + aeb68c1 commit 8c1b6bb

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pin-project-internal/src/pin_project/derive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,10 @@ impl Context {
540540
.generics
541541
.lifetimes()
542542
.enumerate()
543-
.map(|(i, l)| {
543+
.map(|(i, LifetimeDef { lifetime, .. })| {
544544
let field_ident = format_ident!("__lifetime{}", i);
545545
quote! {
546-
#field_ident: &#l ()
546+
#field_ident: &#lifetime ()
547547
}
548548
})
549549
.collect();

tests/pin_project.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,11 @@ fn trait_bounds_on_type_generics() {
272272

273273
impl<T> Static for Struct7<T> {}
274274

275-
// TODO: support this
276-
// #[pin_project]
277-
// pub struct Struct8<'a, 'b: 'a> {
278-
// field1: &'a u8,
279-
// field2: &'b u8,
280-
// }
275+
#[pin_project]
276+
pub struct Struct8<'a, 'b: 'a> {
277+
field1: &'a u8,
278+
field2: &'b u8,
279+
}
281280

282281
#[pin_project]
283282
pub struct TupleStruct<'a, T: ?Sized>(&'a mut T);

0 commit comments

Comments
 (0)