Code
// [dependencies]
// quote = "1"
use quote::quote;
use std::net::Ipv4Addr;
fn main() {
let ip = Ipv4Addr::LOCALHOST;
let _ = quote! { #ip };
}
Current output
error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied
--> src/main.rs:9:13
|
9 | let _ = quote! { #ip };
| ^^^^^^^^^^^^^^
| |
| the trait `ToTokens` is not implemented for `Ipv4Addr`
| required by a bound introduced by this call
|
note: there are multiple different versions of crate `quote` in the dependency graph
--> /home/david/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.42/src/to_tokens.rs:9:1
|
9 | pub trait ToTokens {
| ^^^^^^^^^^^^^^^^^^ this is the expected trait
|
::: /home/david/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/to_tokens.rs:11:1
|
11 | pub trait ToTokens {
| ------------------ this is the trait that was imported
= help: you can use `cargo tree` to explore your dependency tree
= help: the following other types implement trait `ToTokens`:
&T
&mut T
Box<T>
CStr
CString
Cow<'a, T>
Option<T>
Rc<T>
and 24 others
= note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
Rationale and extra context
Rustc says "there are multiple different versions of crate quote in the dependency graph" and points to a ToTokens trait from version 1.0.42 of crate quote. As far as I understand, there is no other version of quote in the dependency graph. The diagnostic goes on to point to a different trait in crate proc_macro, but proc_macro is not a version of quote.
This diagnostic is new in nightly-2025-11-13 and is from #144674.
Rust Version
rustc 1.93.0-nightly (01867557c 2025-11-12)
binary: rustc
commit-hash: 01867557cd7dbe256a031a7b8e28d05daecd75ab
commit-date: 2025-11-12
host: x86_64-unknown-linux-gnu
release: 1.93.0-nightly
LLVM version: 21.1.5
Anything else?
No response
Code
Current output
Rationale and extra context
Rustc says "there are multiple different versions of crate
quotein the dependency graph" and points to aToTokenstrait from version 1.0.42 of cratequote. As far as I understand, there is no other version ofquotein the dependency graph. The diagnostic goes on to point to a different trait in crateproc_macro, butproc_macrois not a version ofquote.This diagnostic is new in nightly-2025-11-13 and is from #144674.
Rust Version
Anything else?
No response