-
Notifications
You must be signed in to change notification settings - Fork 211
(One representation of) the new gpio::Pin
/spi::Spi
types appears to kill rust-analyzer
#461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sadly. |
@ryankurte use hal::gpio::{PA5, PA6, PA7};
type Spi1 =
Spi<SPI1, (PA5<Alternate<5>>, PA5<Alternate<5>>, PA7<Alternate<5>>), TransferModeNormal>; |
unfortunately i'm too far along the bleeding edge to back down at this point 🤣
brilliant, that resolves it, thanks! also these changes are -super cool-, having a great experience with the updated HAL, hugely appreciate all your effort stm32-rs folks ^_^ |
gpio::Pin
/spi::Spi
types appear to kill rust-analyzergpio::Pin
/spi::Spi
types appears to kill rust-analyzer
Now it's possible also use hal::gpio::{PA5, PA6, PA7, AF5};
type Spi1 = hal::spi::Spi1<(PA5<AF5>, PA6<AF5>, PA7<AF5>)>; |
ooh nice! looks like y'all are having some real fun with const types ^_^ thanks for all the help, seems like there's lots of good workarounds |
running
rustc 1.61.0
, if you happen to try to alias a Pin into an SPI device,rust-analyzer
explodes...tested with rust-analyzer prerelease via vscode and nighly from rustup. this appears to be a reproduction of rust-lang/rust-analyzer#10390, with a suggestion this can be avoided by altering the ordering constraint to types before consts, eg.
Pin<MODE = Input<Floating>, const P: char, const N: u8>
instead ofPin<const P: char, const N: u8, MODE = Input<Floating>>
.i am not sure whether where is an alternate representation that would not trigger this, or if it is worth changing here or waiting for a fix, but, figured i'd leave some footprints for anyone else that runs into the following errors:
The text was updated successfully, but these errors were encountered: