Skip to content

Commit e50ed2d

Browse files
committed
Merge remote-tracking branch 'knrling'
2 parents 12105e6 + fde51d5 commit e50ed2d

File tree

18 files changed

+192
-70
lines changed

18 files changed

+192
-70
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- windows-latest
2424
toolchain:
2525
- "stable"
26-
- "1.76" # MSRV
26+
- "1.81" # host MSRV
2727
runs-on: ${{ matrix.os }}
2828
timeout-minutes: 20
2929
steps:
@@ -36,14 +36,14 @@ jobs:
3636
if: matrix.os == 'ubuntu-latest'
3737
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
3838
- name: Check that all crates that can be compiled for the host build, check that defmt compiles with different features, run all unit tests on the host
39-
run: cargo xtask -d test-host ${{ matrix.toolchain == '1.76' && '--skip-ui-tests' || '' }}
39+
run: cargo xtask -d test-host ${{ matrix.toolchain == '1.81' && '--skip-ui-tests' || '' }}
4040

4141
cross:
4242
strategy:
4343
matrix:
4444
toolchain:
4545
- "stable"
46-
- "1.76" # MSRV
46+
- "1.76" # firmware MSRV
4747
runs-on: ubuntu-latest
4848
steps:
4949
- uses: actions/checkout@v4
@@ -59,7 +59,7 @@ jobs:
5959
matrix:
6060
toolchain:
6161
- "1.87" # we pin clippy because it keeps adding new lints
62-
- "1.76" # MSRV
62+
- "1.76" # firmware MSRV
6363
runs-on: ubuntu-latest
6464
steps:
6565
- uses: actions/checkout@v4
@@ -71,17 +71,27 @@ jobs:
7171
run: cargo xtask test-lint-cross
7272

7373
cargo-deny:
74-
runs-on: ubuntu-latest
74+
runs-on: ubuntu-22.04
75+
strategy:
76+
matrix:
77+
checks:
78+
- advisories
79+
- bans licenses sources
80+
# Prevent sudden announcement of a new advisory from failing ci:
81+
continue-on-error: ${{ matrix.checks == 'advisories' }}
7582
steps:
76-
- uses: actions/checkout@v4
77-
- uses: EmbarkStudios/cargo-deny-action@v1
83+
- uses: actions/checkout@v4
84+
- uses: EmbarkStudios/cargo-deny-action@v2
85+
with:
86+
command: check ${{ matrix.checks }}
87+
rust-version: stable
7888

7989
lint:
8090
strategy:
8191
matrix:
8292
toolchain:
8393
- "1.87" # we pin clippy because it keeps adding new lints
84-
- "1.76" # MSRV
94+
- "1.81" # host MSRV
8595
runs-on: ubuntu-latest
8696
timeout-minutes: 10
8797
steps:
@@ -98,7 +108,7 @@ jobs:
98108
matrix:
99109
toolchain:
100110
- "stable"
101-
- "1.76" # MSRV
111+
- "1.81" # host MSRV
102112
runs-on: ubuntu-latest
103113
steps:
104114
- uses: actions/checkout@v4
@@ -114,7 +124,7 @@ jobs:
114124
matrix:
115125
toolchain:
116126
- "stable"
117-
- "1.76" # MSRV
127+
- "1.81" # host MSRV
118128
runs-on: ubuntu-latest
119129
timeout-minutes: 10
120130
steps:
@@ -135,8 +145,8 @@ jobs:
135145
matrix:
136146
toolchain:
137147
- stable
138-
- "1.76" # MSRV
139-
- nightly # some tests use unstable features
148+
- "1.81" # host MSRV
149+
- nightly-2025-08-05 # some tests use unstable features, but avoid LLVM21 due to https://github.com/rust-lang/rust/issues/146065
140150
runs-on: ubuntu-latest
141151
steps:
142152
- uses: actions/checkout@v4
@@ -156,7 +166,7 @@ jobs:
156166
matrix:
157167
toolchain:
158168
- "stable"
159-
- "1.76" # MSRV
169+
- "1.81" # host MSRV
160170
runs-on: ubuntu-latest
161171
steps:
162172
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@ We have several packages which live in this repository. Changes are tracked sepa
5252

5353
### [defmt-next]
5454

55-
* [#983]: Add `Format` implementation for core::num::Wrapping<T>
5655
* [#960]: Fix `Format` not accepting multiple helper attribute instances
5756
* [#937]: add support for `#[defmt(transparent)]` on `Format` derive
5857
* [#959]: Missing "unstable-test" cfg in tests module
5958
* [#956]: Link LICENSE-* in the crate folder
6059
* [#955]: Allow using the `defmt/alloc` feature on bare metal ESP32-S2
6160
* [#972]: Fix logic bug in env_filter
61+
* [#983]: Add `Format` implementation for core::num::Wrapping<T>
62+
* [#974] Ensure typechecking is still performed on disabled log statement.
63+
* [#960] Fix `Format` not accepting multiple helper attribute instances
64+
* [#937] add support for `#[defmt(transparent)]` on `Format` derive
65+
* [#959] Missing "unstable-test" cfg in tests module
66+
* [#956] Link `LICENSE-*` in the crate folder
67+
* [#955] Allow using the `defmt/alloc` feature on bare metal ESP32-S2
68+
* [#972] Fix logic bug in env_filter
6269

6370
### [defmt-v1.0.1] (2025-04-01)
6471

65-
* [#954]: Fix accidental breaking change in `Format` macro
72+
* [#954] Fix accidental breaking change in `Format` macro
6673

6774
### [defmt-v1.0.0] (2025-04-01)
6875

@@ -93,7 +100,7 @@ We have several packages which live in this repository. Changes are tracked sepa
93100
* [#871] Set MSRV to Rust 1.76
94101
* [#869] `macros`: Add missing type hints
95102
* [#865] `defmt`: Replace proc-macro-error with proc-macro-error2
96-
* [#858] `defmt`: Implement "passthrough" trait impls for *2Format wrappers
103+
* [#858] `defmt`: Implement "passthrough" trait impls for `*2Format` wrappers
97104
* [#857] Add an octal display hint (`:o`)
98105
* [#856] `defmt`: Add a `Format` impl for `PanicInfo` and related types.
99106
* [#852] `CI`: Update mdbook to v0.4.40
@@ -509,8 +516,10 @@ Initial release
509516

510517
### [defmt-print-next]
511518

519+
* [#985] Add `--set-addr` option to actively set the `_SEGGER_RTT` address
512520
* [#952] Support sending dtr on connection for serial port input
513521
* [#965] Also support `--log-format=online` or `--log-format=default`
522+
* [#986] Bump MSRV to 1.81
514523

515524
### [defmt-print-v1.0.0] (2025-04-01)
516525

@@ -590,7 +599,9 @@ Initial release
590599

591600
### [defmt-decoder-next]
592601

602+
* [#990] improve version mismatch error message, don't mention probe-run.
593603
* [#958] Update to object 0.36
604+
* [#986] Bump MSRV to 1.81
594605

595606
### [defmt-decoder-v1.0.0] (2025-04-01)
596607

@@ -663,7 +674,8 @@ Initial release
663674

664675
### [defmt-parser-next]
665676

666-
* [#956]: Link LICENSE-* in the crate folder
677+
* [#956] Link `LICENSE-*` in the crate folder
678+
* [#986] Bump MSRV to 1.81
667679

668680
### [defmt-parser-v1.0.0] (2025-04-01)
669681

@@ -701,7 +713,8 @@ Initial release
701713

702714
> Transmit defmt log messages over the RTT (Real-Time Transfer) protocol
703715
704-
[defmt-rtt-next]: https://github.com/knurling-rs/defmt/compare/defmt-rtt-v1.0.0...main
716+
[defmt-rtt-next]: https://github.com/knurling-rs/defmt/compare/defmt-rtt-v1.1.0...main
717+
[defmt-rtt-v1.1.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v1.1.0
705718
[defmt-rtt-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v1.0.0
706719
[defmt-rtt-v0.4.2]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v0.4.2
707720
[defmt-rtt-v0.4.1]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v0.4.1
@@ -714,6 +727,8 @@ Initial release
714727

715728
### [defmt-rtt-next]
716729

730+
### [defmt-rtt-v1.1.0] (2025-10-09)
731+
717732
* [#968] Add `in_blocking_mode` public method
718733

719734
### [defmt-rtt-v1.0.0] (2025-04-01)
@@ -919,7 +934,7 @@ Initial release
919934

920935
### [defmt-json-schema-next]
921936

922-
* No changes
937+
* [#986] Bump MSRV to 1.78
923938

924939
### [defmt-json-schema-v0.1.0] (2022-03-10)
925940

@@ -949,6 +964,9 @@ Initial release
949964

950965
---
951966

967+
[#990]: https://github.com/knurling-rs/defmt/pull/990
968+
[#986]: https://github.com/knurling-rs/defmt/pull/986
969+
[#974]: https://github.com/knurling-rs/defmt/pull/974
952970
[#972]: https://github.com/knurling-rs/defmt/pull/972
953971
[#968]: https://github.com/knurling-rs/defmt/pull/968
954972
[#965]: https://github.com/knurling-rs/defmt/pull/965
@@ -964,6 +982,7 @@ Initial release
964982
[#945]: https://github.com/knurling-rs/defmt/pull/945
965983
[#943]: https://github.com/knurling-rs/defmt/pull/943
966984
[#940]: https://github.com/knurling-rs/defmt/pull/940
985+
[#937]: https://github.com/knurling-rs/defmt/pull/937
967986
[#938]: https://github.com/knurling-rs/defmt/pull/938
968987
[#935]: https://github.com/knurling-rs/defmt/pull/935
969988
[#916]: https://github.com/knurling-rs/defmt/pull/916

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ This repository contains the following packages:
2525

2626
## MSRV
2727

28-
The minimum supported Rust version is 1.76 (or Ferrocene 24.05). `defmt` is tested against the latest stable Rust version and the MSRV.
28+
The minimum supported Rust version is 1.76 (or Ferrocene 24.05) for the crates that cross-compile to your microcontroller. The minimum supported Rust version is 1.81 for all host-side crates.
29+
30+
`defmt` is tested against the latest stable Rust version and the MSRV.
2931

3032
## Developer Information
3133

book/src/hints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The CBOR display hint is useful when CBOR data is in memory, especially before f
5353
# Ok(())
5454
# }
5555
# fn main() -> Result<(), ()> {
56-
let id_cred = &[0xa1, 0x04, 0x44, 0x6b, 0x69, 0x64, 0x31];
56+
let id_cred = [0xa1, 0x04, 0x44, 0x6b, 0x69, 0x64, 0x31].as_slice();
5757

5858
defmt::info!("Peer ID: {=[u8]:cbor}", id_cred); // -> INFO Peer ID: {4: 'kid1'}
5959
let parsed = parse(id_cred)?;

decoder/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ into formatted strings. It is used by
1010

1111
## MSRV
1212

13-
The minimum supported Rust version is 1.76 (or Ferrocene 24.05). `defmt` is tested against the latest stable Rust version and the MSRV.
13+
The minimum supported Rust version is 1.81. `defmt` is tested against the latest stable Rust version and the MSRV.
1414

1515
## Support
1616

decoder/defmt-json-schema/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This library describes the JSON output from
99

1010
## MSRV
1111

12-
The minimum supported Rust version is 1.76 (or Ferrocene 24.05). `defmt` is tested against the latest stable Rust version and the MSRV.
12+
The minimum supported Rust version is 1.81. `defmt` is tested against the latest stable Rust version and the MSRV.
1313

1414
## Support
1515

decoder/src/elf2table/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub fn parse_impl(elf: &[u8], check_version: bool) -> Result<Option<Table>, anyh
229229
fn check_version(version: &str) -> Result<(), String> {
230230
if !DEFMT_VERSIONS.contains(&version) {
231231
let msg = format!(
232-
"defmt wire format version mismatch: firmware is using {}, `probe-run` supports {}\nsuggestion: use a newer version of `defmt` or `cargo install` a different version of `probe-run` that supports defmt {}",
232+
"defmt wire format version mismatch: firmware is using {}, this tool supports {}\nsuggestion: install a newer version of this tool that supports defmt wire format version {}",
233233
version, DEFMT_VERSIONS.join(", "), version
234234
);
235235

defmt/tests/ui.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#[test]
22
fn ui() {
3+
// Run UI tests with logging enabled
4+
std::env::set_var("DEFMT_LOG", "trace");
5+
36
// only test error messages on the stable channel (nightly may change too often)
47
if rustc_version::version_meta()
58
.map(|meta| meta.channel == rustc_version::Channel::Stable)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
struct Foo;
2+
3+
fn main() {
4+
defmt::info!("{}", Foo)
5+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0277]: the trait bound `Foo: Format` is not satisfied
2+
--> tests/ui/log-missing-format-impl.rs:4:5
3+
|
4+
4 | defmt::info!("{}", Foo)
5+
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Format` is not implemented for `Foo`
6+
|
7+
= help: the following other types implement trait `Format`:
8+
&T
9+
&mut T
10+
()
11+
(T0, T1)
12+
(T0, T1, T2)
13+
(T0, T1, T2, T3)
14+
(T0, T1, T2, T3, T4)
15+
(T0, T1, T2, T3, T4, T5)
16+
and $N others
17+
note: required by a bound in `defmt::export::fmt`
18+
--> src/export/mod.rs
19+
|
20+
| pub fn fmt<T: Format + ?Sized>(f: &T) {
21+
| ^^^^^^ required by this bound in `fmt`
22+
= note: this error originates in the macro `defmt::info` (in Nightly builds, run with -Z macro-backtrace for more info)

0 commit comments

Comments
 (0)