Skip to content

Commit

Permalink
Cfg remove lang items in doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen authored and compiler-errors committed Dec 7, 2023
1 parent 2a69a1a commit fb142f8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions library/std/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ pub fn panicking() -> bool {
}

/// Entry point of panics from the core crate (`panic_impl` lang item).
#[cfg(not(test))]
#[cfg(not(any(test, doctest)))]
#[panic_handler]
pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
struct FormatStringPayload<'a> {
Expand Down Expand Up @@ -669,7 +669,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
/// panic!() and assert!(). In particular, this is the only entry point that supports
/// arbitrary payloads, not just format strings.
#[unstable(feature = "libstd_sys_internals", reason = "used by the panic! macro", issue = "none")]
#[cfg_attr(not(test), lang = "begin_panic")]
#[cfg_attr(not(any(test, doctest)), lang = "begin_panic")]
// lang item for CTFE panic support
// never inline unless panic_immediate_abort to avoid code
// bloat at the call sites as much as possible
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ pub fn id() -> u32 {
/// of the `main` function, this trait is likely to be available only on
/// standard library's runtime for convenience. Other runtimes are not required
/// to provide similar functionality.
#[cfg_attr(not(test), lang = "termination")]
#[cfg_attr(not(any(test, doctest)), lang = "termination")]
#[stable(feature = "termination_trait_lib", since = "1.61.0")]
#[rustc_on_unimplemented(on(
cause = "MainFunctionType",
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn lang_start_internal(
ret_code
}

#[cfg(not(test))]
#[cfg(not(any(test, doctest)))]
#[inline(never)]
#[lang = "start"]
fn lang_start<T: crate::process::Termination + 'static>(
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/personality/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
mod dwarf;

#[cfg(not(test))]
#[cfg(not(any(test, doctest)))]
cfg_if::cfg_if! {
if #[cfg(target_os = "emscripten")] {
mod emcc;
Expand Down

0 comments on commit fb142f8

Please sign in to comment.