1 // aux-build:doc_unsafe_macros.rs
3 #![allow(clippy::let_unit_value)]
6 extern crate doc_unsafe_macros;
8 /// This is not sufficiently documented
9 pub unsafe fn destroy_the_planet() {
17 /// This function shouldn't be called unless the horsemen are ready
18 pub unsafe fn apocalypse(universe: &mut ()) {
22 /// This is a private function, so docs aren't necessary
23 unsafe fn you_dont_see_me() {
28 pub unsafe fn only_crate_wide_accessible() {
32 pub unsafe fn republished() {
37 pub use private_mod::republished;
39 pub trait SafeTraitUnsafeMethods {
40 unsafe fn woefully_underdocumented(self);
43 unsafe fn at_least_somewhat_documented(self);
46 pub unsafe trait UnsafeTrait {
51 pub unsafe trait DocumentedUnsafeTrait {
57 impl SafeTraitUnsafeMethods for Struct {
58 unsafe fn woefully_underdocumented(self) {
62 unsafe fn at_least_somewhat_documented(self) {
67 unsafe impl UnsafeTrait for Struct {
71 unsafe impl DocumentedUnsafeTrait for Struct {
76 pub unsafe fn more_undocumented_unsafe() -> Self {
81 pub unsafe fn somewhat_documented(&self) {
85 unsafe fn private(&self) {
90 macro_rules! very_unsafe {
92 pub unsafe fn whee() {
98 /// Please keep the seat belt fastened
99 pub unsafe fn drive() {
107 // we don't lint code from external macros
113 destroy_the_planet();
114 let mut universe = ();
115 apocalypse(&mut universe);
116 private_mod::only_crate_wide_accessible();
121 // do not lint if any parent has `#[doc(hidden)]` attribute
131 /// # Implementation safety
132 pub unsafe trait DocumentedUnsafeTraitWithImplementationHeader {