unused: mark Lock method on NoCopy sentinel as used
When using `-exported`, the Lock method won't automatically be marked as
used, which led to the method being flagged as unused. Explicitly mark
it as used by the NoCopy sentinel type.
@@ -318,6 +318,7 @@ func (c *Checker) useNoCopyFields(typ types.Type) {
field := st.Field(i)
if isNoCopyType(field.Type()) {
c.graph.markUsedBy(field, typ)
+ c.graph.markUsedBy(field.Type().(*types.Named).Method(0), field.Type())
}
}
}
