-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
MSRV #443
Comments
Let me investigate. Anyways we should document our MSRV :) |
Hi @Dirbaio, I can observe the same behavior with this minimal example on rust macro_rules! net_log {
(trace, $($arg:expr),*) => { defmt::trace!($($arg),*); };
(debug, $($arg:expr),*) => { defmt::debug!($($arg),*); };
}
fn main() {
let endpoint = 1;
let dhcp_repr = 2;
defmt::trace!("DHCP send renew to {}: {:?}", endpoint, dhcp_repr); // works
net_log!(trace, "DHCP send renew to {}: {:?}", endpoint, dhcp_repr); // fails
} But there is a funny thing: Although Therefore I assume this is actually an issue in how expanded code(Generated using #![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
fn main() {
let endpoint = 1;
let dhcp_repr = 2;
// defmt_trace!
{
if true && false || !true && false {
match (&(endpoint), &(dhcp_repr)) {
(arg0, arg1) => {
if let Some(mut _fmt_) = defmt::export::acquire() {
_fmt_ . header (& defmt :: export :: istr ({ # [link_section = ".defmt.{\"package\":\"local\",\"tag\":\"defmt_trace\",\"data\":\"DHCP send renew to {}: {:?}\",\"disambiguator\":\"6227765310601133464\"}"] # [export_name = "{\"package\":\"local\",\"tag\":\"defmt_trace\",\"data\":\"DHCP send renew to {}: {:?}\",\"disambiguator\":\"6227765310601133464\"}"] static DEFMT_LOG_STATEMENT : u8 = 0 ; & DEFMT_LOG_STATEMENT as * const u8 as usize })) ;
_fmt_.fmt(arg0, false);
_fmt_.fmt(arg1, false);
_fmt_.finalize();
defmt::export::release(_fmt_)
}
}
}
}
};
// net_log!
{
if true && false || !true && false {
match (&(endpoint), &(dhcp_repr)) {
(arg0, arg1) => {
if let Some(mut _fmt_) = defmt::export::acquire() {
_fmt_ . header (& defmt :: export :: istr ({ # [link_section = ".defmt.{\"package\":\"local\",\"tag\":\"defmt_trace\",\"data\":\"DHCP send renew to {}: {:?}\",\"disambiguator\":\"12094526559404328479\"}"] # [export_name = "{\"package\":\"local\",\"tag\":\"defmt_trace\",\"data\":\"DHCP send renew to {}: {:?}\",\"disambiguator\":\"12094526559404328479\"}"] static DEFMT_LOG_STATEMENT : u8 = 0 ; & DEFMT_LOG_STATEMENT as * const u8 as usize })) ;
_fmt_.fmt(arg0, false);
_fmt_.fmt(arg1, false);
_fmt_.finalize();
defmt::export::release(_fmt_)
}
}
}
}
};
} |
I don't think we want to add a restrictive MSRV like "1.40+" because then bumping the MSRV requires a semver bump and each time we semver bump The Embedded WG dropped their fixed MSRV and moved to 'compiles on latest stable'. We effectively have the same policy (though not documented; it's enforced by CI) and I would keep that way. |
Yes, though it'd be nice to have it documented somewhere, like in the readme :) |
What's defmt's MSRV (Minimum Supported Rust Version)?
I've found defmt uses the following features that restrict the MSRV:
matches!
macro: 1.42+u64::MAX
const: 1.43+function-like proc macros in expression context: 1.45+
However with 1.45 it won't build, I'm not sure why. code here
1.46 works fine.
I thought I'd ask first, so if 1.45 is unsupported I can skip debugging it...
The text was updated successfully, but these errors were encountered: