Skip to content

Commit

Permalink
Redefine Debug instead of importing it
Browse files Browse the repository at this point in the history
This reverts commit 7e2548f.

Now I know why it was redefined: it seems like it's potentially because
of the orphan rule. Here are the error messages:

error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `!`:
 --> src/primitive_docs.rs:236:1
  |
6 | impl Debug for ! {
  | ^^^^^^^^^^^^^^^^
  |
  = note: conflicting implementation in crate `core`:
          - impl std::fmt::Debug for !;

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
 --> src/primitive_docs.rs:236:1
  |
6 | impl Debug for ! {
  | ^^^^^^^^^^^^^^^-
  | |              |
  | |              `!` is not defined in the current crate
  | impl doesn't use only types from inside the current crate
  |
  = note: define and implement a trait or new type instead
  • Loading branch information
camelid committed Sep 1, 2020
1 parent 37ea97c commit e13a701
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ mod prim_bool {}
///
/// ```
/// #![feature(never_type)]
/// # use std::fmt::{self, Debug};
/// # use std::fmt;
/// # trait Debug {
/// # fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result;
/// # }
/// impl Debug for ! {
/// fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
/// *self
Expand Down

0 comments on commit e13a701

Please sign in to comment.