diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-29 22:17:30 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-01 13:55:46 -0400 |
| commit | 40465d2449f3d9a36c86b94885f58ed3ee2a99f0 (patch) | |
| tree | a98bcd2bbf0fe57748eba20e2c90eaf96c4471d8 /compiler/rustc_builtin_macros | |
| parent | e3a0da18633a8cfb5263bb975747352690b01fcf (diff) | |
| download | rust-40465d2449f3d9a36c86b94885f58ed3ee2a99f0.tar.gz rust-40465d2449f3d9a36c86b94885f58ed3ee2a99f0.zip | |
Remove anon struct and union types
Diffstat (limited to 'compiler/rustc_builtin_macros')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/deriving/clone.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/deriving/mod.rs | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/src/deriving/clone.rs b/compiler/rustc_builtin_macros/src/deriving/clone.rs index dde696fca61..f79227d52a8 100644 --- a/compiler/rustc_builtin_macros/src/deriving/clone.rs +++ b/compiler/rustc_builtin_macros/src/deriving/clone.rs @@ -113,7 +113,7 @@ fn cs_clone_simple( // Already produced an assertion for this type. // Anonymous structs or unions must be eliminated as they cannot be // type parameters. - } else if !field.ty.kind.is_anon_adt() { + } else { // let _: AssertParamIsClone<FieldTy>; super::assert_ty_bounds(cx, &mut stmts, field.ty.clone(), field.span, &[ sym::clone, diff --git a/compiler/rustc_builtin_macros/src/deriving/mod.rs b/compiler/rustc_builtin_macros/src/deriving/mod.rs index d5ee5e430d5..e884c0ec718 100644 --- a/compiler/rustc_builtin_macros/src/deriving/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/mod.rs @@ -124,8 +124,6 @@ fn assert_ty_bounds( span: Span, assert_path: &[Symbol], ) { - // Deny anonymous structs or unions to avoid weird errors. - assert!(!ty.kind.is_anon_adt(), "Anonymous structs or unions cannot be type parameters"); // Generate statement `let _: assert_path<ty>;`. let span = cx.with_def_site_ctxt(span); let assert_path = cx.path_all(span, true, cx.std_path(assert_path), vec![GenericArg::Type(ty)]); |
