From 453e078f525aaf1afbfa17a101d166ca0061bcbe Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 2 Nov 2023 21:09:43 -0400 Subject: [PATCH] Fix documentation on no-std targets error[E0463]: can't find crate for `std` | = note: the `thumbv7m-none-eabi` target may not support the standard library = note: `std` is required by `dyn_clone` because it does not declare `#![no_std]` = help: consider building the standard library from source with `cargo build -Zbuild-std` error: cannot find macro `assert_eq` in this scope --> src/lib.rs:144:9 | 144 | assert_eq!(*data_ptr as *const (), t as *const T as *const ()); | ^^^^^^^^^ | help: consider importing this macro | 116 + use core::assert_eq; | error[E0405]: cannot find trait `Clone` in this scope --> src/lib.rs:110:13 | 110 | impl Sealed for T {} | ^^^^^ not found in this scope | help: consider importing one of these items | 109 + use core::clone::Clone; | 109 + use crate::__private::Clone; | error[E0405]: cannot find trait `Clone` in this scope --> src/lib.rs:112:13 | 112 | impl Sealed for [T] {} | ^^^^^ not found in this scope | help: consider importing one of these items | 109 + use core::clone::Clone; | 109 + use crate::__private::Clone; | error[E0405]: cannot find trait `Sized` in this scope --> src/lib.rs:139:9 | 139 | T: ?Sized + DynClone, | ^^^^^ not found in this scope | help: consider importing this trait | 116 + use core::marker::Sized; | error[E0405]: cannot find trait `Sized` in this scope --> src/lib.rs:153:9 | 153 | T: ?Sized + DynClone, | ^^^^^ not found in this scope | help: consider importing this trait | 116 + use core::marker::Sized; | error[E0405]: cannot find trait `Sized` in this scope --> src/lib.rs:179:9 | 179 | T: ?Sized + DynClone, | ^^^^^ not found in this scope | help: consider importing this trait | 116 + use core::marker::Sized; | error[E0405]: cannot find trait `Clone` in this scope --> src/lib.rs:192:8 | 192 | T: Clone, | ^^^^^ not found in this scope | help: consider importing one of these items | 116 + use core::clone::Clone; | 116 + use crate::__private::Clone; | error[E0405]: cannot find trait `Clone` in this scope --> src/lib.rs:207:8 | 207 | T: Clone, | ^^^^^ not found in this scope | help: consider importing one of these items | 116 + use core::clone::Clone; | 116 + use crate::__private::Clone; | warning: relaxing a default bound only does something for `?Sized`; all other traits are not bound by default --> src/lib.rs:139:8 | 139 | T: ?Sized + DynClone, | ^^^^^^ warning: relaxing a default bound only does something for `?Sized`; all other traits are not bound by default --> src/lib.rs:153:8 | 153 | T: ?Sized + DynClone, | ^^^^^^ warning: relaxing a default bound only does something for `?Sized`; all other traits are not bound by default --> src/lib.rs:179:8 | 179 | T: ?Sized + DynClone, | ^^^^^^ Some errors have detailed explanations: E0405, E0463. For more information about an error, try `rustc --explain E0405`. warning: `dyn-clone` (lib doc) generated 3 warnings error: could not document `dyn-clone` --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 10d1beb..a80ee74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,7 +81,7 @@ //! ``` #![doc(html_root_url = "https://docs.rs/dyn_clone/1.0.14")] -#![cfg_attr(not(doc), no_std)] +#![no_std] #![allow( clippy::missing_panics_doc, clippy::needless_doctest_main, @@ -90,6 +90,9 @@ extern crate alloc; +#[cfg(doc)] +extern crate core as std; + #[macro_use] mod macros;