Skip to content

Commit

Permalink
Invert core error cfg, until stable
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 14, 2024
1 parent ec298b9 commit 2034697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn main() {
println!("cargo:rustc-check-cfg=cfg(compile_error_if_alloc)");
println!("cargo:rustc-check-cfg=cfg(compile_error_if_std)");
println!("cargo:rustc-check-cfg=cfg(cxx_experimental_no_alloc)");
println!("cargo:rustc-check-cfg=cfg(no_core_error)");
println!("cargo:rustc-check-cfg=cfg(error_in_core)");
println!("cargo:rustc-check-cfg=cfg(no_core_ffi_c_char)");
println!("cargo:rustc-check-cfg=cfg(skip_ui_tests)");
}
Expand All @@ -50,9 +50,9 @@ fn main() {
println!("cargo:rustc-cfg=no_core_ffi_c_char");
}

if rustc.minor < 81 {
if rustc.minor >= 81 {
// core::error::Error
println!("cargo:rustc-cfg=no_core_error");
println!("cargo:rustc-cfg=error_in_core");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
use alloc::boxed::Box;
use core::fmt::{self, Display};

#[cfg(not(no_core_error))]
#[cfg(error_in_core)]
use core::error::Error as StdError;
#[cfg(all(feature = "std", no_core_error))]
#[cfg(all(feature = "std", not(error_in_core)))]
use std::error::Error as StdError;

/// Exception thrown from an `extern "C++"` function.
Expand All @@ -21,7 +21,7 @@ impl Display for Exception {
}
}

#[cfg(any(not(no_core_error), feature = "std"))]
#[cfg(any(error_in_core, feature = "std"))]
impl StdError for Exception {}

impl Exception {
Expand Down

0 comments on commit 2034697

Please sign in to comment.