|
37 | 37 | //! let bytes = std::fs::read("program.o").unwrap(); |
38 | 38 | //! let mut object = Object::parse(&bytes).unwrap(); |
39 | 39 | //! // Relocate the programs |
40 | | -//! #[cfg(feature = "std")] |
41 | 40 | //! let text_sections = std::collections::HashSet::new(); |
42 | | -//! #[cfg(not(feature = "std"))] |
43 | | -//! let text_sections = hashbrown::HashSet::new(); |
44 | 41 | //! object.relocate_calls(&text_sections).unwrap(); |
45 | 42 | //! object.relocate_maps(std::iter::empty(), &text_sections).unwrap(); |
46 | 43 | //! |
|
59 | 56 | //! |
60 | 57 | //! [rbpf]: https://github.com/qmonnet/rbpf |
61 | 58 |
|
62 | | -#![no_std] |
63 | 59 | #![doc( |
64 | 60 | html_logo_url = "https://aya-rs.dev/assets/images/crabby.svg", |
65 | 61 | html_favicon_url = "https://aya-rs.dev/assets/images/crabby.svg" |
66 | 62 | )] |
67 | 63 | #![cfg_attr(docsrs, feature(doc_cfg))] |
68 | 64 | #![deny(missing_docs)] |
69 | | -#![cfg_attr( |
70 | | - any(feature = "std", test), |
71 | | - expect(unused_crate_dependencies, reason = "used in doctests") |
72 | | -)] |
73 | | - |
74 | | -extern crate alloc; |
75 | | -#[cfg(feature = "std")] |
76 | | -extern crate std; |
| 65 | +#![cfg_attr(test, expect(unused_crate_dependencies, reason = "used in doctests"))] |
77 | 66 |
|
78 | 67 | pub mod btf; |
79 | 68 | #[expect( |
@@ -113,11 +102,11 @@ pub use obj::*; |
113 | 102 | /// An error returned from the verifier. |
114 | 103 | /// |
115 | 104 | /// Provides a [`Debug`] implementation that doesn't escape newlines. |
116 | | -pub struct VerifierLog(alloc::string::String); |
| 105 | +pub struct VerifierLog(String); |
117 | 106 |
|
118 | 107 | impl VerifierLog { |
119 | 108 | /// Create a new verifier log. |
120 | | - pub const fn new(log: alloc::string::String) -> Self { |
| 109 | + pub const fn new(log: String) -> Self { |
121 | 110 | Self(log) |
122 | 111 | } |
123 | 112 | } |
|
0 commit comments