Skip to content

Commit

Permalink
Allow currently unused tuple struct fields
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Nov 25, 2023
1 parent 16087ee commit 7e2c7e4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct Upvar<'tcx> {
}

/// Associate some local constants with the `'tcx` lifetime
struct TyCtxtConsts<'tcx>(TyCtxt<'tcx>);
struct TyCtxtConsts<'tcx>(#[allow(unused_tuple_struct_fields)] TyCtxt<'tcx>);
impl<'tcx> TyCtxtConsts<'tcx> {
const DEREF_PROJECTION: &'tcx [PlaceElem<'tcx>; 1] = &[ProjectionElem::Deref];
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/nll_relate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub trait TypeRelatingDelegate<'tcx> {
}

#[derive(Copy, Clone)]
struct UniversallyQuantified(bool);
struct UniversallyQuantified(#[allow(unused_tuple_struct_fields)] bool);

impl<'me, 'tcx, D> TypeRelating<'me, 'tcx, D>
where
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/check_unsafety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ pub(crate) fn provide(providers: &mut Providers) {
enum Context {
Safe,
/// in an `unsafe fn`
UnsafeFn(HirId),
UnsafeFn(#[allow(unused_tuple_struct_fields)] HirId),
/// in a *used* `unsafe` block
/// (i.e. a block without unused-unsafe warning)
UnsafeBlock(HirId),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl<'a> ParentScope<'a> {
#[derive(Copy, Debug, Clone)]
enum ImplTraitContext {
Existential,
Universal(LocalDefId),
Universal(#[allow(unused_tuple_struct_fields)] LocalDefId),
}

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/boxed/thin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ struct WithHeader<H>(NonNull<u8>, PhantomData<H>);
/// An opaque representation of `WithHeader<H>` to avoid the
/// projection invariance of `<T as Pointee>::Metadata`.
#[repr(transparent)]
struct WithOpaqueHeader(NonNull<u8>);
struct WithOpaqueHeader(#[allow(unused_tuple_struct_fields)] NonNull<u8>);

impl WithOpaqueHeader {
#[cfg(not(no_global_oom_handling))]
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ pub(crate) enum TypeBindingKind {
pub(crate) enum SubstParam {
Type(Type),
Lifetime(Lifetime),
Constant(Constant),
Constant(#[allow(unused_tuple_struct_fields)] Constant),
}

impl SubstParam {
Expand Down

0 comments on commit 7e2c7e4

Please sign in to comment.