about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui-fulldeps/fluent-messages/test.rs5
-rw-r--r--src/test/ui-fulldeps/fluent-messages/test.stderr29
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics.rs10
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics.stderr2
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs272
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr202
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs106
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr72
8 files changed, 356 insertions, 342 deletions
diff --git a/src/test/ui-fulldeps/fluent-messages/test.rs b/src/test/ui-fulldeps/fluent-messages/test.rs
index 256857e52a7..4e8147e2b76 100644
--- a/src/test/ui-fulldeps/fluent-messages/test.rs
+++ b/src/test/ui-fulldeps/fluent-messages/test.rs
@@ -49,6 +49,7 @@ mod duplicate {
     use super::fluent_messages;
 
     fluent_messages! {
+//~^ ERROR the name `a_b_key` is defined multiple times
         a => "./duplicate-a.ftl",
         a_b => "./duplicate-a-b.ftl",
 //~^ ERROR overrides existing message: `a_b_key`
@@ -80,7 +81,7 @@ mod valid {
         valid => "./valid.ftl",
     }
 
-    use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, valid::key};
+    use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, valid_key};
 }
 
 mod missing_crate_name {
@@ -93,5 +94,5 @@ mod missing_crate_name {
 //~| ERROR name `with-hyphens` does not start with the crate name
     }
 
-    use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, test_crate::{foo, with_hyphens}};
+    use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, test_crate_foo, with_hyphens};
 }
diff --git a/src/test/ui-fulldeps/fluent-messages/test.stderr b/src/test/ui-fulldeps/fluent-messages/test.stderr
index 26d87430a8f..d1cd4fe26da 100644
--- a/src/test/ui-fulldeps/fluent-messages/test.stderr
+++ b/src/test/ui-fulldeps/fluent-messages/test.stderr
@@ -30,19 +30,31 @@ error: expected a message field for "missing_message"
   |
 
 error: overrides existing message: `a_b_key`
-  --> $DIR/test.rs:53:16
+  --> $DIR/test.rs:54:16
    |
 LL |         a_b => "./duplicate-a-b.ftl",
    |                ^^^^^^^^^^^^^^^^^^^^^
    |
 help: previously defined in this resource
-  --> $DIR/test.rs:52:14
+  --> $DIR/test.rs:53:14
    |
 LL |         a => "./duplicate-a.ftl",
    |              ^^^^^^^^^^^^^^^^^^^
 
+error[E0428]: the name `a_b_key` is defined multiple times
+  --> $DIR/test.rs:51:5
+   |
+LL |     fluent_messages! {
+   |     ^^^^^^^^^^^^^^^^
+   |     |
+   |     `a_b_key` redefined here
+   |     previous definition of the value `a_b_key` here
+   |
+   = note: os-specific message
+   = note: os-specific message
+
 error: name `slug_with_hyphens_this-slug-has-hyphens` contains a '-' character
-  --> $DIR/test.rs:62:30
+  --> $DIR/test.rs:63:30
    |
 LL |         slug_with_hyphens => "./slug-with-hyphens.ftl",
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +62,7 @@ LL |         slug_with_hyphens => "./slug-with-hyphens.ftl",
    = help: replace any '-'s with '_'s
 
 error: attribute `label-has-hyphens` contains a '-' character
-  --> $DIR/test.rs:71:31
+  --> $DIR/test.rs:72:31
    |
 LL |         label_with_hyphens => "./label-with-hyphens.ftl",
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -58,7 +70,7 @@ LL |         label_with_hyphens => "./label-with-hyphens.ftl",
    = help: replace any '-'s with '_'s
 
 error: name `with-hyphens` contains a '-' character
-  --> $DIR/test.rs:90:23
+  --> $DIR/test.rs:91:23
    |
 LL |         test_crate => "./missing-crate-name.ftl",
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -66,7 +78,7 @@ LL |         test_crate => "./missing-crate-name.ftl",
    = help: replace any '-'s with '_'s
 
 error: name `with-hyphens` does not start with the crate name
-  --> $DIR/test.rs:90:23
+  --> $DIR/test.rs:91:23
    |
 LL |         test_crate => "./missing-crate-name.ftl",
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -74,12 +86,13 @@ LL |         test_crate => "./missing-crate-name.ftl",
    = help: prepend `test_crate_` to the slug name: `test_crate_with_hyphens`
 
 error: name `test-crate_foo` contains a '-' character
-  --> $DIR/test.rs:90:23
+  --> $DIR/test.rs:91:23
    |
 LL |         test_crate => "./missing-crate-name.ftl",
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: replace any '-'s with '_'s
 
-error: aborting due to 9 previous errors
+error: aborting due to 10 previous errors
 
+For more information about this error, try `rustc --explain E0428`.
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
index 462f5e78498..643e81d99c6 100644
--- a/src/test/ui-fulldeps/internal-lints/diagnostics.rs
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
@@ -19,14 +19,14 @@ use rustc_macros::{Diagnostic, Subdiagnostic};
 use rustc_span::Span;
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct DeriveDiagnostic {
     #[primary_span]
     span: Span,
 }
 
 #[derive(Subdiagnostic)]
-#[note(compiletest::example)]
+#[note(compiletest_example)]
 struct Note {
     #[primary_span]
     span: Span,
@@ -45,7 +45,7 @@ pub struct TranslatableInIntoDiagnostic;
 
 impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInIntoDiagnostic {
     fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
-        handler.struct_err(fluent::compiletest::example)
+        handler.struct_err(fluent::compiletest_example)
     }
 }
 
@@ -68,12 +68,12 @@ impl AddToDiagnostic for TranslatableInAddToDiagnostic {
     where
         F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,
     {
-        diag.note(fluent::compiletest::note);
+        diag.note(fluent::note);
     }
 }
 
 pub fn make_diagnostics<'a>(handler: &'a Handler) {
-    let _diag = handler.struct_err(fluent::compiletest::example);
+    let _diag = handler.struct_err(fluent::compiletest_example);
     //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
 
     let _diag = handler.struct_err("untranslatable diagnostic");
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
index ac820a79db2..510d6a17108 100644
--- a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
@@ -19,7 +19,7 @@ LL |         diag.note("untranslatable diagnostic");
 error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
   --> $DIR/diagnostics.rs:76:25
    |
-LL |     let _diag = handler.struct_err(fluent::compiletest::example);
+LL |     let _diag = handler.struct_err(fluent::compiletest_example);
    |                         ^^^^^^^^^^
    |
 note: the lint level is defined here
diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index b8deb48d49a..46164d573b0 100644
--- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -28,15 +28,15 @@ use rustc_errors::{Applicability, MultiSpan};
 extern crate rustc_session;
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct Hello {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct HelloWarn {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 //~^ ERROR unsupported type attribute for diagnostic derive enum
 enum DiagnosticOnEnum {
     Foo,
@@ -46,13 +46,13 @@ enum DiagnosticOnEnum {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 #[diag = "E0123"]
 //~^ ERROR `#[diag = ...]` is not a valid attribute
 struct WrongStructAttrStyle {}
 
 #[derive(Diagnostic)]
-#[nonsense(compiletest::example, code = "E0123")]
+#[nonsense(compiletest_example, code = "E0123")]
 //~^ ERROR `#[nonsense(...)]` is not a valid attribute
 //~^^ ERROR diagnostic slug not specified
 //~^^^ ERROR cannot find attribute `nonsense` in this scope
@@ -90,12 +90,12 @@ struct InvalidNestedStructAttr2 {}
 struct InvalidNestedStructAttr3 {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123", slug = "foo")]
+#[diag(compiletest_example, code = "E0123", slug = "foo")]
 //~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
 struct InvalidNestedStructAttr4 {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct WrongPlaceField {
     #[suggestion = "bar"]
     //~^ ERROR `#[suggestion = ...]` is not a valid attribute
@@ -103,20 +103,20 @@ struct WrongPlaceField {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
-#[diag(compiletest::example, code = "E0456")]
+#[diag(compiletest_example, code = "E0123")]
+#[diag(compiletest_example, code = "E0456")]
 //~^ ERROR specified multiple times
 //~^^ ERROR specified multiple times
 struct DiagSpecifiedTwice {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0456", code = "E0457")]
+#[diag(compiletest_example, code = "E0456", code = "E0457")]
 //~^ ERROR specified multiple times
 struct CodeSpecifiedTwice {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, compiletest::example, code = "E0456")]
-//~^ ERROR `#[diag(compiletest::example)]` is not a valid attribute
+#[diag(compiletest_example, compiletest_example, code = "E0456")]
+//~^ ERROR `#[diag(compiletest_example)]` is not a valid attribute
 struct SlugSpecifiedTwice {}
 
 #[derive(Diagnostic)]
@@ -128,11 +128,11 @@ struct KindNotProvided {} //~ ERROR diagnostic slug not specified
 struct SlugNotProvided {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct CodeNotProvided {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct MessageWrongType {
     #[primary_span]
     //~^ ERROR `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@@ -140,7 +140,7 @@ struct MessageWrongType {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct InvalidPathFieldAttr {
     #[nonsense]
     //~^ ERROR `#[nonsense]` is not a valid attribute
@@ -149,34 +149,34 @@ struct InvalidPathFieldAttr {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithField {
     name: String,
-    #[label(compiletest::label)]
+    #[label(label)]
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithMessageAppliedToField {
-    #[label(compiletest::label)]
+    #[label(label)]
     //~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
     name: String,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithNonexistentField {
-    #[suggestion(compiletest::suggestion, code = "{name}")]
+    #[suggestion(suggestion, code = "{name}")]
     //~^ ERROR `name` doesn't refer to a field on this type
     suggestion: (Span, Applicability),
 }
 
 #[derive(Diagnostic)]
 //~^ ERROR invalid format string: expected `'}'`
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorMissingClosingBrace {
-    #[suggestion(compiletest::suggestion, code = "{name")]
+    #[suggestion(suggestion, code = "{name")]
     suggestion: (Span, Applicability),
     name: String,
     val: usize,
@@ -184,49 +184,49 @@ struct ErrorMissingClosingBrace {
 
 #[derive(Diagnostic)]
 //~^ ERROR invalid format string: unmatched `}`
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorMissingOpeningBrace {
-    #[suggestion(compiletest::suggestion, code = "name}")]
+    #[suggestion(suggestion, code = "name}")]
     suggestion: (Span, Applicability),
     name: String,
     val: usize,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct LabelOnSpan {
-    #[label(compiletest::label)]
+    #[label(label)]
     sp: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct LabelOnNonSpan {
-    #[label(compiletest::label)]
+    #[label(label)]
     //~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
     id: u32,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct Suggest {
-    #[suggestion(compiletest::suggestion, code = "This is the suggested code")]
-    #[suggestion_short(compiletest::suggestion, code = "This is the suggested code")]
-    #[suggestion_hidden(compiletest::suggestion, code = "This is the suggested code")]
-    #[suggestion_verbose(compiletest::suggestion, code = "This is the suggested code")]
+    #[suggestion(suggestion, code = "This is the suggested code")]
+    #[suggestion_short(suggestion, code = "This is the suggested code")]
+    #[suggestion_hidden(suggestion, code = "This is the suggested code")]
+    #[suggestion_verbose(suggestion, code = "This is the suggested code")]
     suggestion: (Span, Applicability),
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithoutCode {
-    #[suggestion(compiletest::suggestion)]
+    #[suggestion(suggestion)]
     //~^ ERROR suggestion without `code = "..."`
     suggestion: (Span, Applicability),
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithBadKey {
     #[suggestion(nonsense = "bar")]
     //~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
@@ -235,7 +235,7 @@ struct SuggestWithBadKey {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithShorthandMsg {
     #[suggestion(msg = "bar")]
     //~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
@@ -244,52 +244,52 @@ struct SuggestWithShorthandMsg {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithoutMsg {
     #[suggestion(code = "bar")]
     suggestion: (Span, Applicability),
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithTypesSwapped {
-    #[suggestion(compiletest::suggestion, code = "This is suggested code")]
+    #[suggestion(suggestion, code = "This is suggested code")]
     suggestion: (Applicability, Span),
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithWrongTypeApplicabilityOnly {
-    #[suggestion(compiletest::suggestion, code = "This is suggested code")]
+    #[suggestion(suggestion, code = "This is suggested code")]
     //~^ ERROR wrong field type for suggestion
     suggestion: Applicability,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithSpanOnly {
-    #[suggestion(compiletest::suggestion, code = "This is suggested code")]
+    #[suggestion(suggestion, code = "This is suggested code")]
     suggestion: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithDuplicateSpanAndApplicability {
-    #[suggestion(compiletest::suggestion, code = "This is suggested code")]
+    #[suggestion(suggestion, code = "This is suggested code")]
     suggestion: (Span, Span, Applicability),
     //~^ ERROR specified multiple times
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct SuggestWithDuplicateApplicabilityAndSpan {
-    #[suggestion(compiletest::suggestion, code = "This is suggested code")]
+    #[suggestion(suggestion, code = "This is suggested code")]
     suggestion: (Applicability, Applicability, Span),
     //~^ ERROR specified multiple times
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct WrongKindOfAnnotation {
     #[label = "bar"]
     //~^ ERROR `#[label = ...]` is not a valid attribute
@@ -297,38 +297,38 @@ struct WrongKindOfAnnotation {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct OptionsInErrors {
-    #[label(compiletest::label)]
+    #[label(label)]
     label: Option<Span>,
-    #[suggestion(compiletest::suggestion, code = "...")]
+    #[suggestion(suggestion, code = "...")]
     opt_sugg: Option<(Span, Applicability)>,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0456")]
+#[diag(compiletest_example, code = "E0456")]
 struct MoveOutOfBorrowError<'tcx> {
     name: Ident,
     ty: Ty<'tcx>,
     #[primary_span]
-    #[label(compiletest::label)]
+    #[label(label)]
     span: Span,
-    #[label(compiletest::label)]
+    #[label(label)]
     other_span: Span,
-    #[suggestion(compiletest::suggestion, code = "{name}.clone()")]
+    #[suggestion(suggestion, code = "{name}.clone()")]
     opt_sugg: Option<(Span, Applicability)>,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithLifetime<'a> {
-    #[label(compiletest::label)]
+    #[label(label)]
     span: Span,
     name: &'a str,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithDefaultLabelAttr<'a> {
     #[label]
     span: Span,
@@ -337,7 +337,7 @@ struct ErrorWithDefaultLabelAttr<'a> {
 
 #[derive(Diagnostic)]
 //~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ArgFieldWithoutSkip {
     #[primary_span]
     span: Span,
@@ -345,7 +345,7 @@ struct ArgFieldWithoutSkip {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ArgFieldWithSkip {
     #[primary_span]
     span: Span,
@@ -356,132 +356,132 @@ struct ArgFieldWithSkip {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithSpannedNote {
     #[note]
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithSpannedNoteCustom {
-    #[note(compiletest::note)]
+    #[note(note)]
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 #[note]
 struct ErrorWithNote {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
-#[note(compiletest::note)]
+#[diag(compiletest_example, code = "E0123")]
+#[note(note)]
 struct ErrorWithNoteCustom {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithSpannedHelp {
     #[help]
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithSpannedHelpCustom {
-    #[help(compiletest::help)]
+    #[help(help)]
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 #[help]
 struct ErrorWithHelp {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
-#[help(compiletest::help)]
+#[diag(compiletest_example, code = "E0123")]
+#[help(help)]
 struct ErrorWithHelpCustom {
     val: String,
 }
 
 #[derive(Diagnostic)]
 #[help]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithHelpWrongOrder {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[help(compiletest::help)]
-#[diag(compiletest::example, code = "E0123")]
+#[help(help)]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithHelpCustomWrongOrder {
     val: String,
 }
 
 #[derive(Diagnostic)]
 #[note]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithNoteWrongOrder {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[note(compiletest::note)]
-#[diag(compiletest::example, code = "E0123")]
+#[note(note)]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithNoteCustomWrongOrder {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ApplicabilityInBoth {
-    #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")]
+    #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
     //~^ ERROR specified multiple times
     suggestion: (Span, Applicability),
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct InvalidApplicability {
-    #[suggestion(compiletest::suggestion, code = "...", applicability = "batman")]
+    #[suggestion(suggestion, code = "...", applicability = "batman")]
     //~^ ERROR invalid applicability
     suggestion: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ValidApplicability {
-    #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")]
+    #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
     suggestion: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct NoApplicability {
-    #[suggestion(compiletest::suggestion, code = "...")]
+    #[suggestion(suggestion, code = "...")]
     suggestion: Span,
 }
 
 #[derive(Subdiagnostic)]
-#[note(parser::add_paren)]
+#[note(parser_add_paren)]
 struct Note;
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct Subdiagnostic {
     #[subdiagnostic]
     note: Note,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct VecField {
     #[primary_span]
     #[label]
@@ -489,58 +489,58 @@ struct VecField {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct UnitField {
     #[primary_span]
     spans: Span,
     #[help]
     foo: (),
-    #[help(compiletest::help)]
+    #[help(help)]
     bar: (),
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct OptUnitField {
     #[primary_span]
     spans: Span,
     #[help]
     foo: Option<()>,
-    #[help(compiletest::help)]
+    #[help(help)]
     bar: Option<()>,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct LabelWithTrailingPath {
-    #[label(compiletest::label, foo)]
+    #[label(label, foo)]
     //~^ ERROR `#[label(foo)]` is not a valid attribute
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct LabelWithTrailingNameValue {
-    #[label(compiletest::label, foo = "...")]
+    #[label(label, foo = "...")]
     //~^ ERROR `#[label(foo = ...)]` is not a valid attribute
     span: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct LabelWithTrailingList {
-    #[label(compiletest::label, foo("..."))]
+    #[label(label, foo("..."))]
     //~^ ERROR `#[label(foo(...))]` is not a valid attribute
     span: Span,
 }
 
 #[derive(LintDiagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct LintsGood {
 }
 
 #[derive(LintDiagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct PrimarySpanOnLint {
     #[primary_span]
     //~^ ERROR `#[primary_span]` is not a valid attribute
@@ -548,42 +548,42 @@ struct PrimarySpanOnLint {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct ErrorWithMultiSpan {
     #[primary_span]
     span: MultiSpan,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 #[warning]
 struct ErrorWithWarn {
     val: String,
 }
 
 #[derive(Diagnostic)]
-#[error(compiletest::example, code = "E0123")]
+#[error(compiletest_example, code = "E0123")]
 //~^ ERROR `#[error(...)]` is not a valid attribute
 //~| ERROR diagnostic slug not specified
 //~| ERROR cannot find attribute `error` in this scope
 struct ErrorAttribute {}
 
 #[derive(Diagnostic)]
-#[warn_(compiletest::example, code = "E0123")]
+#[warn_(compiletest_example, code = "E0123")]
 //~^ ERROR `#[warn_(...)]` is not a valid attribute
 //~| ERROR diagnostic slug not specified
 //~| ERROR cannot find attribute `warn_` in this scope
 struct WarnAttribute {}
 
 #[derive(Diagnostic)]
-#[lint(compiletest::example, code = "E0123")]
+#[lint(compiletest_example, code = "E0123")]
 //~^ ERROR `#[lint(...)]` is not a valid attribute
 //~| ERROR diagnostic slug not specified
 //~| ERROR cannot find attribute `lint` in this scope
 struct LintAttributeOnSessionDiag {}
 
 #[derive(LintDiagnostic)]
-#[lint(compiletest::example, code = "E0123")]
+#[lint(compiletest_example, code = "E0123")]
 //~^ ERROR `#[lint(...)]` is not a valid attribute
 //~| ERROR `#[lint(...)]` is not a valid attribute
 //~| ERROR diagnostic slug not specified
@@ -591,55 +591,55 @@ struct LintAttributeOnSessionDiag {}
 struct LintAttributeOnLintDiag {}
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct DuplicatedSuggestionCode {
-    #[suggestion(compiletest::suggestion, code = "...", code = ",,,")]
+    #[suggestion(suggestion, code = "...", code = ",,,")]
     //~^ ERROR specified multiple times
     suggestion: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct InvalidTypeInSuggestionTuple {
-    #[suggestion(compiletest::suggestion, code = "...")]
+    #[suggestion(suggestion, code = "...")]
     suggestion: (Span, usize),
     //~^ ERROR wrong types for suggestion
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct MissingApplicabilityInSuggestionTuple {
-    #[suggestion(compiletest::suggestion, code = "...")]
+    #[suggestion(suggestion, code = "...")]
     suggestion: (Span,),
     //~^ ERROR wrong types for suggestion
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct MissingCodeInSuggestion {
-    #[suggestion(compiletest::suggestion)]
+    #[suggestion(suggestion)]
     //~^ ERROR suggestion without `code = "..."`
     suggestion: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
-#[multipart_suggestion(compiletest::suggestion)]
+#[diag(compiletest_example, code = "E0123")]
+#[multipart_suggestion(suggestion)]
 //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
 //~| ERROR cannot find attribute `multipart_suggestion` in this scope
 #[multipart_suggestion()]
 //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
 //~| ERROR cannot find attribute `multipart_suggestion` in this scope
 struct MultipartSuggestion {
-    #[multipart_suggestion(compiletest::suggestion)]
+    #[multipart_suggestion(suggestion)]
     //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
     //~| ERROR cannot find attribute `multipart_suggestion` in this scope
     suggestion: Span,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
-#[suggestion(compiletest::suggestion, code = "...")]
+#[diag(compiletest_example, code = "E0123")]
+#[suggestion(suggestion, code = "...")]
 //~^ ERROR `#[suggestion(...)]` is not a valid attribute
 struct SuggestionOnStruct {
     #[primary_span]
@@ -647,7 +647,7 @@ struct SuggestionOnStruct {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 #[label]
 //~^ ERROR `#[label]` is not a valid attribute
 struct LabelOnStruct {
@@ -657,30 +657,30 @@ struct LabelOnStruct {
 
 #[derive(Diagnostic)]
 enum ExampleEnum {
-    #[diag(compiletest::example)]
+    #[diag(compiletest_example)]
     Foo {
         #[primary_span]
         sp: Span,
         #[note]
         note_sp: Span,
     },
-    #[diag(compiletest::example)]
+    #[diag(compiletest_example)]
     Bar {
         #[primary_span]
         sp: Span,
     },
-    #[diag(compiletest::example)]
+    #[diag(compiletest_example)]
     Baz,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct RawIdentDiagnosticArg {
     pub r#type: String,
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticBad {
     #[subdiagnostic(bad)]
 //~^ ERROR `#[subdiagnostic(bad)]` is not a valid attribute
@@ -688,7 +688,7 @@ struct SubdiagnosticBad {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticBadStr {
     #[subdiagnostic = "bad"]
 //~^ ERROR `#[subdiagnostic = ...]` is not a valid attribute
@@ -696,7 +696,7 @@ struct SubdiagnosticBadStr {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticBadTwice {
     #[subdiagnostic(bad, bad)]
 //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
@@ -704,7 +704,7 @@ struct SubdiagnosticBadTwice {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticBadLitStr {
     #[subdiagnostic("bad")]
 //~^ ERROR `#[subdiagnostic("...")]` is not a valid attribute
@@ -712,7 +712,7 @@ struct SubdiagnosticBadLitStr {
 }
 
 #[derive(LintDiagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticEagerLint {
     #[subdiagnostic(eager)]
 //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
@@ -720,7 +720,7 @@ struct SubdiagnosticEagerLint {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticEagerCorrect {
     #[subdiagnostic(eager)]
     note: Note,
@@ -732,7 +732,7 @@ struct SubdiagnosticEagerCorrect {
 
 #[derive(Subdiagnostic)]
 #[suggestion_short(
-    parser::use_instead,
+    use_instead,
     applicability = "machine-applicable",
     code = "{correct}"
 )]
@@ -744,7 +744,7 @@ pub(crate) struct SubdiagnosticWithSuggestion {
 }
 
 #[derive(Diagnostic)]
-#[diag(compiletest::example)]
+#[diag(compiletest_example)]
 struct SubdiagnosticEagerSuggestion {
     #[subdiagnostic(eager)]
     sub: SubdiagnosticWithSuggestion,
@@ -752,7 +752,7 @@ struct SubdiagnosticEagerSuggestion {
 
 /// with a doc comment on the type..
 #[derive(Diagnostic)]
-#[diag(compiletest::example, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
 struct WithDocComment {
     /// ..and the field
     #[primary_span]
diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 7a42d618707..0a1c4bddb06 100644
--- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -1,8 +1,8 @@
 error: unsupported type attribute for diagnostic derive enum
   --> $DIR/diagnostic-derive.rs:39:1
    |
-LL | #[diag(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:42:5
@@ -10,7 +10,7 @@ error: diagnostic slug not specified
 LL |     Foo,
    |     ^^^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:44:5
@@ -18,7 +18,7 @@ error: diagnostic slug not specified
 LL |     Bar,
    |     ^^^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[diag = ...]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:50:1
@@ -29,20 +29,20 @@ LL | #[diag = "E0123"]
 error: `#[nonsense(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:55:1
    |
-LL | #[nonsense(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[nonsense(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:55:1
    |
-LL | / #[nonsense(compiletest::example, code = "E0123")]
+LL | / #[nonsense(compiletest_example, code = "E0123")]
 LL | |
 LL | |
 LL | |
 LL | | struct InvalidStructAttr {}
    | |___________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[diag("...")]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:62:8
@@ -61,7 +61,7 @@ LL | |
 LL | | struct InvalidLitNestedAttr {}
    | |______________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[diag(nonsense(...))]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:73:8
@@ -80,7 +80,7 @@ LL | |
 LL | | struct InvalidNestedStructAttr1 {}
    | |__________________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[diag(nonsense = ...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:79:8
@@ -108,7 +108,7 @@ LL | |
 LL | | struct InvalidNestedStructAttr2 {}
    | |__________________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[diag(nonsense = ...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:86:8
@@ -134,13 +134,13 @@ LL | |
 LL | | struct InvalidNestedStructAttr3 {}
    | |__________________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[diag(slug = ...)]` is not a valid attribute
-  --> $DIR/diagnostic-derive.rs:93:46
+  --> $DIR/diagnostic-derive.rs:93:45
    |
-LL | #[diag(compiletest::example, code = "E0123", slug = "foo")]
-   |                                              ^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123", slug = "foo")]
+   |                                             ^^^^^^^^^^^^
    |
    = help: only `code` is a valid nested attributes following the slug
 
@@ -153,44 +153,44 @@ LL |     #[suggestion = "bar"]
 error: specified multiple times
   --> $DIR/diagnostic-derive.rs:107:8
    |
-LL | #[diag(compiletest::example, code = "E0456")]
-   |        ^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456")]
+   |        ^^^^^^^^^^^^^^^^^^^
    |
 note: previously specified here
   --> $DIR/diagnostic-derive.rs:106:8
    |
-LL | #[diag(compiletest::example, code = "E0123")]
-   |        ^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123")]
+   |        ^^^^^^^^^^^^^^^^^^^
 
 error: specified multiple times
-  --> $DIR/diagnostic-derive.rs:107:37
+  --> $DIR/diagnostic-derive.rs:107:36
    |
-LL | #[diag(compiletest::example, code = "E0456")]
-   |                                     ^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456")]
+   |                                    ^^^^^^^
    |
 note: previously specified here
-  --> $DIR/diagnostic-derive.rs:106:37
+  --> $DIR/diagnostic-derive.rs:106:36
    |
-LL | #[diag(compiletest::example, code = "E0123")]
-   |                                     ^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123")]
+   |                                    ^^^^^^^
 
 error: specified multiple times
-  --> $DIR/diagnostic-derive.rs:113:53
+  --> $DIR/diagnostic-derive.rs:113:52
    |
-LL | #[diag(compiletest::example, code = "E0456", code = "E0457")]
-   |                                                     ^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
+   |                                                    ^^^^^^^
    |
 note: previously specified here
-  --> $DIR/diagnostic-derive.rs:113:37
+  --> $DIR/diagnostic-derive.rs:113:36
    |
-LL | #[diag(compiletest::example, code = "E0456", code = "E0457")]
-   |                                     ^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
+   |                                    ^^^^^^^
 
-error: `#[diag(compiletest::example)]` is not a valid attribute
-  --> $DIR/diagnostic-derive.rs:118:30
+error: `#[diag(compiletest_example)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:118:29
    |
-LL | #[diag(compiletest::example, compiletest::example, code = "E0456")]
-   |                              ^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, compiletest_example, code = "E0456")]
+   |                             ^^^^^^^^^^^^^^^^^^^
    |
    = help: diagnostic slug must be the first argument
 
@@ -200,7 +200,7 @@ error: diagnostic slug not specified
 LL | struct KindNotProvided {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:126:1
@@ -210,7 +210,7 @@ LL | |
 LL | | struct SlugNotProvided {}
    | |_________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
   --> $DIR/diagnostic-derive.rs:137:5
@@ -227,14 +227,14 @@ LL |     #[nonsense]
 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
   --> $DIR/diagnostic-derive.rs:162:5
    |
-LL |     #[label(compiletest::label)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[label(label)]
+   |     ^^^^^^^^^^^^^^^
 
 error: `name` doesn't refer to a field on this type
-  --> $DIR/diagnostic-derive.rs:170:50
+  --> $DIR/diagnostic-derive.rs:170:37
    |
-LL |     #[suggestion(compiletest::suggestion, code = "{name}")]
-   |                                                  ^^^^^^^^
+LL |     #[suggestion(suggestion, code = "{name}")]
+   |                                     ^^^^^^^^
 
 error: invalid format string: expected `'}'` but string was terminated
   --> $DIR/diagnostic-derive.rs:175:10
@@ -257,14 +257,14 @@ LL | #[derive(Diagnostic)]
 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
   --> $DIR/diagnostic-derive.rs:205:5
    |
-LL |     #[label(compiletest::label)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[label(label)]
+   |     ^^^^^^^^^^^^^^^
 
 error: suggestion without `code = "..."`
   --> $DIR/diagnostic-derive.rs:223:5
    |
-LL |     #[suggestion(compiletest::suggestion)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[suggestion(suggestion)]
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[suggestion(nonsense = ...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:231:18
@@ -297,7 +297,7 @@ LL |     #[suggestion(msg = "bar")]
 error: wrong field type for suggestion
   --> $DIR/diagnostic-derive.rs:263:5
    |
-LL | /     #[suggestion(compiletest::suggestion, code = "This is suggested code")]
+LL | /     #[suggestion(suggestion, code = "This is suggested code")]
 LL | |
 LL | |     suggestion: Applicability,
    | |_____________________________^
@@ -335,10 +335,10 @@ LL |     #[label = "bar"]
    |     ^^^^^^^^^^^^^^^^
 
 error: specified multiple times
-  --> $DIR/diagnostic-derive.rs:445:57
+  --> $DIR/diagnostic-derive.rs:445:44
    |
-LL |     #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")]
-   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
+   |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: previously specified here
   --> $DIR/diagnostic-derive.rs:447:24
@@ -347,30 +347,30 @@ LL |     suggestion: (Span, Applicability),
    |                        ^^^^^^^^^^^^^
 
 error: invalid applicability
-  --> $DIR/diagnostic-derive.rs:453:57
+  --> $DIR/diagnostic-derive.rs:453:44
    |
-LL |     #[suggestion(compiletest::suggestion, code = "...", applicability = "batman")]
-   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[suggestion(suggestion, code = "...", applicability = "batman")]
+   |                                            ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[label(foo)]` is not a valid attribute
-  --> $DIR/diagnostic-derive.rs:516:33
+  --> $DIR/diagnostic-derive.rs:516:20
    |
-LL |     #[label(compiletest::label, foo)]
-   |                                 ^^^
+LL |     #[label(label, foo)]
+   |                    ^^^
    |
    = help: a diagnostic slug must be the first argument to the attribute
 
 error: `#[label(foo = ...)]` is not a valid attribute
-  --> $DIR/diagnostic-derive.rs:524:33
+  --> $DIR/diagnostic-derive.rs:524:20
    |
-LL |     #[label(compiletest::label, foo = "...")]
-   |                                 ^^^^^^^^^^^
+LL |     #[label(label, foo = "...")]
+   |                    ^^^^^^^^^^^
 
 error: `#[label(foo(...))]` is not a valid attribute
-  --> $DIR/diagnostic-derive.rs:532:33
+  --> $DIR/diagnostic-derive.rs:532:20
    |
-LL |     #[label(compiletest::label, foo("..."))]
-   |                                 ^^^^^^^^^^
+LL |     #[label(label, foo("..."))]
+   |                    ^^^^^^^^^^
 
 error: `#[primary_span]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:545:5
@@ -383,73 +383,73 @@ LL |     #[primary_span]
 error: `#[error(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:565:1
    |
-LL | #[error(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[error(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:565:1
    |
-LL | / #[error(compiletest::example, code = "E0123")]
+LL | / #[error(compiletest_example, code = "E0123")]
 LL | |
 LL | |
 LL | |
 LL | | struct ErrorAttribute {}
    | |________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[warn_(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:572:1
    |
-LL | #[warn_(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[warn_(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:572:1
    |
-LL | / #[warn_(compiletest::example, code = "E0123")]
+LL | / #[warn_(compiletest_example, code = "E0123")]
 LL | |
 LL | |
 LL | |
 LL | | struct WarnAttribute {}
    | |_______________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[lint(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:579:1
    |
-LL | #[lint(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[lint(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:579:1
    |
-LL | / #[lint(compiletest::example, code = "E0123")]
+LL | / #[lint(compiletest_example, code = "E0123")]
 LL | |
 LL | |
 LL | |
 LL | | struct LintAttributeOnSessionDiag {}
    | |____________________________________^
    |
-   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]`
+   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
 error: `#[lint(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:586:1
    |
-LL | #[lint(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[lint(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[lint(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:586:1
    |
-LL | #[lint(compiletest::example, code = "E0123")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[lint(compiletest_example, code = "E0123")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostic slug not specified
   --> $DIR/diagnostic-derive.rs:586:1
    |
-LL | / #[lint(compiletest::example, code = "E0123")]
+LL | / #[lint(compiletest_example, code = "E0123")]
 LL | |
 LL | |
 LL | |
@@ -457,19 +457,19 @@ LL | |
 LL | | struct LintAttributeOnLintDiag {}
    | |_________________________________^
    |
-   = help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest::example)]`
+   = help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest_example)]`
 
 error: specified multiple times
-  --> $DIR/diagnostic-derive.rs:596:57
+  --> $DIR/diagnostic-derive.rs:596:44
    |
-LL |     #[suggestion(compiletest::suggestion, code = "...", code = ",,,")]
-   |                                                         ^^^^^^^^^^^^
+LL |     #[suggestion(suggestion, code = "...", code = ",,,")]
+   |                                            ^^^^^^^^^^^^
    |
 note: previously specified here
-  --> $DIR/diagnostic-derive.rs:596:43
+  --> $DIR/diagnostic-derive.rs:596:30
    |
-LL |     #[suggestion(compiletest::suggestion, code = "...", code = ",,,")]
-   |                                           ^^^^^^^^^^^^
+LL |     #[suggestion(suggestion, code = "...", code = ",,,")]
+   |                              ^^^^^^^^^^^^
 
 error: wrong types for suggestion
   --> $DIR/diagnostic-derive.rs:605:24
@@ -490,14 +490,14 @@ LL |     suggestion: (Span,),
 error: suggestion without `code = "..."`
   --> $DIR/diagnostic-derive.rs:620:5
    |
-LL |     #[suggestion(compiletest::suggestion)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[suggestion(suggestion)]
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[multipart_suggestion(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:627:1
    |
-LL | #[multipart_suggestion(compiletest::suggestion)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[multipart_suggestion(suggestion)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider creating a `Subdiagnostic` instead
 
@@ -512,16 +512,16 @@ LL | #[multipart_suggestion()]
 error: `#[multipart_suggestion(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:634:5
    |
-LL |     #[multipart_suggestion(compiletest::suggestion)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     #[multipart_suggestion(suggestion)]
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider creating a `Subdiagnostic` instead
 
 error: `#[suggestion(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:642:1
    |
-LL | #[suggestion(compiletest::suggestion, code = "...")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(suggestion, code = "...")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: `#[label]` and `#[suggestion]` can only be applied to fields
 
@@ -576,7 +576,7 @@ LL |     #[subdiagnostic(eager)]
 error: cannot find attribute `nonsense` in this scope
   --> $DIR/diagnostic-derive.rs:55:3
    |
-LL | #[nonsense(compiletest::example, code = "E0123")]
+LL | #[nonsense(compiletest_example, code = "E0123")]
    |   ^^^^^^^^
 
 error: cannot find attribute `nonsense` in this scope
@@ -588,31 +588,31 @@ LL |     #[nonsense]
 error: cannot find attribute `error` in this scope
   --> $DIR/diagnostic-derive.rs:565:3
    |
-LL | #[error(compiletest::example, code = "E0123")]
+LL | #[error(compiletest_example, code = "E0123")]
    |   ^^^^^
 
 error: cannot find attribute `warn_` in this scope
   --> $DIR/diagnostic-derive.rs:572:3
    |
-LL | #[warn_(compiletest::example, code = "E0123")]
+LL | #[warn_(compiletest_example, code = "E0123")]
    |   ^^^^^ help: a built-in attribute with a similar name exists: `warn`
 
 error: cannot find attribute `lint` in this scope
   --> $DIR/diagnostic-derive.rs:579:3
    |
-LL | #[lint(compiletest::example, code = "E0123")]
+LL | #[lint(compiletest_example, code = "E0123")]
    |   ^^^^ help: a built-in attribute with a similar name exists: `link`
 
 error: cannot find attribute `lint` in this scope
   --> $DIR/diagnostic-derive.rs:586:3
    |
-LL | #[lint(compiletest::example, code = "E0123")]
+LL | #[lint(compiletest_example, code = "E0123")]
    |   ^^^^ help: a built-in attribute with a similar name exists: `link`
 
 error: cannot find attribute `multipart_suggestion` in this scope
   --> $DIR/diagnostic-derive.rs:627:3
    |
-LL | #[multipart_suggestion(compiletest::suggestion)]
+LL | #[multipart_suggestion(suggestion)]
    |   ^^^^^^^^^^^^^^^^^^^^
 
 error: cannot find attribute `multipart_suggestion` in this scope
@@ -624,7 +624,7 @@ LL | #[multipart_suggestion()]
 error: cannot find attribute `multipart_suggestion` in this scope
   --> $DIR/diagnostic-derive.rs:634:7
    |
-LL |     #[multipart_suggestion(compiletest::suggestion)]
+LL |     #[multipart_suggestion(suggestion)]
    |       ^^^^^^^^^^^^^^^^^^^^
 
 error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
diff --git a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
index 2fe93d46d0a..9088ca6ce46 100644
--- a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
+++ b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
@@ -20,7 +20,7 @@ use rustc_span::Span;
 use rustc_macros::Subdiagnostic;
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct A {
     #[primary_span]
     span: Span,
@@ -29,13 +29,13 @@ struct A {
 
 #[derive(Subdiagnostic)]
 enum B {
-    #[label(parser::add_paren)]
+    #[label(parser_add_paren)]
     A {
         #[primary_span]
         span: Span,
         var: String,
     },
-    #[label(parser::add_paren)]
+    #[label(parser_add_paren)]
     B {
         #[primary_span]
         span: Span,
@@ -44,7 +44,7 @@ enum B {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 //~^ ERROR label without `#[primary_span]` field
 struct C {
     var: String,
@@ -138,7 +138,7 @@ struct M {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren, code = "...")]
+#[label(parser_add_paren, code = "...")]
 //~^ ERROR `#[label(code = ...)]` is not a valid attribute
 struct N {
     #[primary_span]
@@ -147,7 +147,7 @@ struct N {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren, applicability = "machine-applicable")]
+#[label(parser_add_paren, applicability = "machine-applicable")]
 //~^ ERROR `#[label(applicability = ...)]` is not a valid attribute
 struct O {
     #[primary_span]
@@ -160,7 +160,7 @@ struct O {
 //~^ ERROR cannot find attribute `foo` in this scope
 //~^^ ERROR unsupported type attribute for subdiagnostic enum
 enum P {
-    #[label(parser::add_paren)]
+    #[label(parser_add_paren)]
     A {
         #[primary_span]
         span: Span,
@@ -230,7 +230,7 @@ enum U {
 
 #[derive(Subdiagnostic)]
 enum V {
-    #[label(parser::add_paren)]
+    #[label(parser_add_paren)]
     A {
         #[primary_span]
         span: Span,
@@ -244,7 +244,7 @@ enum V {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 //~^ ERROR label without `#[primary_span]` field
 struct W {
     #[primary_span]
@@ -253,7 +253,7 @@ struct W {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct X {
     #[primary_span]
     span: Span,
@@ -263,7 +263,7 @@ struct X {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct Y {
     #[primary_span]
     span: Span,
@@ -274,7 +274,7 @@ struct Y {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct Z {
     #[primary_span]
     span: Span,
@@ -285,7 +285,7 @@ struct Z {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct AA {
     #[primary_span]
     span: Span,
@@ -296,7 +296,7 @@ struct AA {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct AB {
     #[primary_span]
     span: Span,
@@ -312,23 +312,23 @@ union AC {
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
+#[label(parser_add_paren)]
 struct AD {
     #[primary_span]
     span: Span,
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren, parser::add_paren)]
-//~^ ERROR `#[label(parser::add_paren)]` is not a valid attribute
+#[label(parser_add_paren, parser_add_paren)]
+//~^ ERROR `#[label(parser_add_paren)]` is not a valid attribute
 struct AE {
     #[primary_span]
     span: Span,
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct AF {
     #[primary_span]
     //~^ NOTE previously specified here
@@ -346,7 +346,7 @@ struct AG {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[suggestion(parser_add_paren, code = "...")]
 struct AH {
     #[primary_span]
     span: Span,
@@ -357,7 +357,7 @@ struct AH {
 
 #[derive(Subdiagnostic)]
 enum AI {
-    #[suggestion(parser::add_paren, code = "...")]
+    #[suggestion(parser_add_paren, code = "...")]
     A {
         #[primary_span]
         span: Span,
@@ -365,7 +365,7 @@ enum AI {
         applicability: Applicability,
         var: String,
     },
-    #[suggestion(parser::add_paren, code = "...")]
+    #[suggestion(parser_add_paren, code = "...")]
     B {
         #[primary_span]
         span: Span,
@@ -376,7 +376,7 @@ enum AI {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...", code = "...")]
+#[suggestion(parser_add_paren, code = "...", code = "...")]
 //~^ ERROR specified multiple times
 //~^^ NOTE previously specified here
 struct AJ {
@@ -387,7 +387,7 @@ struct AJ {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[suggestion(parser_add_paren, code = "...")]
 struct AK {
     #[primary_span]
     span: Span,
@@ -400,7 +400,7 @@ struct AK {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[suggestion(parser_add_paren, code = "...")]
 struct AL {
     #[primary_span]
     span: Span,
@@ -410,14 +410,14 @@ struct AL {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[suggestion(parser_add_paren, code = "...")]
 struct AM {
     #[primary_span]
     span: Span,
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren)]
+#[suggestion(parser_add_paren)]
 //~^ ERROR suggestion without `code = "..."`
 struct AN {
     #[primary_span]
@@ -427,7 +427,7 @@ struct AN {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code ="...", applicability = "foo")]
+#[suggestion(parser_add_paren, code ="...", applicability = "foo")]
 //~^ ERROR invalid applicability
 struct AO {
     #[primary_span]
@@ -435,24 +435,24 @@ struct AO {
 }
 
 #[derive(Subdiagnostic)]
-#[help(parser::add_paren)]
+#[help(parser_add_paren)]
 struct AP {
     var: String
 }
 
 #[derive(Subdiagnostic)]
-#[note(parser::add_paren)]
+#[note(parser_add_paren)]
 struct AQ;
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[suggestion(parser_add_paren, code = "...")]
 //~^ ERROR suggestion without `#[primary_span]` field
 struct AR {
     var: String,
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code ="...", applicability = "machine-applicable")]
+#[suggestion(parser_add_paren, code ="...", applicability = "machine-applicable")]
 struct AS {
     #[primary_span]
     span: Span,
@@ -462,7 +462,7 @@ struct AS {
 #[label]
 //~^ ERROR unsupported type attribute for subdiagnostic enum
 enum AT {
-    #[label(parser::add_paren)]
+    #[label(parser_add_paren)]
     A {
         #[primary_span]
         span: Span,
@@ -471,7 +471,7 @@ enum AT {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+#[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
 struct AU {
     #[primary_span]
     span: Span,
@@ -479,7 +479,7 @@ struct AU {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+#[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
 //~^ ERROR `var` doesn't refer to a field on this type
 struct AV {
     #[primary_span]
@@ -488,7 +488,7 @@ struct AV {
 
 #[derive(Subdiagnostic)]
 enum AW {
-    #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+    #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
     A {
         #[primary_span]
         span: Span,
@@ -498,7 +498,7 @@ enum AW {
 
 #[derive(Subdiagnostic)]
 enum AX {
-    #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+    #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
 //~^ ERROR `var` doesn't refer to a field on this type
     A {
         #[primary_span]
@@ -507,18 +507,18 @@ enum AX {
 }
 
 #[derive(Subdiagnostic)]
-#[warning(parser::add_paren)]
+#[warning(parser_add_paren)]
 struct AY {}
 
 #[derive(Subdiagnostic)]
-#[warning(parser::add_paren)]
+#[warning(parser_add_paren)]
 struct AZ {
     #[primary_span]
     span: Span,
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[suggestion(parser_add_paren, code = "...")]
 //~^ ERROR suggestion without `#[primary_span]` field
 struct BA {
     #[suggestion_part]
@@ -533,7 +533,7 @@ struct BA {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, code = "...", applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, code = "...", applicability = "machine-applicable")]
 //~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
 //~| ERROR `#[multipart_suggestion(code = ...)]` is not a valid attribute
 struct BBa {
@@ -541,7 +541,7 @@ struct BBa {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
 struct BBb {
     #[suggestion_part]
     //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
@@ -549,7 +549,7 @@ struct BBb {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
 struct BBc {
     #[suggestion_part()]
     //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
@@ -557,7 +557,7 @@ struct BBc {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren)]
+#[multipart_suggestion(parser_add_paren)]
 //~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
 struct BC {
     #[primary_span]
@@ -566,7 +566,7 @@ struct BC {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren)]
+#[multipart_suggestion(parser_add_paren)]
 struct BD {
     #[suggestion_part]
     //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
@@ -586,7 +586,7 @@ struct BD {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
 struct BE {
     #[suggestion_part(code = "...", code = ",,,")]
     //~^ ERROR specified multiple times
@@ -595,7 +595,7 @@ struct BE {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
 struct BF {
     #[suggestion_part(code = "(")]
     first: Span,
@@ -604,7 +604,7 @@ struct BF {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren)]
+#[multipart_suggestion(parser_add_paren)]
 struct BG {
     #[applicability]
     appl: Applicability,
@@ -615,7 +615,7 @@ struct BG {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
 struct BH {
     #[applicability]
     //~^ ERROR `#[applicability]` has no effect
@@ -627,14 +627,14 @@ struct BH {
 }
 
 #[derive(Subdiagnostic)]
-#[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
 struct BI {
     #[suggestion_part(code = "")]
     spans: Vec<Span>,
 }
 
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct BJ {
     #[primary_span]
     span: Span,
@@ -643,7 +643,7 @@ struct BJ {
 
 /// with a doc comment on the type..
 #[derive(Subdiagnostic)]
-#[label(parser::add_paren)]
+#[label(parser_add_paren)]
 struct BK {
     /// ..and the field
     #[primary_span]
@@ -654,7 +654,7 @@ struct BK {
 #[derive(Subdiagnostic)]
 enum BL {
     /// ..and the variant..
-    #[label(parser::add_paren)]
+    #[label(parser_add_paren)]
     Foo {
         /// ..and the field
         #[primary_span]
diff --git a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
index 1173d24248b..b21f9cc94a9 100644
--- a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
+++ b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
@@ -1,7 +1,7 @@
 error: label without `#[primary_span]` field
   --> $DIR/subdiagnostic-derive.rs:47:1
    |
-LL | / #[label(parser::add_paren)]
+LL | / #[label(parser_add_paren)]
 LL | |
 LL | | struct C {
 LL | |     var: String,
@@ -81,16 +81,16 @@ LL | #[label()]
    | ^^^^^^^^^^
 
 error: `#[label(code = ...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:141:28
+  --> $DIR/subdiagnostic-derive.rs:141:27
    |
-LL | #[label(parser::add_paren, code = "...")]
-   |                            ^^^^^^^^^^^^
+LL | #[label(parser_add_paren, code = "...")]
+   |                           ^^^^^^^^^^^^
 
 error: `#[label(applicability = ...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:150:28
+  --> $DIR/subdiagnostic-derive.rs:150:27
    |
-LL | #[label(parser::add_paren, applicability = "machine-applicable")]
-   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(parser_add_paren, applicability = "machine-applicable")]
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: unsupported type attribute for subdiagnostic enum
   --> $DIR/subdiagnostic-derive.rs:159:1
@@ -143,7 +143,7 @@ LL |     #[primary_span]
 error: label without `#[primary_span]` field
   --> $DIR/subdiagnostic-derive.rs:247:1
    |
-LL | / #[label(parser::add_paren)]
+LL | / #[label(parser_add_paren)]
 LL | |
 LL | | struct W {
 LL | |     #[primary_span]
@@ -190,11 +190,11 @@ LL | |     b: u64
 LL | | }
    | |_^
 
-error: `#[label(parser::add_paren)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:323:28
+error: `#[label(parser_add_paren)]` is not a valid attribute
+  --> $DIR/subdiagnostic-derive.rs:323:27
    |
-LL | #[label(parser::add_paren, parser::add_paren)]
-   |                            ^^^^^^^^^^^^^^^^^
+LL | #[label(parser_add_paren, parser_add_paren)]
+   |                           ^^^^^^^^^^^^^^^^
    |
    = help: a diagnostic slug must be the first argument to the attribute
 
@@ -217,16 +217,16 @@ LL | struct AG {
    |        ^^
 
 error: specified multiple times
-  --> $DIR/subdiagnostic-derive.rs:379:47
+  --> $DIR/subdiagnostic-derive.rs:379:46
    |
-LL | #[suggestion(parser::add_paren, code = "...", code = "...")]
-   |                                               ^^^^^^^^^^^^
+LL | #[suggestion(parser_add_paren, code = "...", code = "...")]
+   |                                              ^^^^^^^^^^^^
    |
 note: previously specified here
-  --> $DIR/subdiagnostic-derive.rs:379:33
+  --> $DIR/subdiagnostic-derive.rs:379:32
    |
-LL | #[suggestion(parser::add_paren, code = "...", code = "...")]
-   |                                 ^^^^^^^^^^^^
+LL | #[suggestion(parser_add_paren, code = "...", code = "...")]
+   |                                ^^^^^^^^^^^^
 
 error: specified multiple times
   --> $DIR/subdiagnostic-derive.rs:397:5
@@ -249,19 +249,19 @@ LL |     #[applicability]
 error: suggestion without `code = "..."`
   --> $DIR/subdiagnostic-derive.rs:420:1
    |
-LL | #[suggestion(parser::add_paren)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(parser_add_paren)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: invalid applicability
-  --> $DIR/subdiagnostic-derive.rs:430:46
+  --> $DIR/subdiagnostic-derive.rs:430:45
    |
-LL | #[suggestion(parser::add_paren, code ="...", applicability = "foo")]
-   |                                              ^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(parser_add_paren, code ="...", applicability = "foo")]
+   |                                             ^^^^^^^^^^^^^^^^^^^^^
 
 error: suggestion without `#[primary_span]` field
   --> $DIR/subdiagnostic-derive.rs:448:1
    |
-LL | / #[suggestion(parser::add_paren, code = "...")]
+LL | / #[suggestion(parser_add_paren, code = "...")]
 LL | |
 LL | | struct AR {
 LL | |     var: String,
@@ -275,16 +275,16 @@ LL | #[label]
    | ^^^^^^^^
 
 error: `var` doesn't refer to a field on this type
-  --> $DIR/subdiagnostic-derive.rs:482:39
+  --> $DIR/subdiagnostic-derive.rs:482:38
    |
-LL | #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
-   |                                       ^^^^^^^
+LL | #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
+   |                                      ^^^^^^^
 
 error: `var` doesn't refer to a field on this type
-  --> $DIR/subdiagnostic-derive.rs:501:43
+  --> $DIR/subdiagnostic-derive.rs:501:42
    |
-LL |     #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
-   |                                           ^^^^^^^
+LL |     #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
+   |                                          ^^^^^^^
 
 error: `#[suggestion_part]` is not a valid attribute
   --> $DIR/subdiagnostic-derive.rs:524:5
@@ -305,7 +305,7 @@ LL |     #[suggestion_part(code = "...")]
 error: suggestion without `#[primary_span]` field
   --> $DIR/subdiagnostic-derive.rs:521:1
    |
-LL | / #[suggestion(parser::add_paren, code = "...")]
+LL | / #[suggestion(parser_add_paren, code = "...")]
 LL | |
 LL | | struct BA {
 LL | |     #[suggestion_part]
@@ -315,17 +315,17 @@ LL | | }
    | |_^
 
 error: `#[multipart_suggestion(code = ...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:536:43
+  --> $DIR/subdiagnostic-derive.rs:536:42
    |
-LL | #[multipart_suggestion(parser::add_paren, code = "...", applicability = "machine-applicable")]
-   |                                           ^^^^^^^^^^^^
+LL | #[multipart_suggestion(parser_add_paren, code = "...", applicability = "machine-applicable")]
+   |                                          ^^^^^^^^^^^^
    |
    = help: only `applicability` is a valid nested attributes
 
 error: multipart suggestion without any `#[suggestion_part(...)]` fields
   --> $DIR/subdiagnostic-derive.rs:536:1
    |
-LL | / #[multipart_suggestion(parser::add_paren, code = "...", applicability = "machine-applicable")]
+LL | / #[multipart_suggestion(parser_add_paren, code = "...", applicability = "machine-applicable")]
 LL | |
 LL | |
 LL | | struct BBa {
@@ -356,7 +356,7 @@ LL |     #[primary_span]
 error: multipart suggestion without any `#[suggestion_part(...)]` fields
   --> $DIR/subdiagnostic-derive.rs:560:1
    |
-LL | / #[multipart_suggestion(parser::add_paren)]
+LL | / #[multipart_suggestion(parser_add_paren)]
 LL | |
 LL | | struct BC {
 LL | |     #[primary_span]