taiki-e / pin-project-lite

A lightweight version of pin-project written with declarative macros.
https://docs.rs/pin-project-lite
Apache License 2.0
226 stars 16 forks source link

`no such field` in `new` function #81

Closed FH0 closed 1 year ago

FH0 commented 1 year ago
pin_project! {
    struct Test<T> {
        value: T,
    }
}

impl<T: Unpin> Test<T> {
    pub fn new(value: T) -> Self {
        Self { value }
    }
}

image

I am a novice learning Rust. Compiler is unhappy after I added pin_project! to Test.

taiki-e commented 1 year ago

This is rust-analyzer bug. Compilation passes without problems. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fd79e5cda66a9d465cb050c889af5bb1