remove ExtCxt::struct_span_warn

This commit is contained in:
Mazdak Farrokhzad 2020-03-17 11:35:21 +01:00
parent c1ef1b3bca
commit ad26401dc1
2 changed files with 2 additions and 3 deletions

View File

@ -1014,9 +1014,6 @@ impl<'a> ExtCtxt<'a> {
self.current_expansion.id.expansion_cause()
}
pub fn struct_span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) -> DiagnosticBuilder<'a> {
self.parse_sess.span_diagnostic.struct_span_warn(sp, msg)
}
pub fn struct_span_err<S: Into<MultiSpan>>(&self, sp: S, msg: &str) -> DiagnosticBuilder<'a> {
self.parse_sess.span_diagnostic.struct_span_err(sp, msg)
}

View File

@ -1145,6 +1145,8 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
// macros are expanded before any lint passes so this warning has to be hardcoded
if attr.has_name(sym::derive) {
self.cx
.parse_sess()
.span_diagnostic
.struct_span_warn(attr.span, "`#[derive]` does nothing on macro invocations")
.note("this may become a hard error in a future release")
.emit();