Skip to contentSkip to conversation

linux-next: build failure after merge of the rust tree

PATCH Stephen Rothwell 4 participants 5 messages Nov 17, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the rust tree, today's linux-next build (x86_64 allmodconfig) failed like this:

error[E0277]: Chipset doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:233:13

    |
233 |             self.chipset,
    |             ^^^^^^^^^^^^ `Chipset` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Chipset
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: Revision doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:235:13

    |
235 |             self.revision
    |             ^^^^^^^^^^^^^ `Revision` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Revision
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound MsgFunction: kernel::fmt::Display is not satisfied
--> drivers/gpu/nova-core/gsp/cmdq.rs:532:9

    |
532 | /         dev_dbg!(
533 | |             &self.dev,
534 | |             "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
    | |                                               -- required by a bound introduced by this call
535 | |             self.seq,
536 | |             M::FUNCTION,
537 | |             dst.header.length(),
538 | |         );
    | |_________^ the trait `kernel::fmt::Display` is not implemented for `MsgFunction`
    |
    = help: the following other types implement trait `kernel::fmt::Display`:
              &T
              Arc<T>
              Arguments<'_>
              BStr
              Box<T, A>
              CStr
              Chipset
              Class
            and 22 others
    = note: required for `kernel::fmt::Adapter<&MsgFunction>` to implement `core::fmt::Display`
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
   --> /usr/lib/rustlib/src/rust/library/core/src/fmt/rt.rs:113:27
    |
113 |     pub fn new_display<T: Display>(x: &T) -> Argument<'_> {
    |                           ^^^^^^^ required by this bound in `Argument::<'_>::new_display`

= note: this error originates in the macro ::core::format_args which comes from the expansion of the macro dev_dbg (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try rustc --explain E0277.

Caused by commit

c5cf01ba8dfe ("rust: support formatting of foreign types")

(I think) interacting with commits

38b7cc448a5b ("gpu: nova-core: implement Display for Spec") 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling")

from the drm-rust tree.

I have applied the following patches for today.

From: Stephen Rothwell <[email protected]>
Date: Mon, 17 Nov 2025 18:16:10 +1100
Subject: [PATCH] temp hack for "rust: support formatting of foreign types"

from the rust tree interacting with "gpu: nova-core: implement Display for Spec" from the drm-rust tree.

---
 drivers/gpu/nova-core/gpu.rs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/nova-core/gpu.rs +7 -6
index 19755af6ad04..be2055da1755 100644
@@ -178,7 +178,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 /// Structure holding a basic description of the GPU: `Chipset` and `Revision`.
 pub(crate) struct Spec {
     chipset: Chipset,
-    revision: Revision,
+//  revision: Revision,
 }
 
 impl Spec {
@@ -220,7 +220,7 @@ impl TryFrom<regs::NV_PMC_BOOT_42> for Spec {
     fn try_from(boot42: regs::NV_PMC_BOOT_42) -> Result<Self> {
         Ok(Self {
             chipset: boot42.chipset()?,
-            revision: boot42.into(),
+//          revision: boot42.into(),
         })
     }
 }
@@ -229,10 +229,11 @@ impl fmt::Display for Spec {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
-            "Chipset: {}, Architecture: {:?}, Revision: {}",
-            self.chipset,
-            self.chipset.arch(),
-            self.revision
+            "Chipset"
+//          "Chipset: {}, Architecture: {:?}, Revision: {}",
+//          self.chipset,
+//          self.chipset.arch(),
+//          self.revision
         )
     }
 }
Signature · 14 lines
2.51.1


From: Stephen Rothwell <[email protected]>
Date: Mon, 17 Nov 2025 18:25:53 +1100
Subject: [PATCH] temp hack 2 for "rust: support formatting of foreign types"

from the rust tree interacting with "gpu: nova-core: gsp: Add GSP command
queue bindings and handling" from the drm-rust tree.

Signed-off-by: Stephen Rothwell <[email protected]>
---
 drivers/gpu/nova-core/gsp/cmdq.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/nova-core/gsp/cmdq.rs +7 -7
index 6f946d14868a..ede05d1d82aa 100644
@@ -529,13 +529,13 @@ pub(crate) fn send_command<M>(&mut self, bar: &Bar0, command: M) -> Result
                 dst.contents.1,
             ])));
 
-        dev_dbg!(
-            &self.dev,
-            "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
-            self.seq,
-            M::FUNCTION,
-            dst.header.length(),
-        );
+//        dev_dbg!(
+//            &self.dev,
+//            "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
+//            self.seq,
+//            M::FUNCTION,
+//            dst.header.length(),
+//        );
 
         // All set - update the write pointer and inform the GSP of the new command.
         let elem_count = dst.header.element_count();
Signature · 5 lines
2.51.1

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 54 lines · Stephen Rothwell

Hi all,

After merging the rust tree, today's linux-next build (x86_64 allmodconfig) failed like this:

error[E0277]: Chipset doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:233:13

    |
233 |             self.chipset,
    |             ^^^^^^^^^^^^ `Chipset` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Chipset
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: Revision doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:235:13

    |
235 |             self.revision
    |             ^^^^^^^^^^^^^ `Revision` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Revision
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound MsgFunction: kernel::fmt::Display is not satisfied
--> drivers/gpu/nova-core/gsp/cmdq.rs:532:9

    |
532 | /         dev_dbg!(
533 | |             &self.dev,
534 | |             "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
    | |                                               -- required by a bound introduced by this call
535 | |             self.seq,
536 | |             M::FUNCTION,
537 | |             dst.header.length(),
538 | |         );
    | |_________^ the trait `kernel::fmt::Display` is not implemented for `MsgFunction`
    |
    = help: the following other types implement trait `kernel::fmt::Display`:
              &T
              Arc<T>
              Arguments<'_>
              BStr
              Box<T, A>
              CStr
              Chipset
              Class
            and 22 others
    = note: required for `kernel::fmt::Adapter<&MsgFunction>` to implement `core::fmt::Display`
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
   --> /usr/lib/rustlib/src/rust/library/core/src/fmt/rt.rs:113:27
    |
113 |     pub fn new_display<T: Display>(x: &T) -> Argument<'_> {
    |                           ^^^^^^^ required by this bound in `Argument::<'_>::new_display`
Quoted 3 lines

= note: this error originates in the macro ::core::format_args which comes from the expansion of the macro dev_dbg (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

I could work around this with the following patch, but it looks terribly wrong. In gpu.rs we need to implement core::fmt::Display (because of the use of write!), but in fw.rs we need to implement kernel::fmt::Display. It is not clear to me how the two interfaces are supposed to interact.

Tamir, could you advise on the correct thing to do here?

drivers/gpu/nova-core/gpu.rs +2 -2
index 19755af6ad04..de924ffc0823 100644
@@ -115,7 +115,7 @@ pub(crate) fn arch(&self) -> Architecture {
 // Hence, replace with something like strum_macros derive(Display).
 //
 // For now, redirect to fmt::Debug for convenience.
-impl fmt::Display for Chipset {
+impl core::fmt::Display for Chipset {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{self:?}")
     }
@@ -169,7 +169,7 @@ fn from(boot0: regs::NV_PMC_BOOT_42) -> Self {
     }
 }
 
-impl fmt::Display for Revision {
+impl core::fmt::Display for Revision {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:x}.{:x}", self.major, self.minor)
     }
drivers/gpu/nova-core/gsp/fw.rs +1 -1
index 8deec5e0a1d4..53afdbfa9554 100644
@@ -7,12 +7,12 @@
 use r570_144 as bindings;
 
 use core::{
-    fmt,
     ops::Range, //
 };
 
 use kernel::{
     dma::CoherentAllocation,
+    fmt,
     prelude::*,
     ptr::{
         Alignable,
maintainer
#2 lore raw
In reply to Stephen Rothwell
Quoted 62 lines · Stephen Rothwell

Hi all,

After merging the rust tree, today's linux-next build (x86_64 allmodconfig) failed like this:

error[E0277]: Chipset doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:233:13

    |
233 |             self.chipset,
    |             ^^^^^^^^^^^^ `Chipset` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Chipset
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: Revision doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:235:13

    |
235 |             self.revision
    |             ^^^^^^^^^^^^^ `Revision` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Revision
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound MsgFunction: kernel::fmt::Display is not satisfied
--> drivers/gpu/nova-core/gsp/cmdq.rs:532:9

    |
532 | /         dev_dbg!(
533 | |             &self.dev,
534 | |             "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
    | |                                               -- required by a bound introduced by this call
535 | |             self.seq,
536 | |             M::FUNCTION,
537 | |             dst.header.length(),
538 | |         );
    | |_________^ the trait `kernel::fmt::Display` is not implemented for `MsgFunction`
    |
    = help: the following other types implement trait `kernel::fmt::Display`:
              &T
              Arc<T>
              Arguments<'_>
              BStr
              Box<T, A>
              CStr
              Chipset
              Class
            and 22 others
    = note: required for `kernel::fmt::Adapter<&MsgFunction>` to implement `core::fmt::Display`
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
   --> /usr/lib/rustlib/src/rust/library/core/src/fmt/rt.rs:113:27
    |
113 |     pub fn new_display<T: Display>(x: &T) -> Argument<'_> {
    |                           ^^^^^^^ required by this bound in `Argument::<'_>::new_display`

= note: this error originates in the macro ::core::format_args which comes from the expansion of the macro dev_dbg (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try rustc --explain E0277.

Caused by commit

Quoted 8 lines

c5cf01ba8dfe ("rust: support formatting of foreign types")

(I think) interacting with commits

38b7cc448a5b ("gpu: nova-core: implement Display for Spec") 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling")

from the drm-rust tree.

I applied a patch to drm-rust-next that makes this error go away.

Alice

#3 lore raw
Quoted 68 lines · Alice Ryhl
Quoted 66 lines · Stephen Rothwell

Hi all,

After merging the rust tree, today's linux-next build (x86_64 allmodconfig) failed like this:

error[E0277]: Chipset doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:233:13

    |
233 |             self.chipset,
    |             ^^^^^^^^^^^^ `Chipset` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Chipset
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: Revision doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:235:13

    |
235 |             self.revision
    |             ^^^^^^^^^^^^^ `Revision` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Revision
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound MsgFunction: kernel::fmt::Display is not satisfied
--> drivers/gpu/nova-core/gsp/cmdq.rs:532:9

    |
532 | /         dev_dbg!(
533 | |             &self.dev,
534 | |             "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
    | |                                               -- required by a bound introduced by this call
535 | |             self.seq,
536 | |             M::FUNCTION,
537 | |             dst.header.length(),
538 | |         );
    | |_________^ the trait `kernel::fmt::Display` is not implemented for `MsgFunction`
    |
    = help: the following other types implement trait `kernel::fmt::Display`:
              &T
              Arc<T>
              Arguments<'_>
              BStr
              Box<T, A>
              CStr
              Chipset
              Class
            and 22 others
    = note: required for `kernel::fmt::Adapter<&MsgFunction>` to implement `core::fmt::Display`
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
   --> /usr/lib/rustlib/src/rust/library/core/src/fmt/rt.rs:113:27
    |
113 |     pub fn new_display<T: Display>(x: &T) -> Argument<'_> {
    |                           ^^^^^^^ required by this bound in `Argument::<'_>::new_display`

= note: this error originates in the macro ::core::format_args which comes from the expansion of the macro dev_dbg (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try rustc --explain E0277.

Caused by commit

c5cf01ba8dfe ("rust: support formatting of foreign types")

(I think) interacting with commits

Quoted 8 lines
Quoted 4 lines

38b7cc448a5b ("gpu: nova-core: implement Display for Spec") 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling")

from the drm-rust tree.

I applied a patch to drm-rust-next that makes this error go away.

Alice

Thanks for taking care of this!

Alexandre: the correct thing to do going forward is never to use core::fmt; instead always use kernel::fmt.

maintainer
#4 lore raw
Quoted 75 lines · Tamir Duberstein
Quoted 73 lines · Alice Ryhl
Quoted 70 lines · Stephen Rothwell

Hi all,

After merging the rust tree, today's linux-next build (x86_64 allmodconfig) failed like this:

error[E0277]: Chipset doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:233:13

    |
233 |             self.chipset,
    |             ^^^^^^^^^^^^ `Chipset` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Chipset
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: Revision doesn't implement core::fmt::Display
--> drivers/gpu/nova-core/gpu.rs:235:13

    |
235 |             self.revision
    |             ^^^^^^^^^^^^^ `Revision` cannot be formatted with the default formatter
    |

= help: the trait core::fmt::Display is not implemented for Revision
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro write (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound MsgFunction: kernel::fmt::Display is not satisfied
--> drivers/gpu/nova-core/gsp/cmdq.rs:532:9

    |
532 | /         dev_dbg!(
533 | |             &self.dev,
534 | |             "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n",
    | |                                               -- required by a bound introduced by this call
535 | |             self.seq,
536 | |             M::FUNCTION,
537 | |             dst.header.length(),
538 | |         );
    | |_________^ the trait `kernel::fmt::Display` is not implemented for `MsgFunction`
    |
    = help: the following other types implement trait `kernel::fmt::Display`:
              &T
              Arc<T>
              Arguments<'_>
              BStr
              Box<T, A>
              CStr
              Chipset
              Class
            and 22 others
    = note: required for `kernel::fmt::Adapter<&MsgFunction>` to implement `core::fmt::Display`
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
   --> /usr/lib/rustlib/src/rust/library/core/src/fmt/rt.rs:113:27
    |
113 |     pub fn new_display<T: Display>(x: &T) -> Argument<'_> {
    |                           ^^^^^^^ required by this bound in `Argument::<'_>::new_display`

= note: this error originates in the macro ::core::format_args which comes from the expansion of the macro dev_dbg (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try rustc --explain E0277.

Caused by commit

c5cf01ba8dfe ("rust: support formatting of foreign types")

(I think) interacting with commits

38b7cc448a5b ("gpu: nova-core: implement Display for Spec") 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling")

from the drm-rust tree.

Quoted 8 lines
Quoted 3 lines

I applied a patch to drm-rust-next that makes this error go away.

Alice

Thanks for taking care of this!

Alexandre: the correct thing to do going forward is never to use core::fmt; instead always use kernel::fmt.

Here's the fix I applied:
https://lore.kernel.org/all/[email protected]/

I had to use write_fmt(fmt!(...)) instead of the write!(...) macro.

Alice