You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use teloxide::macros::BotCommands;use std::str::FromStr;use serde_derive::*;#[derive(Default,Debug,PartialEq,Clone,Copy,Serialize,Deserialize)]pubstructUserId(pubu64);implFromStrforUserId{typeErr = std::num::ParseIntError;fnfrom_str(s:&str) -> Result<Self,Self::Err>{Ok(UserId(s.parse()?))}}#[derive(Clone,PartialEq,BotCommands)]#[command(rename_rule = "lowercase", parse_with = "split")]pubenumAdministratorCommand{GiveStrike{member_id:UserId,}}fnmain(){println!("omg! what happened?");}
Instead of success building i get:
error[E0308]: mismatched types
--> src\main.rs:16:28
|
16 | #[derive(Clone, PartialEq, BotCommands)]
| ^^^^^^^^^^^ expected `UserId`, found `u64`
|
= note: this error originates in the derive macro `BotCommands` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0308`.
error: could not compile `teloxide_report` (bin "teloxide_report") due to 1 previous error
-Z macro-backtrace doesn't work:
C:\Users\whoami\code\rust\sandbox\teloxide_report>cargo b -Z macro-backtrace
error: unknown `-Z` flag specified: macro-backtrace
For available unstable features, see https://doc.rust-lang.org/nightly/cargo/reference/unstable.html
If you intended to use an unstable rustc feature, try setting `RUSTFLAGS="-Zmacro-backtrace"`
Meta
teloxide = { version = "0.12.2", features = ["macros"] }
serde_derive = "1.0.197"
serde = "1.0.197"
host: nightly-x86_64-pc-windows-msvc (has updated to the last version)
The text was updated successfully, but these errors were encountered:
I tried this code:
Instead of success building i get:
-Z macro-backtrace
doesn't work:Meta
The text was updated successfully, but these errors were encountered: