Allow all associated functions and add test

This commit is contained in:
Deadbeef
2023-04-16 06:30:45 +00:00
parent b59ec166ad
commit dda89945b7
4 changed files with 38 additions and 11 deletions

View File

@@ -1745,10 +1745,10 @@ impl CheckAttrVisitor<'_> {
| Target::Union
| Target::Enum
| Target::Fn
| Target::Method(MethodKind::Inherent) => continue,
| Target::Method(_) => continue,
_ => {
self.tcx.sess.emit_err(
errors::AttrApplication::StructEnumFunctionInherentMethodUnion {
errors::AttrApplication::StructEnumFunctionMethodUnion {
hint_span: hint.span(),
span,
},