Skip to content

Commit febaf22

Browse files
authored
Rollup merge of rust-lang#129592 - saethlin:core-cfg-test, r=tgross35
Remove cfg(test) from library/core The diff here is very small with the ignore whitespace option. `core` doesn't/can't have unit tests. All of its tests are just modules under `tests/`, so it has no use for `cfg(test)`, because the entire contents of `library/core/src` are only ever compiled with that cfg off, and the entire contents of `library/core/tests` are only ever compiled with that cfg on. You can tell this is what's happening because we had `#[cfg(test)]` on a module declaration that has no source file. I also deleted the extra `mod tests {` layer of nesting; there's no need to mention again in the module path that this is a module of tests. This exposes a name collision between the `u128` module of tests and `core::u128`. Fixed that by using `<u128>::MAX` like is done in the `check!` macro, which is what avoids this name ambiguity for the other types.
2 parents 77a1318 + 8dd3363 commit febaf22

File tree

5 files changed

+649
-659
lines changed

5 files changed

+649
-659
lines changed

core/src/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#![doc = include_str!("error.md")]
22
#![stable(feature = "error_in_core", since = "1.81.0")]
33

4-
#[cfg(test)]
5-
mod tests;
6-
74
use crate::any::TypeId;
85
use crate::fmt::{Debug, Display, Formatter, Result};
96

core/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ mod intrinsics;
141141
mod io;
142142
mod iter;
143143
mod lazy;
144-
#[cfg(test)]
145144
mod macros;
146145
mod manually_drop;
147146
mod mem;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy