Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub(crate) struct OnTypeErrorParser {
impl OnTypeErrorParser {
fn parse<'sess>(&mut self, cx: &mut AcceptContext<'_, 'sess>, args: &ArgParser, mode: Mode) {
if !cx.features().diagnostic_on_type_error() {
// `UnknownDiagnosticAttribute` is emitted in rustc_resolve/macros.rs
args.ignore_args();
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ check-pass

// Regression test for https://github.com/rust-lang/rust/issues/158628.

#[diagnostic::on_type_error(unknown = "")]
//~^ WARN unknown diagnostic attribute
pub struct Foo {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: unknown diagnostic attribute
--> $DIR/feature-gate-diagnostic-on-type-error-malformed-args.rs:5:15
|
LL | #[diagnostic::on_type_error(unknown = "")]
| ^^^^^^^^^^^^^
|
= help: add `#![feature(diagnostic_on_type_error)]` to the crate attributes to enable
= note: `#[warn(unknown_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default

warning: 1 warning emitted

Loading