Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ pub mod autodiff {
#[unstable(feature = "contracts", issue = "128044")]
pub mod contracts;

#[unstable(feature = "derive_macro_global_path", issue = "154645")]
pub use crate::macros::builtin::derive;
#[stable(feature = "cfg_select", since = "1.95.0")]
pub use crate::macros::cfg_select;

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ pub(crate) mod builtin {
///
/// See [the reference] for more info.
///
/// [the reference]: ../../../reference/attributes/derive.html
/// [the reference]: ../reference/attributes/derive.html
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_builtin_macro]
pub macro derive($item:item) {
Expand Down
6 changes: 5 additions & 1 deletion library/core/src/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ pub use crate::trace_macros;
// (no public module for them to be re-exported from).
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
pub use crate::macros::builtin::{
alloc_error_handler, bench, derive, global_allocator, test, test_case,
alloc_error_handler, bench, global_allocator, test, test_case,
};

#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use crate::macros::builtin::derive;

#[unstable(feature = "derive_const", issue = "118304")]
pub use crate::macros::builtin::derive_const;

Expand Down
2 changes: 2 additions & 0 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ pub use core::cfg_select;
reason = "`concat_bytes` is not stable enough for use and is subject to change"
)]
pub use core::concat_bytes;
#[unstable(feature = "derive_macro_global_path", issue = "154645")]
pub use core::derive;
#[stable(feature = "matches_macro", since = "1.42.0")]
#[allow(deprecated, deprecated_in_future)]
pub use core::matches;
Expand Down
6 changes: 5 additions & 1 deletion library/std/src/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ pub use core::prelude::v1::trace_macros;
// (no public module for them to be re-exported from).
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
pub use core::prelude::v1::{
alloc_error_handler, bench, derive, global_allocator, test, test_case,
alloc_error_handler, bench, global_allocator, test, test_case,
};

#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use core::prelude::v1::derive;

#[unstable(feature = "derive_const", issue = "118304")]
pub use core::prelude::v1::derive_const;

Expand Down
10 changes: 10 additions & 0 deletions tests/ui/imports/global-derive-path.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ edition: 2024
//@ check-pass
#![crate_type = "lib"]
#![feature(derive_macro_global_path)]

#[::core::derive(Clone)]
struct Y;

#[::std::derive(Clone)]
struct X;
Loading