File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -518,7 +518,7 @@ pub fn panicking() -> bool {
518518}
519519
520520/// Entry point of panics from the libcore crate (`panic_impl` lang item).
521- #[ cfg( not( test) ) ]
521+ #[ cfg( not( any ( test, doctest ) ) ) ]
522522#[ panic_handler]
523523pub fn begin_panic_handler ( info : & PanicInfo < ' _ > ) -> ! {
524524 struct PanicPayload < ' a > {
@@ -590,7 +590,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
590590/// panic!() and assert!(). In particular, this is the only entry point that supports
591591/// arbitrary payloads, not just format strings.
592592#[ unstable( feature = "libstd_sys_internals" , reason = "used by the panic! macro" , issue = "none" ) ]
593- #[ cfg_attr( not( test) , lang = "begin_panic" ) ]
593+ #[ cfg_attr( not( any ( test, doctest ) ) , lang = "begin_panic" ) ]
594594// lang item for CTFE panic support
595595// never inline unless panic_immediate_abort to avoid code
596596// bloat at the call sites as much as possible
Original file line number Diff line number Diff line change 1212
1313mod dwarf;
1414
15- #[ cfg( not( test) ) ]
15+ #[ cfg( not( any ( test, doctest ) ) ) ]
1616cfg_if:: cfg_if! {
1717 if #[ cfg( target_os = "emscripten" ) ] {
1818 mod emcc;
Original file line number Diff line number Diff line change @@ -2151,7 +2151,7 @@ pub fn id() -> u32 {
21512151/// of the `main` function, this trait is likely to be available only on
21522152/// standard library's runtime for convenience. Other runtimes are not required
21532153/// to provide similar functionality.
2154- #[ cfg_attr( not( test) , lang = "termination" ) ]
2154+ #[ cfg_attr( not( any ( test, doctest ) ) , lang = "termination" ) ]
21552155#[ stable( feature = "termination_trait_lib" , since = "1.61.0" ) ]
21562156#[ rustc_on_unimplemented(
21572157 on(
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ fn lang_start_internal(
154154 ret_code
155155}
156156
157- #[ cfg( not( test) ) ]
157+ #[ cfg( not( any ( test, doctest ) ) ) ]
158158#[ lang = "start" ]
159159fn lang_start < T : crate :: process:: Termination + ' static > (
160160 main : fn ( ) -> T ,
You can’t perform that action at this time.
0 commit comments