-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.F-extern_types`#![feature(extern_types)]``#![feature(extern_types)]`requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
// Library code
#![feature(extern_types)]
extern "C" {
#[derive(Debug)]
pub type Bar;
}
// User code
fn main() {
let b = 0x0 as *const Bar;
println!("{:?}", &*b);
}
Error:
error[E0277]: the trait bound `Bar: std::fmt::Debug` is not satisfied
--> foo.rs:12:19
|
12 | println!("{:?}", &*b);
| ^^^ `Bar` cannot be formatted using `:?`; if it is defined in your crate, add `#[derive(Debug)]` or manually implement it
If possible, it should at least emit a warning or something. At the very least, missing_debug_implementations
should trigger if #[derive(Debug)]
can not produce a compile error in case it can't generate an implementation. See #46662.
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.F-extern_types`#![feature(extern_types)]``#![feature(extern_types)]`requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.