-
Notifications
You must be signed in to change notification settings - Fork 177
Define MSRV to be 1.31.0 and unconditionally use const-fn #159
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
Conversation
|
r? @thejpster (rust_highfive has picked a reviewer for you, use r? to override) |
|
Weird. https://github.com/rust-embedded/wg/blob/master/ops/msrv.md claims |
I think this is just meant to be an example of a feature using a higher MSRV rather than specifically written to indicate const-fn needs 1.34. |
|
@therealprof I've updated this PR to remove the breaking edition-2018 stuff, which I'll do in another PR. This now passes CI. |
therealprof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
bors r+ |
159: Define MSRV to be 1.31.0 and unconditionally use const-fn r=therealprof a=adamgreig As per https://github.com/rust-embedded/wg/blob/master/ops/msrv.md we should have a defined MSRV for this crate. This PR proposes setting it to 1.31 to allow use of `const-fn` from bare-metal by default, and updates `Cargo.toml` accordingly. It also sets the edition to 2018, permitted by an MSRV of 1.31. Since this PR _introduces_ an MSRV I propose it not requiring a semver bump, and we instead would look to release this change as `0.6.1`. Closes #153. Co-authored-by: Adam Greig <adam@ael.co.uk> Co-authored-by: Adam Greig <adam@adamgreig.com>
Build succeeded |
159: static mut transform: forward `#[cfg]` r=therealprof a=japaric
as reported in japaric/cortex-m-rtfm#110 the following code fails to compile
``` rust
#[entry]
fn main() -> ! {
#[cfg(something)]
static mut FOO: u32 = 0; //~ ERROR cannot find value `FOO` in this scope
}
```
the issue is that the expansion of the static looks like this:
``` rust
let FOO = unsafe {
#[cfg(never)]
static mut FOO: u32 = 0;
&mut FOO
};
```
so when the `#[cfg]` evals to false the static is gone but the `let FOO` is not
removed.
this PR forwards `#[cfg]` attributes to the `let` expression and fixes the error
``` rust
#[cfg(never)] // <- added
let FOO = unsafe {
#[cfg(never)]
static mut FOO: u32 = 0;
&mut FOO
};
```
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
As per https://github.com/rust-embedded/wg/blob/master/ops/msrv.md we should have a defined MSRV for this crate. This PR proposes setting it to 1.31 to allow use of
const-fnfrom bare-metal by default, and updatesCargo.tomlaccordingly. It also sets the edition to 2018, permitted by an MSRV of 1.31.Since this PR introduces an MSRV I propose it not requiring a semver bump, and we instead would look to release this change as
0.6.1.Closes #153.