From a9fb3054225008d7a2da00e112cf3b916a81e9bf Mon Sep 17 00:00:00 2001 From: Daniel Trnka Date: Tue, 24 Feb 2026 20:49:26 +0100 Subject: [PATCH 1/7] fix: support large min/max values without precision loss Min/max values are no longer represented as f64 internally that caused precision loss or value that couldnt fit in u64. For example 2**64 was represented as 18446744073709552000 instead of 18446744073709551615. --- src/lib.rs | 16 +++++----- src/signal_type.rs | 4 +-- .../dbc-cantools/padding_bit_order.snap.rs | 12 +++---- .../padding_bit_order.snap.stderr | 32 ------------------- tests/snapshots.rs | 1 - 5 files changed, 16 insertions(+), 49 deletions(-) delete mode 100644 tests-snapshots/dbc-cantools/padding_bit_order.snap.stderr diff --git a/src/lib.rs b/src/lib.rs index e5654e1..99da6f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -282,8 +282,8 @@ impl Config<'_> { let typ = ValType::from_signal(signal); if typ != ValType::Bool { let sig = signal.field_name().to_uppercase(); - let min = signal.min; - let max = signal.max; + let min = &signal.min; + let max = &signal.max; writeln!(w, "pub const {sig}_MIN: {typ} = {min}_{typ};")?; writeln!(w, "pub const {sig}_MAX: {typ} = {max}_{typ};")?; } @@ -539,8 +539,8 @@ impl Config<'_> { if let FeatureConfig::Gated(..) | FeatureConfig::Always = self.check_ranges { let typ = ValType::from_signal(signal); - let min = signal.min; - let max = signal.max; + let min = &signal.min; + let max = &signal.max; writeln!(w, r"if value < {min}_{typ} || {max}_{typ} < value {{")?; { @@ -1296,13 +1296,13 @@ fn signal_to_arbitrary(signal: &Signal) -> String { match typ { ValType::Bool => "u.int_in_range(0..=1)? == 1".to_string(), ValType::F32 => { - let min = signal.min; - let max = signal.max; + let min = &signal.min; + let max = &signal.max; format!("u.float_in_range({min}_f32..={max}_f32)?") } _ => { - let min = signal.min; - let max = signal.max; + let min = &signal.min; + let max = &signal.max; format!("u.int_in_range({min}..={max})?") } } diff --git a/src/signal_type.rs b/src/signal_type.rs index 60e87c8..96b52ed 100644 --- a/src/signal_type.rs +++ b/src/signal_type.rs @@ -209,8 +209,8 @@ mod tests { value_type: sign, factor: factor as f64, offset: offset as f64, - min: 0.0, - max: 0.0, + min: can_dbc::NumericValue::Double(0.0), + max: can_dbc::NumericValue::Double(0.0), unit: String::new(), receivers: vec![], multiplexer_indicator: can_dbc::MultiplexIndicator::Plain, diff --git a/tests-snapshots/dbc-cantools/padding_bit_order.snap.rs b/tests-snapshots/dbc-cantools/padding_bit_order.snap.rs index 2a5ae93..6831d0c 100644 --- a/tests-snapshots/dbc-cantools/padding_bit_order.snap.rs +++ b/tests-snapshots/dbc-cantools/padding_bit_order.snap.rs @@ -729,7 +729,7 @@ impl Msg3 { StandardId::new_unchecked(0x4) }); pub const L_MIN: u64 = 0_u64; - pub const L_MAX: u64 = 18446744073709552000_u64; + pub const L_MAX: u64 = 18446744073709551615_u64; /// Construct new MSG3 from values pub fn new(l: u64) -> Result { let mut res = Self { raw: [0u8; 8] }; @@ -743,7 +743,7 @@ impl Msg3 { /// L /// /// - Min: 0 - /// - Max: 18446744073709552000 + /// - Max: 18446744073709551615 /// - Unit: "" /// - Receivers: E1 #[inline(always)] @@ -767,7 +767,7 @@ impl Msg3 { /// Set value of L #[inline(always)] pub fn set_l(&mut self, value: u64) -> Result<(), CanError> { - if value < 0_u64 || 18446744073709552000_u64 < value { + if value < 0_u64 || 18446744073709551615_u64 < value { return Err(CanError::ParameterOutOfRange { message_id: Msg3::MESSAGE_ID, }); @@ -844,7 +844,7 @@ impl Msg4 { StandardId::new_unchecked(0x5) }); pub const M_MIN: u64 = 0_u64; - pub const M_MAX: u64 = 18446744073709552000_u64; + pub const M_MAX: u64 = 18446744073709551615_u64; /// Construct new MSG4 from values pub fn new(m: u64) -> Result { let mut res = Self { raw: [0u8; 8] }; @@ -858,7 +858,7 @@ impl Msg4 { /// M /// /// - Min: 0 - /// - Max: 18446744073709552000 + /// - Max: 18446744073709551615 /// - Unit: "" /// - Receivers: E1 #[inline(always)] @@ -882,7 +882,7 @@ impl Msg4 { /// Set value of M #[inline(always)] pub fn set_m(&mut self, value: u64) -> Result<(), CanError> { - if value < 0_u64 || 18446744073709552000_u64 < value { + if value < 0_u64 || 18446744073709551615_u64 < value { return Err(CanError::ParameterOutOfRange { message_id: Msg4::MESSAGE_ID, }); diff --git a/tests-snapshots/dbc-cantools/padding_bit_order.snap.stderr b/tests-snapshots/dbc-cantools/padding_bit_order.snap.stderr deleted file mode 100644 index c9101cd..0000000 --- a/tests-snapshots/dbc-cantools/padding_bit_order.snap.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error: literal out of range for `u64` - --> tests-snapshots/dbc-cantools/padding_bit_order.snap.rs:732:28 - | -732 | pub const L_MAX: u64 = 18446744073709552000_u64; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the literal `18446744073709552000_u64` does not fit into the type `u64` whose range is `0..=18446744073709551615` - = note: `#[deny(overflowing_literals)]` on by default - -error: literal out of range for `u64` - --> tests-snapshots/dbc-cantools/padding_bit_order.snap.rs:770:29 - | -770 | if value < 0_u64 || 18446744073709552000_u64 < value { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the literal `18446744073709552000_u64` does not fit into the type `u64` whose range is `0..=18446744073709551615` - -error: literal out of range for `u64` - --> tests-snapshots/dbc-cantools/padding_bit_order.snap.rs:847:28 - | -847 | pub const M_MAX: u64 = 18446744073709552000_u64; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the literal `18446744073709552000_u64` does not fit into the type `u64` whose range is `0..=18446744073709551615` - -error: literal out of range for `u64` - --> tests-snapshots/dbc-cantools/padding_bit_order.snap.rs:885:29 - | -885 | if value < 0_u64 || 18446744073709552000_u64 < value { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the literal `18446744073709552000_u64` does not fit into the type `u64` whose range is `0..=18446744073709551615` diff --git a/tests/snapshots.rs b/tests/snapshots.rs index c192b7c..d02de63 100644 --- a/tests/snapshots.rs +++ b/tests/snapshots.rs @@ -187,7 +187,6 @@ static BAD_TESTS: &[&str] = &[ "long_names_multiple_relations_dumped.snap.rs", "multiplex_2.snap.rs", "multiplex_2_dumped.snap.rs", - "padding_bit_order.snap.rs", "signed.snap.rs", // "FORD_CADS.snap.rs", From 9571bbe54efaca10f4387b4b41f8820a2bc03335 Mon Sep 17 00:00:00 2001 From: Daniel Trnka Date: Sun, 1 Mar 2026 17:14:58 +0100 Subject: [PATCH 2/7] dep temp --- Cargo.lock | 3 +-- Cargo.toml | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fdd5623..bc90bbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,8 +144,7 @@ dependencies = [ [[package]] name = "can-dbc" version = "8.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912874d84099e530055bac10893f2d2b09c63bcf41c02e854e42ca42ec33ade1" +source = "git+https://github.com/trnila/can-dbc?rev=3a074924789c59954905186261133825907ed678#3a074924789c59954905186261133825907ed678" dependencies = [ "can-dbc-pest", "encoding_rs", diff --git a/Cargo.toml b/Cargo.toml index a3d4799..5ed7dda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,3 +67,6 @@ default-members = ["."] [package.metadata.docs.rs] # Indicates features that docs.rs should enable when building documentation. features = ["std"] + +[patch.crates-io] +can-dbc = { git = "https://github.com/trnila/can-dbc", rev = "3a074924789c59954905186261133825907ed678" } From 1ea6bdedb4a4eebfd133d13380d928ab468acc3d Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 20 Mar 2026 01:53:55 -0400 Subject: [PATCH 3/7] bump to can-dbc v9 --- Cargo.lock | 330 ++++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 5 +- 2 files changed, 250 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc90bbf..64da682 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -28,15 +28,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.101" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "approx" @@ -94,7 +94,7 @@ version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "cexpr", "clang-sys", "itertools", @@ -116,9 +116,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "bitvec" @@ -143,8 +143,9 @@ dependencies = [ [[package]] name = "can-dbc" -version = "8.1.0" -source = "git+https://github.com/trnila/can-dbc?rev=3a074924789c59954905186261133825907ed678#3a074924789c59954905186261133825907ed678" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "981d5d67fc4c1d4822a3ff07095e69453099981d93eb4cd1d8ed9c5ec3549890" dependencies = [ "can-dbc-pest", "encoding_rs", @@ -199,9 +200,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.55" +version = "1.2.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" dependencies = [ "find-msvc-tools", "shlex", @@ -235,9 +236,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.57" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" dependencies = [ "clap_builder", "clap_derive", @@ -245,9 +246,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.57" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -257,9 +258,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" dependencies = [ "heck", "proc-macro2", @@ -269,15 +270,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.7" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "console" @@ -444,6 +445,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "funty" version = "2.0.0" @@ -462,14 +469,15 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "libc", "r-efi", "wasip2", + "wasip3", ] [[package]] @@ -478,6 +486,15 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + [[package]] name = "hashbrown" version = "0.16.1" @@ -490,6 +507,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "indexmap" version = "2.13.0" @@ -497,7 +520,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.16.1", + "serde", + "serde_core", ] [[package]] @@ -529,15 +554,21 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "leb128fmt" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.180" +version = "0.2.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libloading" @@ -551,9 +582,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "log" @@ -563,9 +594,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "minimal-lexical" @@ -600,9 +631,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" @@ -612,9 +643,9 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "pest" -version = "2.8.5" +version = "2.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9eb05c21a464ea704b53158d358a31e6425db2f63a1a7312268b05fe2b75f7" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" dependencies = [ "memchr", "ucd-trie", @@ -622,9 +653,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.8.5" +version = "2.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f9dbced329c441fa79d80472764b1a2c7e57123553b8519b36663a2fb234ed" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" dependencies = [ "pest", "pest_generator", @@ -632,9 +663,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.8.5" +version = "2.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bb96d5051a78f44f43c8f712d8e810adb0ebf923fc9ed2655a7f66f63ba8ee5" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" dependencies = [ "pest", "pest_meta", @@ -645,9 +676,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.8.5" +version = "2.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113b5b5e8621770cfd490cfd90b9f84ab29bd2b0e49ad83eb6d186cef2365" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" dependencies = [ "pest", "sha2", @@ -696,18 +727,18 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.3.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "radium" @@ -726,9 +757,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -738,9 +769,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -749,9 +780,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "rustc-hash" @@ -761,11 +792,11 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.10.0", + "bitflags 2.11.0", "errno", "libc", "linux-raw-sys", @@ -781,6 +812,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + [[package]] name = "serde" version = "1.0.228" @@ -864,9 +901,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.114" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -887,9 +924,9 @@ checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b" [[package]] name = "tempfile" -version = "3.24.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", "getrandom", @@ -909,9 +946,9 @@ dependencies = [ [[package]] name = "test_each_file" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2de773517ee4367314c7918f6c9ef69c201ba72bfdbffb00234c22c50a153b73" +checksum = "44619e49a1f62888c271dc50533f036363a7936f99c7cb467ca9d45224cf83b3" dependencies = [ "proc-macro2", "quote", @@ -941,9 +978,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.11+spec-1.1.0" +version = "1.0.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" +checksum = "dd28d57d8a6f6e458bc0b8784f8fdcc4b99a437936056fa122cb234f18656a96" dependencies = [ "indexmap", "serde_core", @@ -956,33 +993,33 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.5+spec-1.1.0" +version = "1.0.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +checksum = "9b320e741db58cac564e26c607d3cc1fdc4a88fd36c879568c07856ed83ff3e9" dependencies = [ "serde_core", ] [[package]] name = "toml_parser" -version = "1.0.6+spec-1.1.0" +version = "1.0.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420" dependencies = [ "winnow", ] [[package]] name = "toml_writer" -version = "1.0.6+spec-1.1.0" +version = "1.0.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" +checksum = "f17aaa1c6e3dc22b1da4b6bba97d066e354c7945cac2f7852d4e4e7ca7a6b56d" [[package]] name = "trybuild" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f614c21bd3a61bad9501d75cbb7686f00386c806d7f456778432c25cf86948a" +checksum = "47c635f0191bd3a2941013e5062667100969f8c4e9cd787c14f977265d73616e" dependencies = [ "glob", "serde", @@ -1027,9 +1064,15 @@ checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "utf8parse" @@ -1062,6 +1105,49 @@ dependencies = [ "wit-bindgen", ] +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.11.0", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + [[package]] name = "winapi-util" version = "0.1.11" @@ -1161,15 +1247,97 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.14" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" [[package]] name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] [[package]] name = "wyz" @@ -1182,6 +1350,6 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.16" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 5ed7dda..8038ba7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ std = [] [dependencies] anyhow = "1.0.101" -can-dbc = "8.0.1" +can-dbc = "9.0.0" embedded-can = "0.4.1" heck = "0.5.0" prettyplease = "0.2.37" @@ -67,6 +67,3 @@ default-members = ["."] [package.metadata.docs.rs] # Indicates features that docs.rs should enable when building documentation. features = ["std"] - -[patch.crates-io] -can-dbc = { git = "https://github.com/trnila/can-dbc", rev = "3a074924789c59954905186261133825907ed678" } From 5249cf2664e15df8a6be8ea00ce8cfb29311ce98 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 20 Mar 2026 01:56:23 -0400 Subject: [PATCH 4/7] update to copyable types --- src/lib.rs | 16 ++++++++-------- src/signal_type.rs | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 99da6f2..e5654e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -282,8 +282,8 @@ impl Config<'_> { let typ = ValType::from_signal(signal); if typ != ValType::Bool { let sig = signal.field_name().to_uppercase(); - let min = &signal.min; - let max = &signal.max; + let min = signal.min; + let max = signal.max; writeln!(w, "pub const {sig}_MIN: {typ} = {min}_{typ};")?; writeln!(w, "pub const {sig}_MAX: {typ} = {max}_{typ};")?; } @@ -539,8 +539,8 @@ impl Config<'_> { if let FeatureConfig::Gated(..) | FeatureConfig::Always = self.check_ranges { let typ = ValType::from_signal(signal); - let min = &signal.min; - let max = &signal.max; + let min = signal.min; + let max = signal.max; writeln!(w, r"if value < {min}_{typ} || {max}_{typ} < value {{")?; { @@ -1296,13 +1296,13 @@ fn signal_to_arbitrary(signal: &Signal) -> String { match typ { ValType::Bool => "u.int_in_range(0..=1)? == 1".to_string(), ValType::F32 => { - let min = &signal.min; - let max = &signal.max; + let min = signal.min; + let max = signal.max; format!("u.float_in_range({min}_f32..={max}_f32)?") } _ => { - let min = &signal.min; - let max = &signal.max; + let min = signal.min; + let max = signal.max; format!("u.int_in_range({min}..={max})?") } } diff --git a/src/signal_type.rs b/src/signal_type.rs index 96b52ed..684fc31 100644 --- a/src/signal_type.rs +++ b/src/signal_type.rs @@ -196,7 +196,7 @@ impl ValType { #[cfg(test)] mod tests { - use can_dbc::{Signal, ValueType}; + use can_dbc::{ByteOrder, MultiplexIndicator, NumericValue, Signal, ValueType}; use super::*; @@ -205,15 +205,15 @@ mod tests { name: String::new(), start_bit: 0, size: u64::from(signal_size), - byte_order: can_dbc::ByteOrder::LittleEndian, + byte_order: ByteOrder::LittleEndian, value_type: sign, factor: factor as f64, offset: offset as f64, - min: can_dbc::NumericValue::Double(0.0), - max: can_dbc::NumericValue::Double(0.0), + min: NumericValue::Double(0.0), + max: NumericValue::Double(0.0), unit: String::new(), receivers: vec![], - multiplexer_indicator: can_dbc::MultiplexIndicator::Plain, + multiplexer_indicator: MultiplexIndicator::Plain, } } From 0e480bed6482bdf7cc3315f0603ca0eb76d6b50b Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 20 Mar 2026 02:17:59 -0400 Subject: [PATCH 5/7] revert back to into - if its wrong, we can use try_into, but not as --- ...ssue_184_extended_mux_cascaded.snap.stderr | 21 -- ...4_extended_mux_cascaded_dumped.snap.stderr | 84 +++-- ...d_mux_independent_multiplexors.snap.stderr | 111 +++++-- ...ndependent_multiplexors_dumped.snap.stderr | 111 +++++-- ...4_extended_mux_multiple_values.snap.stderr | 21 -- ...ded_mux_multiple_values_dumped.snap.stderr | 21 -- .../dbc-cantools/issue_199.snap.stderr | 115 ++++--- .../issue_199_extended.snap.stderr | 115 ++++--- .../dbc-cantools/multiplex_2.snap.stderr | 141 ++++++-- .../multiplex_2_dumped.snap.stderr | 306 ++++++++++++++---- tests/snapshots.rs | 3 - 11 files changed, 745 insertions(+), 304 deletions(-) delete mode 100644 tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.stderr delete mode 100644 tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.stderr delete mode 100644 tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.stderr diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.stderr deleted file mode 100644 index 95e44e8..0000000 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.rs:125:46 - | -125 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` - | - ::: $RUST/core/src/convert/num.rs - | - | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr index f6859e6..202df44 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr @@ -24,7 +24,13 @@ error[E0422]: cannot find struct, variant or union type `ExtMuxCascadedMuxAM0` i | ------------------------- similarly named struct `ExtMuxCascaded` defined here ... 195 | ExtMuxCascadedMuxAIndex::M0(ExtMuxCascadedMuxAM0 { - | ^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxCascaded` + | ^^^^^^^^^^^^^^^^^^^^ + | +help: a struct with a similar name exists + | +195 - ExtMuxCascadedMuxAIndex::M0(ExtMuxCascadedMuxAM0 { +195 + ExtMuxCascadedMuxAIndex::M0(ExtMuxCascaded { + | error[E0422]: cannot find struct, variant or union type `ExtMuxCascadedMuxAM1` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:202:49 @@ -33,7 +39,13 @@ error[E0422]: cannot find struct, variant or union type `ExtMuxCascadedMuxAM1` i | ------------------------- similarly named struct `ExtMuxCascaded` defined here ... 202 | ExtMuxCascadedMuxAIndex::M1(ExtMuxCascadedMuxAM1 { - | ^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxCascaded` + | ^^^^^^^^^^^^^^^^^^^^ + | +help: a struct with a similar name exists + | +202 - ExtMuxCascadedMuxAIndex::M1(ExtMuxCascadedMuxAM1 { +202 + ExtMuxCascadedMuxAIndex::M1(ExtMuxCascaded { + | error[E0425]: cannot find type `ExtMuxCascadedMuxAM0` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:236:37 @@ -42,7 +54,13 @@ error[E0425]: cannot find type `ExtMuxCascadedMuxAM0` in this scope | ------------------------- similarly named struct `ExtMuxCascaded` defined here ... 236 | pub fn set_m0(&mut self, value: ExtMuxCascadedMuxAM0) -> Result<(), CanError> { - | ^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxCascaded` + | ^^^^^^^^^^^^^^^^^^^^ + | +help: a struct with a similar name exists + | +236 - pub fn set_m0(&mut self, value: ExtMuxCascadedMuxAM0) -> Result<(), CanError> { +236 + pub fn set_m0(&mut self, value: ExtMuxCascaded) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtMuxCascadedMuxAM1` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:245:37 @@ -51,7 +69,13 @@ error[E0425]: cannot find type `ExtMuxCascadedMuxAM1` in this scope | ------------------------- similarly named struct `ExtMuxCascaded` defined here ... 245 | pub fn set_m1(&mut self, value: ExtMuxCascadedMuxAM1) -> Result<(), CanError> { - | ^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxCascaded` + | ^^^^^^^^^^^^^^^^^^^^ + | +help: a struct with a similar name exists + | +245 - pub fn set_m1(&mut self, value: ExtMuxCascadedMuxAM1) -> Result<(), CanError> { +245 + pub fn set_m1(&mut self, value: ExtMuxCascaded) -> Result<(), CanError> { + | error[E0592]: duplicate definitions with name `set_m0` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:236:5 @@ -86,16 +110,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -103,19 +136,25 @@ error[E0433]: failed to resolve: use of undeclared type `ExtMuxCascadedMuxAIndex --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:195:21 | 195 | ExtMuxCascadedMuxAIndex::M0(ExtMuxCascadedMuxAM0 { - | ^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxCascadedMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxCascadedMuxedA2MuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxCascadedMuxAIndex` + | +help: an enum with a similar name exists + | +195 - ExtMuxCascadedMuxAIndex::M0(ExtMuxCascadedMuxAM0 { +195 + ExtMuxCascadedMuxedA2MuxBIndex::M0(ExtMuxCascadedMuxAM0 { + | error[E0433]: failed to resolve: use of undeclared type `ExtMuxCascadedMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:202:21 | 202 | ExtMuxCascadedMuxAIndex::M1(ExtMuxCascadedMuxAM1 { - | ^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxCascadedMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxCascadedMuxedA2MuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxCascadedMuxAIndex` + | +help: an enum with a similar name exists + | +202 - ExtMuxCascadedMuxAIndex::M1(ExtMuxCascadedMuxAM1 { +202 + ExtMuxCascadedMuxedA2MuxBIndex::M1(ExtMuxCascadedMuxAM1 { + | error[E0277]: the trait bound `u16: From` is not satisfied --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:210:46 @@ -126,15 +165,24 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr index 5be93e7..01fc511 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr @@ -21,55 +21,91 @@ error[E0422]: cannot find struct, variant or union type `ExtMuxIndepMultiplexors --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:216:58 | 216 | ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM0` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 362 | pub struct ExtMuxIndepMultiplexorsMuxBM0 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM0` defined here + | +help: a struct with a similar name exists + | +216 - ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { +216 + ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxBM0 { + | error[E0422]: cannot find struct, variant or union type `ExtMuxIndepMultiplexorsMuxAM1` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:223:58 | 223 | ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 433 | pub struct ExtMuxIndepMultiplexorsMuxBM1 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM1` defined here + | +help: a struct with a similar name exists + | +223 - ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { +223 + ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxBM1 { + | error[E0422]: cannot find struct, variant or union type `ExtMuxIndepMultiplexorsMuxAM2` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:230:58 | 230 | ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM2` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 548 | pub struct ExtMuxIndepMultiplexorsMuxBM2 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM2` defined here + | +help: a struct with a similar name exists + | +230 - ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { +230 + ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxBM2 { + | error[E0425]: cannot find type `ExtMuxIndepMultiplexorsMuxAM0` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:266:16 | 266 | value: ExtMuxIndepMultiplexorsMuxAM0, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM0` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 362 | pub struct ExtMuxIndepMultiplexorsMuxBM0 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM0` defined here + | +help: a struct with a similar name exists + | +266 - value: ExtMuxIndepMultiplexorsMuxAM0, +266 + value: ExtMuxIndepMultiplexorsMuxBM0, + | error[E0425]: cannot find type `ExtMuxIndepMultiplexorsMuxAM1` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:278:16 | 278 | value: ExtMuxIndepMultiplexorsMuxAM1, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 433 | pub struct ExtMuxIndepMultiplexorsMuxBM1 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM1` defined here + | +help: a struct with a similar name exists + | +278 - value: ExtMuxIndepMultiplexorsMuxAM1, +278 + value: ExtMuxIndepMultiplexorsMuxBM1, + | error[E0425]: cannot find type `ExtMuxIndepMultiplexorsMuxAM2` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:290:16 | 290 | value: ExtMuxIndepMultiplexorsMuxAM2, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM2` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 548 | pub struct ExtMuxIndepMultiplexorsMuxBM2 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM2` defined here + | +help: a struct with a similar name exists + | +290 - value: ExtMuxIndepMultiplexorsMuxAM2, +290 + value: ExtMuxIndepMultiplexorsMuxBM2, + | error[E0592]: duplicate definitions with name `set_m0` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:264:5 @@ -125,16 +161,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -142,28 +187,37 @@ error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexors --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:216:21 | 216 | ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxIndepMultiplexorsMuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` + | +help: an enum with a similar name exists + | +216 - ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { +216 + ExtMuxIndepMultiplexorsMuxBIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { + | error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:223:21 | 223 | ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxIndepMultiplexorsMuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` + | +help: an enum with a similar name exists + | +223 - ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { +223 + ExtMuxIndepMultiplexorsMuxBIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { + | error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:230:21 | 230 | ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxIndepMultiplexorsMuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` + | +help: an enum with a similar name exists + | +230 - ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { +230 + ExtMuxIndepMultiplexorsMuxBIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { + | error[E0277]: the trait bound `u16: From` is not satisfied --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:238:46 @@ -174,15 +228,24 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr index 56ead0d..7bfe2a7 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr @@ -21,55 +21,91 @@ error[E0422]: cannot find struct, variant or union type `ExtMuxIndepMultiplexors --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:216:58 | 216 | ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM0` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 362 | pub struct ExtMuxIndepMultiplexorsMuxBM0 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM0` defined here + | +help: a struct with a similar name exists + | +216 - ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { +216 + ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxBM0 { + | error[E0422]: cannot find struct, variant or union type `ExtMuxIndepMultiplexorsMuxAM1` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:223:58 | 223 | ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 433 | pub struct ExtMuxIndepMultiplexorsMuxBM1 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM1` defined here + | +help: a struct with a similar name exists + | +223 - ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { +223 + ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxBM1 { + | error[E0422]: cannot find struct, variant or union type `ExtMuxIndepMultiplexorsMuxAM2` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:230:58 | 230 | ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM2` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 548 | pub struct ExtMuxIndepMultiplexorsMuxBM2 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM2` defined here + | +help: a struct with a similar name exists + | +230 - ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { +230 + ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxBM2 { + | error[E0425]: cannot find type `ExtMuxIndepMultiplexorsMuxAM0` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:266:16 | 266 | value: ExtMuxIndepMultiplexorsMuxAM0, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM0` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 362 | pub struct ExtMuxIndepMultiplexorsMuxBM0 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM0` defined here + | +help: a struct with a similar name exists + | +266 - value: ExtMuxIndepMultiplexorsMuxAM0, +266 + value: ExtMuxIndepMultiplexorsMuxBM0, + | error[E0425]: cannot find type `ExtMuxIndepMultiplexorsMuxAM1` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:278:16 | 278 | value: ExtMuxIndepMultiplexorsMuxAM1, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 433 | pub struct ExtMuxIndepMultiplexorsMuxBM1 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM1` defined here + | +help: a struct with a similar name exists + | +278 - value: ExtMuxIndepMultiplexorsMuxAM1, +278 + value: ExtMuxIndepMultiplexorsMuxBM1, + | error[E0425]: cannot find type `ExtMuxIndepMultiplexorsMuxAM2` in this scope --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:290:16 | 290 | value: ExtMuxIndepMultiplexorsMuxAM2, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtMuxIndepMultiplexorsMuxBM2` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 548 | pub struct ExtMuxIndepMultiplexorsMuxBM2 { | ---------------------------------------- similarly named struct `ExtMuxIndepMultiplexorsMuxBM2` defined here + | +help: a struct with a similar name exists + | +290 - value: ExtMuxIndepMultiplexorsMuxAM2, +290 + value: ExtMuxIndepMultiplexorsMuxBM2, + | error[E0592]: duplicate definitions with name `set_m0` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:264:5 @@ -125,16 +161,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -142,28 +187,37 @@ error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexors --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:216:21 | 216 | ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxIndepMultiplexorsMuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` + | +help: an enum with a similar name exists + | +216 - ExtMuxIndepMultiplexorsMuxAIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { +216 + ExtMuxIndepMultiplexorsMuxBIndex::M0(ExtMuxIndepMultiplexorsMuxAM0 { + | error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:223:21 | 223 | ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxIndepMultiplexorsMuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` + | +help: an enum with a similar name exists + | +223 - ExtMuxIndepMultiplexorsMuxAIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { +223 + ExtMuxIndepMultiplexorsMuxBIndex::M1(ExtMuxIndepMultiplexorsMuxAM1 { + | error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:230:21 | 230 | ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` - | help: an enum with a similar name exists: `ExtMuxIndepMultiplexorsMuxBIndex` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` + | +help: an enum with a similar name exists + | +230 - ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { +230 + ExtMuxIndepMultiplexorsMuxBIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { + | error[E0277]: the trait bound `u16: From` is not satisfied --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:238:46 @@ -174,15 +228,24 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.stderr deleted file mode 100644 index a1581df..0000000 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.rs:130:46 - | -130 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` - | - ::: $RUST/core/src/convert/num.rs - | - | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.stderr deleted file mode 100644 index 87b01be..0000000 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.rs:130:46 - | -130 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` - | - ::: $RUST/core/src/convert/num.rs - | - | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_199.snap.stderr b/tests-snapshots/dbc-cantools/issue_199.snap.stderr index 9d7372a..eb00399 100644 --- a/tests-snapshots/dbc-cantools/issue_199.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_199.snap.stderr @@ -2,100 +2,139 @@ error[E0425]: cannot find type `GearShifterGearShifter` in this scope --> tests-snapshots/dbc-cantools/issue_199.snap.rs:991:35 | 991 | pub fn gear_shifter(&self) -> GearShifterGearShifter { - | ^^^^^^^^^^^^^^^^^^^^^^ help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ ... 1106 | pub enum GearShifterLeftBlinker { | ------------------------------- similarly named enum `GearShifterLeftBlinker` defined here + | +help: an enum with a similar name exists + | + 991 - pub fn gear_shifter(&self) -> GearShifterGearShifter { + 991 + pub fn gear_shifter(&self) -> GearShifterLeftBlinker { + | error[E0425]: cannot find type `CruiseButtonsCruiseButtons` in this scope --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2054:37 | 2054 | pub fn cruise_buttons(&self) -> CruiseButtonsCruiseButtons { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 2268 | pub enum CruiseButtons2LkaGapButton { | ----------------------------------- similarly named enum `CruiseButtons2LkaGapButton` defined here + | +help: an enum with a similar name exists + | +2054 - pub fn cruise_buttons(&self) -> CruiseButtonsCruiseButtons { +2054 + pub fn cruise_buttons(&self) -> CruiseButtons2LkaGapButton { + | error[E0433]: failed to resolve: use of undeclared type `GearShifterGearShifter` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:994:18 | 994 | 3 => GearShifterGearShifter::Park, - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `GearShifterGearShifter` - | help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `GearShifterGearShifter` + | +help: an enum with a similar name exists + | +994 - 3 => GearShifterGearShifter::Park, +994 + 3 => GearShifterLeftBlinker::Park, + | error[E0433]: failed to resolve: use of undeclared type `GearShifterGearShifter` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:995:18 | 995 | 0 => GearShifterGearShifter::DriveLow, - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `GearShifterGearShifter` - | help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `GearShifterGearShifter` + | +help: an enum with a similar name exists + | +995 - 0 => GearShifterGearShifter::DriveLow, +995 + 0 => GearShifterLeftBlinker::DriveLow, + | error[E0433]: failed to resolve: use of undeclared type `GearShifterGearShifter` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:996:18 | 996 | _ => GearShifterGearShifter::_Other(self.gear_shifter_raw()), - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `GearShifterGearShifter` - | help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `GearShifterGearShifter` + | +help: an enum with a similar name exists + | +996 - _ => GearShifterGearShifter::_Other(self.gear_shifter_raw()), +996 + _ => GearShifterLeftBlinker::_Other(self.gear_shifter_raw()), + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2057:18 | 2057 | 6 => CruiseButtonsCruiseButtons::Cancel, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +2057 - 6 => CruiseButtonsCruiseButtons::Cancel, +2057 + 6 => CruiseButtons2LkaGapButton::Cancel, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2058:18 | 2058 | 5 => CruiseButtonsCruiseButtons::Main, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +2058 - 5 => CruiseButtonsCruiseButtons::Main, +2058 + 5 => CruiseButtons2LkaGapButton::Main, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2059:18 | 2059 | 3 => CruiseButtonsCruiseButtons::Set, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +2059 - 3 => CruiseButtonsCruiseButtons::Set, +2059 + 3 => CruiseButtons2LkaGapButton::Set, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2060:18 | 2060 | 2 => CruiseButtonsCruiseButtons::Resume, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +2060 - 2 => CruiseButtonsCruiseButtons::Resume, +2060 + 2 => CruiseButtons2LkaGapButton::Resume, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2061:18 | 2061 | 1 => CruiseButtonsCruiseButtons::None, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +2061 - 1 => CruiseButtonsCruiseButtons::None, +2061 + 1 => CruiseButtons2LkaGapButton::None, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199.snap.rs:2062:18 | 2062 | _ => CruiseButtonsCruiseButtons::_Other(self.cruise_buttons_raw()), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +2062 - _ => CruiseButtonsCruiseButtons::_Other(self.cruise_buttons_raw()), +2062 + _ => CruiseButtons2LkaGapButton::_Other(self.cruise_buttons_raw()), + | error: unreachable pattern --> tests-snapshots/dbc-cantools/issue_199.snap.rs:65:13 diff --git a/tests-snapshots/dbc-cantools/issue_199_extended.snap.stderr b/tests-snapshots/dbc-cantools/issue_199_extended.snap.stderr index 106b119..f3c5ae3 100644 --- a/tests-snapshots/dbc-cantools/issue_199_extended.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_199_extended.snap.stderr @@ -2,100 +2,139 @@ error[E0425]: cannot find type `GearShifterGearShifter` in this scope --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:941:35 | 941 | pub fn gear_shifter(&self) -> GearShifterGearShifter { - | ^^^^^^^^^^^^^^^^^^^^^^ help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ ... 1056 | pub enum GearShifterLeftBlinker { | ------------------------------- similarly named enum `GearShifterLeftBlinker` defined here + | +help: an enum with a similar name exists + | + 941 - pub fn gear_shifter(&self) -> GearShifterGearShifter { + 941 + pub fn gear_shifter(&self) -> GearShifterLeftBlinker { + | error[E0425]: cannot find type `CruiseButtonsCruiseButtons` in this scope --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1954:37 | 1954 | pub fn cruise_buttons(&self) -> CruiseButtonsCruiseButtons { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 2168 | pub enum CruiseButtons2LkaGapButton { | ----------------------------------- similarly named enum `CruiseButtons2LkaGapButton` defined here + | +help: an enum with a similar name exists + | +1954 - pub fn cruise_buttons(&self) -> CruiseButtonsCruiseButtons { +1954 + pub fn cruise_buttons(&self) -> CruiseButtons2LkaGapButton { + | error[E0433]: failed to resolve: use of undeclared type `GearShifterGearShifter` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:944:18 | 944 | 3 => GearShifterGearShifter::Park, - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `GearShifterGearShifter` - | help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `GearShifterGearShifter` + | +help: an enum with a similar name exists + | +944 - 3 => GearShifterGearShifter::Park, +944 + 3 => GearShifterLeftBlinker::Park, + | error[E0433]: failed to resolve: use of undeclared type `GearShifterGearShifter` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:945:18 | 945 | 0 => GearShifterGearShifter::DriveLow, - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `GearShifterGearShifter` - | help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `GearShifterGearShifter` + | +help: an enum with a similar name exists + | +945 - 0 => GearShifterGearShifter::DriveLow, +945 + 0 => GearShifterLeftBlinker::DriveLow, + | error[E0433]: failed to resolve: use of undeclared type `GearShifterGearShifter` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:946:18 | 946 | _ => GearShifterGearShifter::_Other(self.gear_shifter_raw()), - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `GearShifterGearShifter` - | help: an enum with a similar name exists: `GearShifterLeftBlinker` + | ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `GearShifterGearShifter` + | +help: an enum with a similar name exists + | +946 - _ => GearShifterGearShifter::_Other(self.gear_shifter_raw()), +946 + _ => GearShifterLeftBlinker::_Other(self.gear_shifter_raw()), + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1957:18 | 1957 | 6 => CruiseButtonsCruiseButtons::Cancel, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +1957 - 6 => CruiseButtonsCruiseButtons::Cancel, +1957 + 6 => CruiseButtons2LkaGapButton::Cancel, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1958:18 | 1958 | 5 => CruiseButtonsCruiseButtons::Main, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +1958 - 5 => CruiseButtonsCruiseButtons::Main, +1958 + 5 => CruiseButtons2LkaGapButton::Main, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1959:18 | 1959 | 3 => CruiseButtonsCruiseButtons::Set, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +1959 - 3 => CruiseButtonsCruiseButtons::Set, +1959 + 3 => CruiseButtons2LkaGapButton::Set, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1960:18 | 1960 | 2 => CruiseButtonsCruiseButtons::Resume, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +1960 - 2 => CruiseButtonsCruiseButtons::Resume, +1960 + 2 => CruiseButtons2LkaGapButton::Resume, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1961:18 | 1961 | 1 => CruiseButtonsCruiseButtons::None, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +1961 - 1 => CruiseButtonsCruiseButtons::None, +1961 + 1 => CruiseButtons2LkaGapButton::None, + | error[E0433]: failed to resolve: use of undeclared type `CruiseButtonsCruiseButtons` --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:1962:18 | 1962 | _ => CruiseButtonsCruiseButtons::_Other(self.cruise_buttons_raw()), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `CruiseButtonsCruiseButtons` - | help: an enum with a similar name exists: `CruiseButtons2LkaGapButton` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `CruiseButtonsCruiseButtons` + | +help: an enum with a similar name exists + | +1962 - _ => CruiseButtonsCruiseButtons::_Other(self.cruise_buttons_raw()), +1962 + _ => CruiseButtons2LkaGapButton::_Other(self.cruise_buttons_raw()), + | error: unreachable pattern --> tests-snapshots/dbc-cantools/issue_199_extended.snap.rs:69:13 diff --git a/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr b/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr index 8488d27..384ef6c 100644 --- a/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr +++ b/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr @@ -21,55 +21,91 @@ error[E0422]: cannot find struct, variant or union type `ExtendedS0M0` in this s --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:792:41 | 792 | 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M0` + | ^^^^^^^^^^^^ ... 913 | pub struct ExtendedS6M0 { | ----------------------- similarly named struct `ExtendedS6M0` defined here + | +help: a struct with a similar name exists + | +792 - 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), +792 + 0 => Ok(ExtendedS0Index::M0(ExtendedS6M0 { raw: self.raw })), + | error[E0422]: cannot find struct, variant or union type `ExtendedS0M1` in this scope --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:793:41 | 793 | 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M1` + | ^^^^^^^^^^^^ ... 1028 | pub struct ExtendedS6M1 { | ----------------------- similarly named struct `ExtendedS6M1` defined here + | +help: a struct with a similar name exists + | + 793 - 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), + 793 + 1 => Ok(ExtendedS0Index::M1(ExtendedS6M1 { raw: self.raw })), + | error[E0422]: cannot find struct, variant or union type `ExtendedS0M2` in this scope --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:794:41 | 794 | 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M2` + | ^^^^^^^^^^^^ ... 1143 | pub struct ExtendedS6M2 { | ----------------------- similarly named struct `ExtendedS6M2` defined here + | +help: a struct with a similar name exists + | + 794 - 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), + 794 + 2 => Ok(ExtendedS0Index::M2(ExtendedS6M2 { raw: self.raw })), + | error[E0425]: cannot find type `ExtendedS0M0` in this scope --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:824:37 | 824 | pub fn set_m0(&mut self, value: ExtendedS0M0) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M0` + | ^^^^^^^^^^^^ ... 913 | pub struct ExtendedS6M0 { | ----------------------- similarly named struct `ExtendedS6M0` defined here + | +help: a struct with a similar name exists + | +824 - pub fn set_m0(&mut self, value: ExtendedS0M0) -> Result<(), CanError> { +824 + pub fn set_m0(&mut self, value: ExtendedS6M0) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS0M1` in this scope --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:833:37 | 833 | pub fn set_m1(&mut self, value: ExtendedS0M1) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M1` + | ^^^^^^^^^^^^ ... 1028 | pub struct ExtendedS6M1 { | ----------------------- similarly named struct `ExtendedS6M1` defined here + | +help: a struct with a similar name exists + | + 833 - pub fn set_m1(&mut self, value: ExtendedS0M1) -> Result<(), CanError> { + 833 + pub fn set_m1(&mut self, value: ExtendedS6M1) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS0M2` in this scope --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:842:37 | 842 | pub fn set_m2(&mut self, value: ExtendedS0M2) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M2` + | ^^^^^^^^^^^^ ... 1143 | pub struct ExtendedS6M2 { | ----------------------- similarly named struct `ExtendedS6M2` defined here + | +help: a struct with a similar name exists + | + 842 - pub fn set_m2(&mut self, value: ExtendedS0M2) -> Result<(), CanError> { + 842 + pub fn set_m2(&mut self, value: ExtendedS6M2) -> Result<(), CanError> { + | error: invalid suffix `i32` for float literal --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:1269:30 @@ -123,16 +159,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -145,16 +190,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -167,16 +221,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -184,28 +247,37 @@ error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:792:21 | 792 | 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS0Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS0Index` + | +help: an enum with a similar name exists + | +792 - 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), +792 + 0 => Ok(ExtendedS6Index::M0(ExtendedS0M0 { raw: self.raw })), + | error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:793:21 | 793 | 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS0Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS0Index` + | +help: an enum with a similar name exists + | +793 - 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), +793 + 1 => Ok(ExtendedS6Index::M1(ExtendedS0M1 { raw: self.raw })), + | error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:794:21 | 794 | 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS0Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS0Index` + | +help: an enum with a similar name exists + | +794 - 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), +794 + 2 => Ok(ExtendedS6Index::M2(ExtendedS0M2 { raw: self.raw })), + | error[E0277]: the trait bound `u16: From` is not satisfied --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:798:46 @@ -216,15 +288,24 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr b/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr index 61ff698..fdd7814 100644 --- a/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr +++ b/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr @@ -21,55 +21,91 @@ error[E0422]: cannot find struct, variant or union type `ExtendedS1M0` in this s --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:793:41 | 793 | 0 => Ok(ExtendedS1Index::M0(ExtendedS1M0 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M0` + | ^^^^^^^^^^^^ ... 988 | pub struct ExtendedS6M0 { | ----------------------- similarly named struct `ExtendedS6M0` defined here + | +help: a struct with a similar name exists + | +793 - 0 => Ok(ExtendedS1Index::M0(ExtendedS1M0 { raw: self.raw })), +793 + 0 => Ok(ExtendedS1Index::M0(ExtendedS6M0 { raw: self.raw })), + | error[E0422]: cannot find struct, variant or union type `ExtendedS1M1` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:794:41 | 794 | 1 => Ok(ExtendedS1Index::M1(ExtendedS1M1 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M1` + | ^^^^^^^^^^^^ ... 1103 | pub struct ExtendedS6M1 { | ----------------------- similarly named struct `ExtendedS6M1` defined here + | +help: a struct with a similar name exists + | + 794 - 1 => Ok(ExtendedS1Index::M1(ExtendedS1M1 { raw: self.raw })), + 794 + 1 => Ok(ExtendedS1Index::M1(ExtendedS6M1 { raw: self.raw })), + | error[E0422]: cannot find struct, variant or union type `ExtendedS1M2` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:795:41 | 795 | 2 => Ok(ExtendedS1Index::M2(ExtendedS1M2 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M2` + | ^^^^^^^^^^^^ ... 1218 | pub struct ExtendedS6M2 { | ----------------------- similarly named struct `ExtendedS6M2` defined here + | +help: a struct with a similar name exists + | + 795 - 2 => Ok(ExtendedS1Index::M2(ExtendedS1M2 { raw: self.raw })), + 795 + 2 => Ok(ExtendedS1Index::M2(ExtendedS6M2 { raw: self.raw })), + | error[E0425]: cannot find type `ExtendedS1M0` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:825:37 | 825 | pub fn set_m0(&mut self, value: ExtendedS1M0) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M0` + | ^^^^^^^^^^^^ ... 988 | pub struct ExtendedS6M0 { | ----------------------- similarly named struct `ExtendedS6M0` defined here + | +help: a struct with a similar name exists + | +825 - pub fn set_m0(&mut self, value: ExtendedS1M0) -> Result<(), CanError> { +825 + pub fn set_m0(&mut self, value: ExtendedS6M0) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS1M1` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:834:37 | 834 | pub fn set_m1(&mut self, value: ExtendedS1M1) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M1` + | ^^^^^^^^^^^^ ... 1103 | pub struct ExtendedS6M1 { | ----------------------- similarly named struct `ExtendedS6M1` defined here + | +help: a struct with a similar name exists + | + 834 - pub fn set_m1(&mut self, value: ExtendedS1M1) -> Result<(), CanError> { + 834 + pub fn set_m1(&mut self, value: ExtendedS6M1) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS1M2` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:843:37 | 843 | pub fn set_m2(&mut self, value: ExtendedS1M2) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M2` + | ^^^^^^^^^^^^ ... 1218 | pub struct ExtendedS6M2 { | ----------------------- similarly named struct `ExtendedS6M2` defined here + | +help: a struct with a similar name exists + | + 843 - pub fn set_m2(&mut self, value: ExtendedS1M2) -> Result<(), CanError> { + 843 + pub fn set_m2(&mut self, value: ExtendedS6M2) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS0Index` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:865:36 @@ -94,55 +130,91 @@ error[E0422]: cannot find struct, variant or union type `ExtendedS0M0` in this s --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:867:41 | 867 | 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M0` + | ^^^^^^^^^^^^ ... 988 | pub struct ExtendedS6M0 { | ----------------------- similarly named struct `ExtendedS6M0` defined here + | +help: a struct with a similar name exists + | +867 - 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), +867 + 0 => Ok(ExtendedS0Index::M0(ExtendedS6M0 { raw: self.raw })), + | error[E0422]: cannot find struct, variant or union type `ExtendedS0M1` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:868:41 | 868 | 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M1` + | ^^^^^^^^^^^^ ... 1103 | pub struct ExtendedS6M1 { | ----------------------- similarly named struct `ExtendedS6M1` defined here + | +help: a struct with a similar name exists + | + 868 - 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), + 868 + 1 => Ok(ExtendedS0Index::M1(ExtendedS6M1 { raw: self.raw })), + | error[E0422]: cannot find struct, variant or union type `ExtendedS0M2` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:869:41 | 869 | 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M2` + | ^^^^^^^^^^^^ ... 1218 | pub struct ExtendedS6M2 { | ----------------------- similarly named struct `ExtendedS6M2` defined here + | +help: a struct with a similar name exists + | + 869 - 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), + 869 + 2 => Ok(ExtendedS0Index::M2(ExtendedS6M2 { raw: self.raw })), + | error[E0425]: cannot find type `ExtendedS0M0` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:899:37 | 899 | pub fn set_m0(&mut self, value: ExtendedS0M0) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M0` + | ^^^^^^^^^^^^ ... 988 | pub struct ExtendedS6M0 { | ----------------------- similarly named struct `ExtendedS6M0` defined here + | +help: a struct with a similar name exists + | +899 - pub fn set_m0(&mut self, value: ExtendedS0M0) -> Result<(), CanError> { +899 + pub fn set_m0(&mut self, value: ExtendedS6M0) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS0M1` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:908:37 | 908 | pub fn set_m1(&mut self, value: ExtendedS0M1) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M1` + | ^^^^^^^^^^^^ ... 1103 | pub struct ExtendedS6M1 { | ----------------------- similarly named struct `ExtendedS6M1` defined here + | +help: a struct with a similar name exists + | + 908 - pub fn set_m1(&mut self, value: ExtendedS0M1) -> Result<(), CanError> { + 908 + pub fn set_m1(&mut self, value: ExtendedS6M1) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedS0M2` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:917:37 | 917 | pub fn set_m2(&mut self, value: ExtendedS0M2) -> Result<(), CanError> { - | ^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedS6M2` + | ^^^^^^^^^^^^ ... 1218 | pub struct ExtendedS6M2 { | ----------------------- similarly named struct `ExtendedS6M2` defined here + | +help: a struct with a similar name exists + | + 917 - pub fn set_m2(&mut self, value: ExtendedS0M2) -> Result<(), CanError> { + 917 + pub fn set_m2(&mut self, value: ExtendedS6M2) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedTypesS11Index` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1441:37 @@ -167,37 +239,61 @@ error[E0422]: cannot find struct, variant or union type `ExtendedTypesS11M0` in --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1445:47 | 1445 | ExtendedTypesS11Index::M0(ExtendedTypesS11M0 { - | ^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedTypesS0M0` + | ^^^^^^^^^^^^^^^^^^ ... 1564 | pub struct ExtendedTypesS0M0 { | ---------------------------- similarly named struct `ExtendedTypesS0M0` defined here + | +help: a struct with a similar name exists + | +1445 - ExtendedTypesS11Index::M0(ExtendedTypesS11M0 { +1445 + ExtendedTypesS11Index::M0(ExtendedTypesS0M0 { + | error[E0422]: cannot find struct, variant or union type `ExtendedTypesS11M5` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1452:47 | 1452 | ExtendedTypesS11Index::M5(ExtendedTypesS11M5 { - | ^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedTypesS0M5` + | ^^^^^^^^^^^^^^^^^^ ... 1637 | pub struct ExtendedTypesS0M5 { | ---------------------------- similarly named struct `ExtendedTypesS0M5` defined here + | +help: a struct with a similar name exists + | +1452 - ExtendedTypesS11Index::M5(ExtendedTypesS11M5 { +1452 + ExtendedTypesS11Index::M5(ExtendedTypesS0M5 { + | error[E0425]: cannot find type `ExtendedTypesS11M0` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1485:37 | 1485 | pub fn set_m0(&mut self, value: ExtendedTypesS11M0) -> Result<(), CanError> { - | ^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedTypesS0M0` + | ^^^^^^^^^^^^^^^^^^ ... 1564 | pub struct ExtendedTypesS0M0 { | ---------------------------- similarly named struct `ExtendedTypesS0M0` defined here + | +help: a struct with a similar name exists + | +1485 - pub fn set_m0(&mut self, value: ExtendedTypesS11M0) -> Result<(), CanError> { +1485 + pub fn set_m0(&mut self, value: ExtendedTypesS0M0) -> Result<(), CanError> { + | error[E0425]: cannot find type `ExtendedTypesS11M5` in this scope --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1494:37 | 1494 | pub fn set_m5(&mut self, value: ExtendedTypesS11M5) -> Result<(), CanError> { - | ^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `ExtendedTypesS0M5` + | ^^^^^^^^^^^^^^^^^^ ... 1637 | pub struct ExtendedTypesS0M5 { | ---------------------------- similarly named struct `ExtendedTypesS0M5` defined here + | +help: a struct with a similar name exists + | +1494 - pub fn set_m5(&mut self, value: ExtendedTypesS11M5) -> Result<(), CanError> { +1494 + pub fn set_m5(&mut self, value: ExtendedTypesS0M5) -> Result<(), CanError> { + | error: invalid suffix `i32` for float literal --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1344:30 @@ -296,16 +392,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -318,16 +423,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -340,16 +454,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -357,28 +480,37 @@ error[E0433]: failed to resolve: use of undeclared type `ExtendedS1Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:793:21 | 793 | 0 => Ok(ExtendedS1Index::M0(ExtendedS1M0 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS1Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS1Index` + | +help: an enum with a similar name exists + | +793 - 0 => Ok(ExtendedS1Index::M0(ExtendedS1M0 { raw: self.raw })), +793 + 0 => Ok(ExtendedS6Index::M0(ExtendedS1M0 { raw: self.raw })), + | error[E0433]: failed to resolve: use of undeclared type `ExtendedS1Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:794:21 | 794 | 1 => Ok(ExtendedS1Index::M1(ExtendedS1M1 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS1Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS1Index` + | +help: an enum with a similar name exists + | +794 - 1 => Ok(ExtendedS1Index::M1(ExtendedS1M1 { raw: self.raw })), +794 + 1 => Ok(ExtendedS6Index::M1(ExtendedS1M1 { raw: self.raw })), + | error[E0433]: failed to resolve: use of undeclared type `ExtendedS1Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:795:21 | 795 | 2 => Ok(ExtendedS1Index::M2(ExtendedS1M2 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS1Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS1Index` + | +help: an enum with a similar name exists + | +795 - 2 => Ok(ExtendedS1Index::M2(ExtendedS1M2 { raw: self.raw })), +795 + 2 => Ok(ExtendedS6Index::M2(ExtendedS1M2 { raw: self.raw })), + | error[E0277]: the trait bound `u16: From` is not satisfied --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:799:46 @@ -389,16 +521,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -406,28 +547,37 @@ error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:867:21 | 867 | 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS0Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS0Index` + | +help: an enum with a similar name exists + | +867 - 0 => Ok(ExtendedS0Index::M0(ExtendedS0M0 { raw: self.raw })), +867 + 0 => Ok(ExtendedS6Index::M0(ExtendedS0M0 { raw: self.raw })), + | error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:868:21 | 868 | 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS0Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS0Index` + | +help: an enum with a similar name exists + | +868 - 1 => Ok(ExtendedS0Index::M1(ExtendedS0M1 { raw: self.raw })), +868 + 1 => Ok(ExtendedS6Index::M1(ExtendedS0M1 { raw: self.raw })), + | error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:869:21 | 869 | 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), - | ^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedS0Index` - | help: an enum with a similar name exists: `ExtendedS6Index` + | ^^^^^^^^^^^^^^^ use of undeclared type `ExtendedS0Index` + | +help: an enum with a similar name exists + | +869 - 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), +869 + 2 => Ok(ExtendedS6Index::M2(ExtendedS0M2 { raw: self.raw })), + | error[E0277]: the trait bound `u16: From` is not satisfied --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:873:46 @@ -438,16 +588,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -460,16 +619,25 @@ error[E0277]: the trait bound `u16: From` is not satisfied help: the following other types implement trait `From` --> $RUST/core/src/ascii/ascii_char.rs | + | impl const From for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` +... | into_int_impl!(u8 u16 u32 u64 u128 char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ---------------------------------------- in this macro invocation | ::: $RUST/core/src/convert/num.rs | + | impl const From<$Small> for $Large { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `u16` implements `From` + | `u16` implements `From` +... | impl_from!(bool => u16); - | ^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | ----------------------- in this macro invocation ... | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` + | -------------------------------------------------------------------------------- in this macro invocation = note: required for `i8` to implement `Into` = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -477,16 +645,22 @@ error[E0433]: failed to resolve: use of undeclared type `ExtendedTypesS11Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1445:21 | 1445 | ExtendedTypesS11Index::M0(ExtendedTypesS11M0 { - | ^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedTypesS11Index` - | help: an enum with a similar name exists: `ExtendedTypesS0Index` + | ^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtendedTypesS11Index` + | +help: an enum with a similar name exists + | +1445 - ExtendedTypesS11Index::M0(ExtendedTypesS11M0 { +1445 + ExtendedTypesS0Index::M0(ExtendedTypesS11M0 { + | error[E0433]: failed to resolve: use of undeclared type `ExtendedTypesS11Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1452:21 | 1452 | ExtendedTypesS11Index::M5(ExtendedTypesS11M5 { - | ^^^^^^^^^^^^^^^^^^^^^ - | | - | use of undeclared type `ExtendedTypesS11Index` - | help: an enum with a similar name exists: `ExtendedTypesS0Index` + | ^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ExtendedTypesS11Index` + | +help: an enum with a similar name exists + | +1452 - ExtendedTypesS11Index::M5(ExtendedTypesS11M5 { +1452 + ExtendedTypesS0Index::M5(ExtendedTypesS11M5 { + | diff --git a/tests/snapshots.rs b/tests/snapshots.rs index d02de63..c0555cd 100644 --- a/tests/snapshots.rs +++ b/tests/snapshots.rs @@ -175,12 +175,9 @@ fn create_content(test: &Test, path: &Path) -> anyhow::Result { static BAD_TESTS: &[&str] = &[ // "empty_choice.snap.rs", - "issue_184_extended_mux_cascaded.snap.rs", "issue_184_extended_mux_cascaded_dumped.snap.rs", "issue_184_extended_mux_independent_multiplexors.snap.rs", "issue_184_extended_mux_independent_multiplexors_dumped.snap.rs", - "issue_184_extended_mux_multiple_values.snap.rs", - "issue_184_extended_mux_multiple_values_dumped.snap.rs", "issue_199.snap.rs", "issue_199_extended.snap.rs", "long_names_multiple_relations.snap.rs", From 96d5e484cf4d120fe44614e7c91544b089a15b0d Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 20 Mar 2026 02:43:41 -0400 Subject: [PATCH 6/7] handle different multiplexor type casting --- src/lib.rs | 13 +- .../issue_184_extended_mux_cascaded.snap.rs | 2 +- ...e_184_extended_mux_cascaded_dumped.snap.rs | 4 +- ...4_extended_mux_cascaded_dumped.snap.stderr | 62 ------ ...ended_mux_independent_multiplexors.snap.rs | 4 +- ...d_mux_independent_multiplexors.snap.stderr | 62 ------ ...ux_independent_multiplexors_dumped.snap.rs | 4 +- ...ndependent_multiplexors_dumped.snap.stderr | 62 ------ ...e_184_extended_mux_multiple_values.snap.rs | 2 +- ...xtended_mux_multiple_values_dumped.snap.rs | 2 +- .../dbc-cantools/msxii_system_can.snap.rs | 2 +- .../dbc-cantools/multiplex_2.snap.rs | 8 +- .../dbc-cantools/multiplex_2.snap.stderr | 124 ------------ .../dbc-cantools/multiplex_2_dumped.snap.rs | 12 +- .../multiplex_2_dumped.snap.stderr | 186 ------------------ 15 files changed, 29 insertions(+), 520 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e5654e1..23440f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,7 +31,7 @@ use typed_builder::TypedBuilder; pub use crate::feature_config::FeatureConfig; use crate::pad::PadAdapter; -use crate::signal_type::ValType; +use crate::signal_type::{IntSize, ValType}; use crate::utils::{ enum_name, enum_variant_name, multiplex_enum_name, multiplexed_enum_variant_name, multiplexed_enum_variant_wrapper_name, MessageExt as _, SignalExt as _, @@ -580,8 +580,8 @@ impl Config<'_> { writeln!(w, "/// - Value type: {:?}", signal.value_type)?; writeln!(w, "#[inline(always)]")?; let field = signal.field_name(); - let typ = ValType::from_signal(signal); - writeln!(w, "pub fn {field}_raw(&self) -> {typ} {{")?; + let signal_typ = ValType::from_signal(signal); + writeln!(w, "pub fn {field}_raw(&self) -> {signal_typ} {{")?; { let mut w = PadAdapter::wrap(w); signal_from_payload(&mut w, signal, msg).context("signal from payload")?; @@ -623,9 +623,14 @@ impl Config<'_> { multiplexed_enum_variant_name(msg, signal, *multiplexer_index)?, )?; } + let to_u16 = match signal_typ { + ValType::UnsignedInt(IntSize::Size8) => "multiplexor.into()", + ValType::UnsignedInt(IntSize::Size16) => "multiplexor", + _ => "u16::try_from(multiplexor).unwrap_or(u16::MAX)", + }; writeln!( w, - "multiplexor => Err(CanError::InvalidMultiplexor {{ message_id: {}::MESSAGE_ID, multiplexor: multiplexor.into() }}),", + "multiplexor => Err(CanError::InvalidMultiplexor {{ message_id: {}::MESSAGE_ID, multiplexor: {to_u16} }}),", msg.type_name(), )?; } diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.rs b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.rs index 023c66b..5a144cb 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.rs +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded.snap.rs @@ -122,7 +122,7 @@ impl ExtMuxCascaded { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxCascaded::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs index 5633703..8c0afea 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs @@ -125,7 +125,7 @@ impl ExtMuxCascaded { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxCascaded::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -207,7 +207,7 @@ impl ExtMuxCascaded { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxCascaded::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr index 202df44..79e02d2 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.stderr @@ -101,37 +101,6 @@ error[E0592]: duplicate definitions with name `set_m1` 245 | pub fn set_m1(&mut self, value: ExtMuxCascadedMuxAM1) -> Result<(), CanError> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `set_m1` -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:128:46 - | -128 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtMuxCascadedMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:195:21 | @@ -155,34 +124,3 @@ help: an enum with a similar name exists 202 - ExtMuxCascadedMuxAIndex::M1(ExtMuxCascadedMuxAM1 { 202 + ExtMuxCascadedMuxedA2MuxBIndex::M1(ExtMuxCascadedMuxAM1 { | - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_cascaded_dumped.snap.rs:210:46 - | -210 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs index 3d2625e..1ae96ce 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs @@ -134,7 +134,7 @@ impl ExtMuxIndepMultiplexors { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxIndepMultiplexors::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -235,7 +235,7 @@ impl ExtMuxIndepMultiplexors { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxIndepMultiplexors::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr index 01fc511..588b8c5 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.stderr @@ -152,37 +152,6 @@ error[E0592]: duplicate definitions with name `set_m2` 291 | | ) -> Result<(), CanError> { | |_____________________________^ duplicate definitions for `set_m2` -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:137:46 - | -137 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:216:21 | @@ -218,34 +187,3 @@ help: an enum with a similar name exists 230 - ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { 230 + ExtMuxIndepMultiplexorsMuxBIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { | - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs:238:46 - | -238 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs index c722de5..1f71e88 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs @@ -134,7 +134,7 @@ impl ExtMuxIndepMultiplexors { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxIndepMultiplexors::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -235,7 +235,7 @@ impl ExtMuxIndepMultiplexors { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxIndepMultiplexors::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr index 7bfe2a7..0e8e205 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.stderr @@ -152,37 +152,6 @@ error[E0592]: duplicate definitions with name `set_m2` 291 | | ) -> Result<(), CanError> { | |_____________________________^ duplicate definitions for `set_m2` -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:137:46 - | -137 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtMuxIndepMultiplexorsMuxAIndex` --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:216:21 | @@ -218,34 +187,3 @@ help: an enum with a similar name exists 230 - ExtMuxIndepMultiplexorsMuxAIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { 230 + ExtMuxIndepMultiplexorsMuxBIndex::M2(ExtMuxIndepMultiplexorsMuxAM2 { | - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs:238:46 - | -238 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.rs b/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.rs index b0ae8ab..44ff6eb 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.rs +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.rs @@ -127,7 +127,7 @@ impl ExtMuxMultipleValues { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxMultipleValues::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.rs b/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.rs index 36feac0..73248df 100644 --- a/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.rs +++ b/tests-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.rs @@ -127,7 +127,7 @@ impl ExtMuxMultipleValues { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtMuxMultipleValues::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/msxii_system_can.snap.rs b/tests-snapshots/dbc-cantools/msxii_system_can.snap.rs index 85728a4..348519e 100644 --- a/tests-snapshots/dbc-cantools/msxii_system_can.snap.rs +++ b/tests-snapshots/dbc-cantools/msxii_system_can.snap.rs @@ -496,7 +496,7 @@ impl BatteryVt { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: BatteryVt::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: multiplexor, }) } } diff --git a/tests-snapshots/dbc-cantools/multiplex_2.snap.rs b/tests-snapshots/dbc-cantools/multiplex_2.snap.rs index ccc3ec2..b7d63a4 100644 --- a/tests-snapshots/dbc-cantools/multiplex_2.snap.rs +++ b/tests-snapshots/dbc-cantools/multiplex_2.snap.rs @@ -115,7 +115,7 @@ impl Shared { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Shared::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -411,7 +411,7 @@ impl Normal { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Normal::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -721,7 +721,7 @@ impl Extended { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Extended::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -795,7 +795,7 @@ impl Extended { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Extended::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr b/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr index 384ef6c..553f554 100644 --- a/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr +++ b/tests-snapshots/dbc-cantools/multiplex_2.snap.stderr @@ -150,99 +150,6 @@ error[E0592]: duplicate definitions with name `set_m2` 842 | pub fn set_m2(&mut self, value: ExtendedS0M2) -> Result<(), CanError> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `set_m2` -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:118:46 - | -118 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:414:46 - | -414 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:724:46 - | -724 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:792:21 | @@ -278,34 +185,3 @@ help: an enum with a similar name exists 794 - 2 => Ok(ExtendedS0Index::M2(ExtendedS0M2 { raw: self.raw })), 794 + 2 => Ok(ExtendedS6Index::M2(ExtendedS0M2 { raw: self.raw })), | - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2.snap.rs:798:46 - | -798 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs b/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs index f0ba95e..95dd701 100644 --- a/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs +++ b/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs @@ -115,7 +115,7 @@ impl Shared { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Shared::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -411,7 +411,7 @@ impl Normal { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Normal::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -722,7 +722,7 @@ impl Extended { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Extended::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -796,7 +796,7 @@ impl Extended { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Extended::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -870,7 +870,7 @@ impl Extended { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: Extended::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } @@ -1382,7 +1382,7 @@ impl ExtendedTypes { multiplexor => { Err(CanError::InvalidMultiplexor { message_id: ExtendedTypes::MESSAGE_ID, - multiplexor: multiplexor.into(), + multiplexor: u16::try_from(multiplexor).unwrap_or(u16::MAX), }) } } diff --git a/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr b/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr index fdd7814..5e3005f 100644 --- a/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr +++ b/tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.stderr @@ -383,99 +383,6 @@ error[E0592]: duplicate definitions with name `set_m5` 1494 | pub fn set_m5(&mut self, value: ExtendedTypesS11M5) -> Result<(), CanError> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `set_m5` -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:118:46 - | -118 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:414:46 - | -414 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:725:46 - | -725 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtendedS1Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:793:21 | @@ -512,37 +419,6 @@ help: an enum with a similar name exists 795 + 2 => Ok(ExtendedS6Index::M2(ExtendedS1M2 { raw: self.raw })), | -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:799:46 - | -799 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtendedS0Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:867:21 | @@ -579,68 +455,6 @@ help: an enum with a similar name exists 869 + 2 => Ok(ExtendedS6Index::M2(ExtendedS0M2 { raw: self.raw })), | -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:873:46 - | -873 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `u16: From` is not satisfied - --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1385:46 - | -1385 | multiplexor: multiplexor.into(), - | ^^^^ the trait `From` is not implemented for `u16` - | -help: the following other types implement trait `From` - --> $RUST/core/src/ascii/ascii_char.rs - | - | impl const From for $ty { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u16` implements `From` -... - | into_int_impl!(u8 u16 u32 u64 u128 char); - | ---------------------------------------- in this macro invocation - | - ::: $RUST/core/src/convert/num.rs - | - | impl const From<$Small> for $Large { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `u16` implements `From` - | `u16` implements `From` -... - | impl_from!(bool => u16); - | ----------------------- in this macro invocation -... - | impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")]); - | -------------------------------------------------------------------------------- in this macro invocation - = note: required for `i8` to implement `Into` - = note: this error originates in the macro `into_int_impl` which comes from the expansion of the macro `impl_from` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0433]: failed to resolve: use of undeclared type `ExtendedTypesS11Index` --> tests-snapshots/dbc-cantools/multiplex_2_dumped.snap.rs:1445:21 | From cdd1b8599fa5230a0ff3b205e076baaae3152017 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 20 Mar 2026 02:47:50 -0400 Subject: [PATCH 7/7] bump rust CI version to match errors --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fadc45f..32746aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - uses: taiki-e/install-action@v2 with: { tool: 'just,cargo-binstall' } - uses: dtolnay/rust-toolchain@stable - with: { toolchain: '1.93.0', components: 'rust-src,rust-docs,rustfmt,clippy' } + with: { toolchain: '1.94.0', components: 'rust-src,rust-docs,rustfmt,clippy' } - run: just ci-test test-msrv: @@ -59,7 +59,7 @@ jobs: - uses: taiki-e/install-action@v2 with: { tool: 'just,cargo-llvm-cov' } - uses: dtolnay/rust-toolchain@stable - with: { toolchain: '1.93.0', components: 'rust-src,rust-docs,rustfmt,clippy' } + with: { toolchain: '1.94.0', components: 'rust-src,rust-docs,rustfmt,clippy' } - name: Generate code coverage run: just ci-coverage - name: Upload coverage to Codecov