Skip to content

Commit 2393637

Browse files
IvarWithoutBonesjoriskleiber
authored andcommitted
internal: minicore: add the Hash derive macro to the prelude
This commit adds the core::hash::Hash derive macro to the prelude, just like rustc does. They define the macro in a private core::hash::macros module, presumably to differentiate between the macro and trait (who otherwise share the same path). Only the macro is in the prelude, which minicore now mirrors. I've also added support for multiple "line regions" in minicore, as the prelude re-export needs both "hash" and "derive". The syntax looks as follows: "// :hash, derive".
1 parent e10fa93 commit 2393637

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/test-utils/src/minicore.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,7 @@ pub mod prelude {
19781978
convert::AsRef, // :as_ref
19791979
convert::{From, Into, TryFrom, TryInto}, // :from
19801980
default::Default, // :default
1981+
hash::macros::Hash, // :hash, derive
19811982
iter::{IntoIterator, Iterator}, // :iterator
19821983
macros::builtin::{derive, derive_const}, // :derive
19831984
marker::Copy, // :copy

0 commit comments

Comments
 (0)