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
My project upgraded to 1.1.0, but compilation fails #631
Comments
You can try deleting the If this does not help we can have a closer look (I tried updating some of my repos and it went fine as far as I can tell...) /Per |
Same. The exact error: error[E0061]: this function takes 6 arguments but 5 arguments were supplied
--> src/bin/main.rs:5:1
|
5 | #[rtic::app(device = stm32f1xx_hal::pac, peripherals = true, dispatchers = [PVD, WWDG, RTC, SPI1])]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| supplied 5 arguments
| expected 6 arguments
|
note: function defined here
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rtic-1.1.0/src/export.rs:175:15
|
175 | pub unsafe fn lock<T, R>(
| ^^^^
= note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info) This is in my opinion due to |
As another datum, I'm also seeing this regression. |
New version coming up shortly (maybe already released). Please report back so we know if that solved the issue. |
Okay, the reported error has gone, but now I have another one: error: any use of this value will cause an error
--> src/bin/main.rs:5:1
|
5 | #[rtic::app(device = stm32f1xx_hal::pac, peripherals = true, dispatchers = [PVD, WWDG, RTC, SPI1])]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift left by `35_u32`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info) The generated code causing the problem: } const MASKS : [u32 ; 3] =
[0 | 1 << stm32f1xx_hal :: pac :: Interrupt :: SPI1 as u32, 0 | 1 << SPI1 is 35... |
The MASKs are only used for the M0/M0++ and they can have only 32 vectors. This code should never be active if not on thumbv7m (m3 and above), so I don't really know why this happens. Could be that the code is generated but not used, and some warning turned into an error. I'm not by my dev computer so cannot test currently, but I naively assume that the tests should have caught such warnings/errors. |
you could try just allow this warning for the moment... (we could use an unchecked version in the implementation) |
stm32f103 is M3, so thumbv7m, right? If I allow this warning I get a bunch of |
I guess that's related to the over-shifting. Are these hard errors or just warnings? |
I assume you have set the target to thumv7m right? |
yes. I don't see any code that would disable the masks generation on thumbv7m. So it's probably as you've written, it's generated, but not used, but Rust still disallows it. I don't know how to remove those |
I will try fixing it tomorrow then. I guess it slipped through the CI since we are testing on a fake device. I never seen this error, could be that the compiler has become more picky. You could try with an older compiler (but then again some other stuff might fail (at least on stable.) |
Just hit the over-shift lint (STM32L4, M4F target) when trying to run some updates |
We are working on a real fix, in the meantime you can try: #![allow(const_err)] As seen the problem occurs only in case an interrupt with a vector index >31 is actually used (causing the over-shift in non-used code). Our tests did not cover this edge case, so it slipped by. Thanks @Crzyrndm and @mryndzionek for the quick and prompt reporting. /Per |
This works around rtic-rs/rtic#631
In case it is useful, here is a recipe to reproduce the issue:
The error I currently get is the following:
This is with rustc version 1.60.0 (7737e0b5c 2022-04-04) |
I would also like to add that |
Hmm, strange, @mryndzionek do you have a minimal reproducable example? |
Yes, just use the recipe from @astraw above, but run |
For now we have yanked the 1.1 release until we get it properly fixed. |
Did anyone have a go with the released I propose we close this issue, but if there's something it is easy to reopen 👍 |
Yes, I just checked and 1.1.2 works for me. Thanks. |
Yes, works for me also. |
My project upgraded to 1.1.0, but compilation fails most likely due to
cortex-m-rtic-macros
not being updated to1.1.0
in mainCargo.toml
. The root cause seems to be this commit missing (MASKS
missing in macros/src/codegen/util.rs).The text was updated successfully, but these errors were encountered: