mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
add on_unmatch_args
This commit is contained in:
@@ -45,6 +45,9 @@ fn clone(&self) -> Self {
|
||||
/// variant must also be specified. Only a single field is supported.
|
||||
#[unstable(feature = "field_projections", issue = "145383")]
|
||||
#[allow_internal_unstable(field_representing_type_raw, builtin_syntax)]
|
||||
#[diagnostic::on_unmatch_args(
|
||||
note = "this macro expects a container type and a field path, like `field_of!(Type, field)` or `field_of!(Enum, Variant.field)`"
|
||||
)]
|
||||
// NOTE: when stabilizing this macro, we can never add new trait impls for `FieldRepresentingType`,
|
||||
// since it is `#[fundamental]` and thus could break users of this macro, since the compiler expands
|
||||
// it to `FieldRepresentingType<...>`. Thus stabilizing this requires careful thought about the
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
#![feature(deprecated_suggestion)]
|
||||
#![feature(derive_const)]
|
||||
#![feature(diagnostic_on_const)]
|
||||
#![feature(diagnostic_on_unmatch_args)]
|
||||
#![feature(doc_cfg)]
|
||||
#![feature(doc_notable_trait)]
|
||||
#![feature(extern_types)]
|
||||
|
||||
@@ -1567,6 +1567,9 @@ impl<T> SizedTypeProperties for T {}
|
||||
/// [`offset_of_enum`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/offset-of-enum.html
|
||||
/// [`offset_of_slice`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/offset-of-slice.html
|
||||
#[stable(feature = "offset_of", since = "1.77.0")]
|
||||
#[diagnostic::on_unmatch_args(
|
||||
note = "this macro expects a container type and a (nested) field path, like `offset_of!(Type, field)`"
|
||||
)]
|
||||
#[allow_internal_unstable(builtin_syntax, core_intrinsics)]
|
||||
pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) {
|
||||
// The `{}` is for better error messages
|
||||
|
||||
Reference in New Issue
Block a user