summaryrefslogtreecommitdiffstats
path: root/tests/ui-fulldeps
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
commit2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch)
treed325add32978dbdc1db975a438b3a77d571b1ab8 /tests/ui-fulldeps
parentReleasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff)
downloadrustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz
rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui-fulldeps/auxiliary/issue-40001-plugin.rs4
-rw-r--r--tests/ui-fulldeps/create-dir-all-bare.rs11
-rw-r--r--tests/ui-fulldeps/dropck-tarena-cycle-checked.stderr2
-rw-r--r--tests/ui-fulldeps/dropck-tarena-unsound-drop.stderr2
-rw-r--r--tests/ui-fulldeps/fluent-messages/duplicate.ftl3
-rw-r--r--tests/ui-fulldeps/fluent-messages/label-with-hyphens.ftl2
-rw-r--r--tests/ui-fulldeps/fluent-messages/missing-crate-name.ftl2
-rw-r--r--tests/ui-fulldeps/fluent-messages/missing-message-ref.ftl1
-rw-r--r--tests/ui-fulldeps/fluent-messages/missing-message.ftl2
-rw-r--r--tests/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl2
-rw-r--r--tests/ui-fulldeps/fluent-messages/test.rs68
-rw-r--r--tests/ui-fulldeps/fluent-messages/test.stderr95
-rw-r--r--tests/ui-fulldeps/fluent-messages/valid.ftl2
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.ftl (renamed from compiler/rustc_error_messages/locales/en-US/compiletest.ftl)2
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.rs16
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.stderr12
-rw-r--r--tests/ui-fulldeps/internal-lints/ty_tykind_usage.rs1
-rw-r--r--tests/ui-fulldeps/internal-lints/ty_tykind_usage.stderr32
-rw-r--r--tests/ui-fulldeps/mod_dir_path_canonicalized.rs5
-rw-r--r--tests/ui-fulldeps/pprust-expr-roundtrip.rs16
-rw-r--r--tests/ui-fulldeps/rename-directory.rs30
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs302
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr344
-rw-r--r--tests/ui-fulldeps/session-diagnostic/example.ftl5
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs160
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr281
-rw-r--r--tests/ui-fulldeps/std/issue-15149.rs (renamed from tests/ui-fulldeps/issue-15149.rs)0
-rw-r--r--tests/ui-fulldeps/std/issue-81357-unsound-file-methods.rs (renamed from tests/ui-fulldeps/issue-81357-unsound-file-methods.rs)0
-rw-r--r--tests/ui-fulldeps/std/stdio-from.rs (renamed from tests/ui-fulldeps/stdio-from.rs)0
-rw-r--r--tests/ui-fulldeps/std/switch-stdout.rs (renamed from tests/ui-fulldeps/switch-stdout.rs)0
30 files changed, 713 insertions, 689 deletions
diff --git a/tests/ui-fulldeps/auxiliary/issue-40001-plugin.rs b/tests/ui-fulldeps/auxiliary/issue-40001-plugin.rs
index c05443488..3f6caecaa 100644
--- a/tests/ui-fulldeps/auxiliary/issue-40001-plugin.rs
+++ b/tests/ui-fulldeps/auxiliary/issue-40001-plugin.rs
@@ -16,6 +16,7 @@ use rustc_hir as hir;
use rustc_hir::intravisit;
use rustc_hir::Node;
use rustc_lint::{LateContext, LateLintPass, LintContext};
+use rustc_span::def_id::LocalDefId;
use rustc_span::source_map;
#[no_mangle]
@@ -40,8 +41,9 @@ impl<'tcx> LateLintPass<'tcx> for MissingAllowedAttrPass {
_: &'tcx hir::FnDecl,
_: &'tcx hir::Body,
span: source_map::Span,
- id: hir::HirId,
+ def_id: LocalDefId,
) {
+ let id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
let item = match cx.tcx.hir().get(id) {
Node::Item(item) => item,
_ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id).def_id),
diff --git a/tests/ui-fulldeps/create-dir-all-bare.rs b/tests/ui-fulldeps/create-dir-all-bare.rs
deleted file mode 100644
index 4554680ec..000000000
--- a/tests/ui-fulldeps/create-dir-all-bare.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// run-pass
-
-use std::env;
-use std::fs;
-use std::path::PathBuf;
-
-fn main() {
- let path = PathBuf::from(env::var_os("RUST_TEST_TMPDIR").unwrap());
- env::set_current_dir(&path).unwrap();
- fs::create_dir_all("create-dir-all-bare").unwrap();
-}
diff --git a/tests/ui-fulldeps/dropck-tarena-cycle-checked.stderr b/tests/ui-fulldeps/dropck-tarena-cycle-checked.stderr
index 429968822..47897dc00 100644
--- a/tests/ui-fulldeps/dropck-tarena-cycle-checked.stderr
+++ b/tests/ui-fulldeps/dropck-tarena-cycle-checked.stderr
@@ -1,6 +1,8 @@
error[E0597]: `arena` does not live long enough
--> $DIR/dropck-tarena-cycle-checked.rs:116:7
|
+LL | let arena = TypedArena::default();
+ | ----- binding `arena` declared here
LL | f(&arena);
| ^^^^^^ borrowed value does not live long enough
LL | }
diff --git a/tests/ui-fulldeps/dropck-tarena-unsound-drop.stderr b/tests/ui-fulldeps/dropck-tarena-unsound-drop.stderr
index ccffee9cd..493d74b0b 100644
--- a/tests/ui-fulldeps/dropck-tarena-unsound-drop.stderr
+++ b/tests/ui-fulldeps/dropck-tarena-unsound-drop.stderr
@@ -1,6 +1,8 @@
error[E0597]: `arena` does not live long enough
--> $DIR/dropck-tarena-unsound-drop.rs:41:7
|
+LL | let arena: TypedArena<C> = TypedArena::default();
+ | ----- binding `arena` declared here
LL | f(&arena);
| ^^^^^^ borrowed value does not live long enough
LL | }
diff --git a/tests/ui-fulldeps/fluent-messages/duplicate.ftl b/tests/ui-fulldeps/fluent-messages/duplicate.ftl
new file mode 100644
index 000000000..871550b23
--- /dev/null
+++ b/tests/ui-fulldeps/fluent-messages/duplicate.ftl
@@ -0,0 +1,3 @@
+no_crate_a_b_key = Value
+
+no_crate_a_b_key = Another Value
diff --git a/tests/ui-fulldeps/fluent-messages/label-with-hyphens.ftl b/tests/ui-fulldeps/fluent-messages/label-with-hyphens.ftl
index 016cbeef6..3088b1f8d 100644
--- a/tests/ui-fulldeps/fluent-messages/label-with-hyphens.ftl
+++ b/tests/ui-fulldeps/fluent-messages/label-with-hyphens.ftl
@@ -1,2 +1,2 @@
-label_with_hyphens_some_slug = hi
+no_crate_some_slug = hi
.label-has-hyphens = test
diff --git a/tests/ui-fulldeps/fluent-messages/missing-crate-name.ftl b/tests/ui-fulldeps/fluent-messages/missing-crate-name.ftl
index 9bd035c1b..0a64e3894 100644
--- a/tests/ui-fulldeps/fluent-messages/missing-crate-name.ftl
+++ b/tests/ui-fulldeps/fluent-messages/missing-crate-name.ftl
@@ -1,2 +1,2 @@
with-hyphens = 1234
-test-crate_foo = abcd
+no-crate_foo = abcd
diff --git a/tests/ui-fulldeps/fluent-messages/missing-message-ref.ftl b/tests/ui-fulldeps/fluent-messages/missing-message-ref.ftl
new file mode 100644
index 000000000..4c6514a97
--- /dev/null
+++ b/tests/ui-fulldeps/fluent-messages/missing-message-ref.ftl
@@ -0,0 +1 @@
+no_crate_missing_message_ref = {message}
diff --git a/tests/ui-fulldeps/fluent-messages/missing-message.ftl b/tests/ui-fulldeps/fluent-messages/missing-message.ftl
index 74b2aa1d4..61f56fd4d 100644
--- a/tests/ui-fulldeps/fluent-messages/missing-message.ftl
+++ b/tests/ui-fulldeps/fluent-messages/missing-message.ftl
@@ -1 +1 @@
-missing_message =
+no_crate_missing_message =
diff --git a/tests/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl b/tests/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl
index 86ba9a268..a64c85094 100644
--- a/tests/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl
+++ b/tests/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl
@@ -1 +1 @@
-slug_with_hyphens_this-slug-has-hyphens = hi
+no_crate_this-slug-has-hyphens = hi
diff --git a/tests/ui-fulldeps/fluent-messages/test.rs b/tests/ui-fulldeps/fluent-messages/test.rs
index 4e8147e2b..66575eb8e 100644
--- a/tests/ui-fulldeps/fluent-messages/test.rs
+++ b/tests/ui-fulldeps/fluent-messages/test.rs
@@ -21,78 +21,74 @@ pub enum SubdiagnosticMessage {
mod missing_absolute {
use super::fluent_messages;
- fluent_messages! {
- missing_absolute => "/definitely_does_not_exist.ftl",
-//~^ ERROR could not open Fluent resource
- }
+ fluent_messages! { "/definitely_does_not_exist.ftl" }
+ //~^ ERROR could not open Fluent resource
}
mod missing_relative {
use super::fluent_messages;
- fluent_messages! {
- missing_relative => "../definitely_does_not_exist.ftl",
-//~^ ERROR could not open Fluent resource
- }
+ fluent_messages! { "../definitely_does_not_exist.ftl" }
+ //~^ ERROR could not open Fluent resource
}
mod missing_message {
use super::fluent_messages;
- fluent_messages! {
- missing_message => "./missing-message.ftl",
-//~^ ERROR could not parse Fluent resource
- }
+ fluent_messages! { "./missing-message.ftl" }
+ //~^ ERROR could not parse Fluent resource
}
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`
- }
+ fluent_messages! { "./duplicate.ftl" }
+ //~^ ERROR overrides existing message: `no_crate_a_b_key`
}
mod slug_with_hyphens {
use super::fluent_messages;
- fluent_messages! {
- slug_with_hyphens => "./slug-with-hyphens.ftl",
-//~^ ERROR name `slug_with_hyphens_this-slug-has-hyphens` contains a '-' character
- }
+ fluent_messages! { "./slug-with-hyphens.ftl" }
+ //~^ ERROR name `no_crate_this-slug-has-hyphens` contains a '-' character
}
mod label_with_hyphens {
use super::fluent_messages;
- fluent_messages! {
- label_with_hyphens => "./label-with-hyphens.ftl",
-//~^ ERROR attribute `label-has-hyphens` contains a '-' character
- }
+ fluent_messages! { "./label-with-hyphens.ftl" }
+ //~^ ERROR attribute `label-has-hyphens` contains a '-' character
}
mod valid {
use super::fluent_messages;
- fluent_messages! {
- valid => "./valid.ftl",
- }
+ fluent_messages! { "./valid.ftl" }
- use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, valid_key};
+ mod test_generated {
+ use super::{fluent_generated::no_crate_key, DEFAULT_LOCALE_RESOURCE};
+ }
}
mod missing_crate_name {
use super::fluent_messages;
- fluent_messages! {
- test_crate => "./missing-crate-name.ftl",
-//~^ ERROR name `test-crate_foo` contains a '-' character
-//~| ERROR name `with-hyphens` contains a '-' character
-//~| ERROR name `with-hyphens` does not start with the crate name
+ fluent_messages! { "./missing-crate-name.ftl" }
+ //~^ ERROR name `no-crate_foo` contains a '-' character
+ //~| ERROR name `with-hyphens` contains a '-' character
+ //~| ERROR name `with-hyphens` does not start with the crate name
+
+ mod test_generated {
+ use super::{
+ fluent_generated::{no_crate_foo, with_hyphens},
+ DEFAULT_LOCALE_RESOURCE,
+ };
}
+}
+
+mod missing_message_ref {
+ use super::fluent_messages;
- use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, test_crate_foo, with_hyphens};
+ fluent_messages! { "./missing-message-ref.ftl" }
+ //~^ ERROR referenced message `message` does not exist
}
diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr
index d1cd4fe26..c7961ed22 100644
--- a/tests/ui-fulldeps/fluent-messages/test.stderr
+++ b/tests/ui-fulldeps/fluent-messages/test.stderr
@@ -1,98 +1,87 @@
error: could not open Fluent resource
- --> $DIR/test.rs:25:29
+ --> $DIR/test.rs:24:24
|
-LL | missing_absolute => "/definitely_does_not_exist.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "/definitely_does_not_exist.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: os-specific message
error: could not open Fluent resource
- --> $DIR/test.rs:34:29
+ --> $DIR/test.rs:31:24
|
-LL | missing_relative => "../definitely_does_not_exist.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "../definitely_does_not_exist.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: os-specific message
error: could not parse Fluent resource
- --> $DIR/test.rs:43:28
+ --> $DIR/test.rs:38:24
|
-LL | missing_message => "./missing-message.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "./missing-message.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: see additional errors emitted
-error: expected a message field for "missing_message"
+error: expected a message field for "no_crate_missing_message"
--> ./missing-message.ftl:1:1
|
-1 | missing_message =
- | ^^^^^^^^^^^^^^^^^
+1 | no_crate_missing_message =
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-error: overrides existing message: `a_b_key`
- --> $DIR/test.rs:54:16
+error: overrides existing message: `no_crate_a_b_key`
+ --> $DIR/test.rs:45:24
|
-LL | a_b => "./duplicate-a-b.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^
- |
-help: previously defined in this resource
- --> $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
+LL | fluent_messages! { "./duplicate.ftl" }
+ | ^^^^^^^^^^^^^^^^^
-error: name `slug_with_hyphens_this-slug-has-hyphens` contains a '-' character
- --> $DIR/test.rs:63:30
+error: name `no_crate_this-slug-has-hyphens` contains a '-' character
+ --> $DIR/test.rs:52:24
|
-LL | slug_with_hyphens => "./slug-with-hyphens.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "./slug-with-hyphens.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: replace any '-'s with '_'s
error: attribute `label-has-hyphens` contains a '-' character
- --> $DIR/test.rs:72:31
+ --> $DIR/test.rs:59:24
|
-LL | label_with_hyphens => "./label-with-hyphens.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "./label-with-hyphens.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: replace any '-'s with '_'s
error: name `with-hyphens` contains a '-' character
- --> $DIR/test.rs:91:23
+ --> $DIR/test.rs:76:24
|
-LL | test_crate => "./missing-crate-name.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "./missing-crate-name.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: replace any '-'s with '_'s
error: name `with-hyphens` does not start with the crate name
- --> $DIR/test.rs:91:23
+ --> $DIR/test.rs:76:24
|
-LL | test_crate => "./missing-crate-name.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "./missing-crate-name.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: prepend `test_crate_` to the slug name: `test_crate_with_hyphens`
+ = help: prepend `no_crate_` to the slug name: `no_crate_with_hyphens`
-error: name `test-crate_foo` contains a '-' character
- --> $DIR/test.rs:91:23
+error: name `no-crate_foo` contains a '-' character
+ --> $DIR/test.rs:76:24
|
-LL | test_crate => "./missing-crate-name.ftl",
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fluent_messages! { "./missing-crate-name.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: replace any '-'s with '_'s
+error: referenced message `message` does not exist (in message `no_crate_missing_message_ref`)
+ --> $DIR/test.rs:92:24
+ |
+LL | fluent_messages! { "./missing-message-ref.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: you may have meant to use a variable reference (`{$message}`)
+
error: aborting due to 10 previous errors
-For more information about this error, try `rustc --explain E0428`.
diff --git a/tests/ui-fulldeps/fluent-messages/valid.ftl b/tests/ui-fulldeps/fluent-messages/valid.ftl
index 549274306..598473adb 100644
--- a/tests/ui-fulldeps/fluent-messages/valid.ftl
+++ b/tests/ui-fulldeps/fluent-messages/valid.ftl
@@ -1 +1 @@
-valid_key = Valid!
+no_crate_key = Valid!
diff --git a/compiler/rustc_error_messages/locales/en-US/compiletest.ftl b/tests/ui-fulldeps/internal-lints/diagnostics.ftl
index 55061fbce..cb2d476d8 100644
--- a/compiler/rustc_error_messages/locales/en-US/compiletest.ftl
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.ftl
@@ -1,4 +1,4 @@
-compiletest_example = this is an example message used in testing
+no_crate_example = this is an example message used in testing
.note = with a note
.help = with a help
.suggestion = with a suggestion
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.rs b/tests/ui-fulldeps/internal-lints/diagnostics.rs
index 643e81d99..3aa65d53d 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics.rs
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.rs
@@ -13,20 +13,22 @@ extern crate rustc_span;
use rustc_errors::{
AddToDiagnostic, IntoDiagnostic, Diagnostic, DiagnosticBuilder,
- ErrorGuaranteed, Handler, fluent, SubdiagnosticMessage,
+ ErrorGuaranteed, Handler, DiagnosticMessage, SubdiagnosticMessage,
};
-use rustc_macros::{Diagnostic, Subdiagnostic};
+use rustc_macros::{fluent_messages, Diagnostic, Subdiagnostic};
use rustc_span::Span;
+fluent_messages! { "./diagnostics.ftl" }
+
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct DeriveDiagnostic {
#[primary_span]
span: Span,
}
#[derive(Subdiagnostic)]
-#[note(compiletest_example)]
+#[note(no_crate_example)]
struct Note {
#[primary_span]
span: Span,
@@ -45,7 +47,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(crate::fluent_generated::no_crate_example)
}
}
@@ -68,12 +70,12 @@ impl AddToDiagnostic for TranslatableInAddToDiagnostic {
where
F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,
{
- diag.note(fluent::note);
+ diag.note(crate::fluent_generated::no_crate_note);
}
}
pub fn make_diagnostics<'a>(handler: &'a Handler) {
- let _diag = handler.struct_err(fluent::compiletest_example);
+ let _diag = handler.struct_err(crate::fluent_generated::no_crate_example);
//~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
let _diag = handler.struct_err("untranslatable diagnostic");
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.stderr b/tests/ui-fulldeps/internal-lints/diagnostics.stderr
index 510d6a171..6f797ebc2 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics.stderr
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.stderr
@@ -1,5 +1,5 @@
error: diagnostics should be created using translatable messages
- --> $DIR/diagnostics.rs:39:17
+ --> $DIR/diagnostics.rs:41:17
|
LL | handler.struct_err("untranslatable diagnostic")
| ^^^^^^^^^^
@@ -11,15 +11,15 @@ LL | #![deny(rustc::untranslatable_diagnostic)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
- --> $DIR/diagnostics.rs:59:14
+ --> $DIR/diagnostics.rs:61:14
|
LL | diag.note("untranslatable diagnostic");
| ^^^^
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
- --> $DIR/diagnostics.rs:76:25
+ --> $DIR/diagnostics.rs:78:25
|
-LL | let _diag = handler.struct_err(fluent::compiletest_example);
+LL | let _diag = handler.struct_err(crate::fluent_generated::no_crate_example);
| ^^^^^^^^^^
|
note: the lint level is defined here
@@ -29,13 +29,13 @@ LL | #![deny(rustc::diagnostic_outside_of_impl)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
- --> $DIR/diagnostics.rs:79:25
+ --> $DIR/diagnostics.rs:81:25
|
LL | let _diag = handler.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
error: diagnostics should be created using translatable messages
- --> $DIR/diagnostics.rs:79:25
+ --> $DIR/diagnostics.rs:81:25
|
LL | let _diag = handler.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
diff --git a/tests/ui-fulldeps/internal-lints/ty_tykind_usage.rs b/tests/ui-fulldeps/internal-lints/ty_tykind_usage.rs
index 3f7429a5f..bf655510a 100644
--- a/tests/ui-fulldeps/internal-lints/ty_tykind_usage.rs
+++ b/tests/ui-fulldeps/internal-lints/ty_tykind_usage.rs
@@ -31,6 +31,7 @@ fn main() {
TyKind::Closure(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
TyKind::Generator(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
TyKind::GeneratorWitness(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::GeneratorWitnessMIR(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
TyKind::Never => (), //~ ERROR usage of `ty::TyKind::<kind>`
TyKind::Tuple(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
TyKind::Alias(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
diff --git a/tests/ui-fulldeps/internal-lints/ty_tykind_usage.stderr b/tests/ui-fulldeps/internal-lints/ty_tykind_usage.stderr
index 1f49d6b64..9f8c0bea0 100644
--- a/tests/ui-fulldeps/internal-lints/ty_tykind_usage.stderr
+++ b/tests/ui-fulldeps/internal-lints/ty_tykind_usage.stderr
@@ -121,59 +121,65 @@ LL | TyKind::GeneratorWitness(..) => (),
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:34:9
|
-LL | TyKind::Never => (),
+LL | TyKind::GeneratorWitnessMIR(..) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:35:9
|
-LL | TyKind::Tuple(..) => (),
+LL | TyKind::Never => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:36:9
|
-LL | TyKind::Alias(..) => (),
+LL | TyKind::Tuple(..) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:37:9
|
-LL | TyKind::Param(..) => (),
+LL | TyKind::Alias(..) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:38:9
|
-LL | TyKind::Bound(..) => (),
+LL | TyKind::Param(..) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:39:9
|
-LL | TyKind::Placeholder(..) => (),
+LL | TyKind::Bound(..) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:40:9
|
-LL | TyKind::Infer(..) => (),
+LL | TyKind::Placeholder(..) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
--> $DIR/ty_tykind_usage.rs:41:9
|
+LL | TyKind::Infer(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:42:9
+ |
LL | TyKind::Error(_) => (),
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind::<kind>`
- --> $DIR/ty_tykind_usage.rs:46:12
+ --> $DIR/ty_tykind_usage.rs:47:12
|
LL | if let TyKind::Int(int_ty) = kind {}
| ^^^^^^ help: try using `ty::<kind>` directly: `ty`
error: usage of `ty::TyKind`
- --> $DIR/ty_tykind_usage.rs:48:24
+ --> $DIR/ty_tykind_usage.rs:49:24
|
LL | fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {}
| ^^^^^^^^^^
@@ -181,7 +187,7 @@ LL | fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {}
= help: try using `Ty` instead
error: usage of `ty::TyKind`
- --> $DIR/ty_tykind_usage.rs:50:37
+ --> $DIR/ty_tykind_usage.rs:51:37
|
LL | fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
| ^^^^^^^^^^^
@@ -189,7 +195,7 @@ LL | fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
= help: try using `Ty` instead
error: usage of `ty::TyKind`
- --> $DIR/ty_tykind_usage.rs:50:53
+ --> $DIR/ty_tykind_usage.rs:51:53
|
LL | fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
| ^^^^^^^^^^^
@@ -197,12 +203,12 @@ LL | fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
= help: try using `Ty` instead
error: usage of `ty::TyKind::<kind>`
- --> $DIR/ty_tykind_usage.rs:53:9
+ --> $DIR/ty_tykind_usage.rs:54:9
|
LL | IrTyKind::Bool
| --------^^^^^^
| |
| help: try using `ty::<kind>` directly: `ty`
-error: aborting due to 32 previous errors
+error: aborting due to 33 previous errors
diff --git a/tests/ui-fulldeps/mod_dir_path_canonicalized.rs b/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
index bdfd9628c..ddc86c1dc 100644
--- a/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
+++ b/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
@@ -31,7 +31,10 @@ pub fn main() {
}
fn parse() {
- let parse_session = ParseSess::new(FilePathMapping::empty());
+ let parse_session = ParseSess::new(
+ vec![rustc_parse::DEFAULT_LOCALE_RESOURCE],
+ FilePathMapping::empty()
+ );
let path = Path::new(file!());
let path = path.canonicalize().unwrap();
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
index 7a91dcf0d..e417a6a83 100644
--- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -41,7 +41,7 @@ use rustc_session::parse::ParseSess;
use rustc_span::source_map::FilePathMapping;
use rustc_span::source_map::{FileName, Spanned, DUMMY_SP};
use rustc_span::symbol::Ident;
-use thin_vec::thin_vec;
+use thin_vec::{thin_vec, ThinVec};
fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> {
let src_as_string = src.to_string();
@@ -76,17 +76,17 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
for kind in 0..=19 {
match kind {
0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Box(e))),
- 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, vec![]))),
+ 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))),
2 => {
let seg = PathSegment::from_ident(Ident::from_str("x"));
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::MethodCall(Box::new(MethodCall {
- seg: seg.clone(), receiver: e, args: vec![make_x()], span: DUMMY_SP
+ seg: seg.clone(), receiver: e, args: thin_vec![make_x()], span: DUMMY_SP
}))
)});
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::MethodCall(Box::new(MethodCall {
- seg: seg.clone(), receiver: make_x(), args: vec![e], span: DUMMY_SP
+ seg: seg.clone(), receiver: make_x(), args: thin_vec![e], span: DUMMY_SP
}))
)});
}
@@ -111,7 +111,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
}
10 => {
let block = P(Block {
- stmts: Vec::new(),
+ stmts: ThinVec::new(),
id: DUMMY_NODE_ID,
rules: BlockCheckMode::Default,
span: DUMMY_SP,
@@ -121,7 +121,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
iter_exprs(depth - 1, &mut |e| g(ExprKind::If(e, block.clone(), None)));
}
11 => {
- let decl = P(FnDecl { inputs: vec![], output: FnRetTy::Default(DUMMY_SP) });
+ let decl = P(FnDecl { inputs: thin_vec![], output: FnRetTy::Default(DUMMY_SP) });
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::Closure(Box::new(Closure {
binder: ClosureBinder::NotPresent,
@@ -165,7 +165,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
g(ExprKind::Struct(P(StructExpr {
qself: None,
path,
- fields: vec![],
+ fields: thin_vec![],
rest: StructRest::Base(make_x()),
})));
}
@@ -220,7 +220,7 @@ fn main() {
}
fn run() {
- let ps = ParseSess::new(FilePathMapping::empty());
+ let ps = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE], FilePathMapping::empty());
iter_exprs(2, &mut |mut e| {
// If the pretty printer is correct, then `parse(print(e))` should be identical to `e`,
diff --git a/tests/ui-fulldeps/rename-directory.rs b/tests/ui-fulldeps/rename-directory.rs
deleted file mode 100644
index 8fc340cb9..000000000
--- a/tests/ui-fulldeps/rename-directory.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// run-pass
-
-#![allow(unused_must_use)]
-#![allow(unused_imports)]
-// This test can't be a unit test in std,
-// because it needs TempDir, which is in extra
-
-// ignore-cross-compile
-
-use std::env;
-use std::ffi::CString;
-use std::fs::{self, File};
-use std::path::PathBuf;
-
-fn rename_directory() {
- let tmpdir = PathBuf::from(env::var_os("RUST_TEST_TMPDIR").unwrap());
- let old_path = tmpdir.join("foo/bar/baz");
- fs::create_dir_all(&old_path).unwrap();
- let test_file = &old_path.join("temp.txt");
-
- File::create(test_file).unwrap();
-
- let new_path = tmpdir.join("quux/blat");
- fs::create_dir_all(&new_path).unwrap();
- fs::rename(&old_path, &new_path.join("newdir"));
- assert!(new_path.join("newdir").is_dir());
- assert!(new_path.join("newdir/temp.txt").exists());
-}
-
-pub fn main() { rename_directory() }
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index 65d9601e7..01e6434b0 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -17,26 +17,28 @@ use rustc_span::symbol::Ident;
use rustc_span::Span;
extern crate rustc_macros;
-use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
+use rustc_macros::{fluent_messages, Diagnostic, LintDiagnostic, Subdiagnostic};
extern crate rustc_middle;
use rustc_middle::ty::Ty;
extern crate rustc_errors;
-use rustc_errors::{Applicability, MultiSpan};
+use rustc_errors::{Applicability, DiagnosticMessage, MultiSpan, SubdiagnosticMessage};
extern crate rustc_session;
+fluent_messages! { "./example.ftl" }
+
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct Hello {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct HelloWarn {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
//~^ ERROR unsupported type attribute for diagnostic derive enum
enum DiagnosticOnEnum {
Foo,
@@ -46,13 +48,13 @@ enum DiagnosticOnEnum {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
#[diag = "E0123"]
//~^ ERROR `#[diag = ...]` is not a valid attribute
struct WrongStructAttrStyle {}
#[derive(Diagnostic)]
-#[nonsense(compiletest_example, code = "E0123")]
+#[nonsense(no_crate_example, code = "E0123")]
//~^ ERROR `#[nonsense(...)]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified
//~^^^ ERROR cannot find attribute `nonsense` in this scope
@@ -66,7 +68,7 @@ struct InvalidLitNestedAttr {}
#[derive(Diagnostic)]
#[diag(nonsense, code = "E0123")]
-//~^ ERROR cannot find value `nonsense` in module `rustc_errors::fluent`
+//~^ ERROR cannot find value `nonsense` in module `crate::fluent_generated`
struct InvalidNestedStructAttr {}
#[derive(Diagnostic)]
@@ -90,12 +92,12 @@ struct InvalidNestedStructAttr2 {}
struct InvalidNestedStructAttr3 {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123", slug = "foo")]
+#[diag(no_crate_example, code = "E0123", slug = "foo")]
//~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
struct InvalidNestedStructAttr4 {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct WrongPlaceField {
#[suggestion = "bar"]
//~^ ERROR `#[suggestion = ...]` is not a valid attribute
@@ -103,20 +105,20 @@ struct WrongPlaceField {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
-#[diag(compiletest_example, code = "E0456")]
+#[diag(no_crate_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0456")]
//~^ ERROR specified multiple times
//~^^ ERROR specified multiple times
struct DiagSpecifiedTwice {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0456", code = "E0457")]
+#[diag(no_crate_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(no_crate_example, no_crate::example, code = "E0456")]
+//~^ ERROR `#[diag(no_crate::example)]` is not a valid attribute
struct SlugSpecifiedTwice {}
#[derive(Diagnostic)]
@@ -128,11 +130,11 @@ struct KindNotProvided {} //~ ERROR diagnostic slug not specified
struct SlugNotProvided {}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct CodeNotProvided {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct MessageWrongType {
#[primary_span]
//~^ ERROR `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@@ -140,7 +142,7 @@ struct MessageWrongType {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct InvalidPathFieldAttr {
#[nonsense]
//~^ ERROR `#[nonsense]` is not a valid attribute
@@ -149,34 +151,34 @@ struct InvalidPathFieldAttr {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithField {
name: String,
- #[label(label)]
+ #[label(no_crate_label)]
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithMessageAppliedToField {
- #[label(label)]
+ #[label(no_crate_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(no_crate_example, code = "E0123")]
struct ErrorWithNonexistentField {
- #[suggestion(suggestion, code = "{name}")]
+ #[suggestion(no_crate_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(no_crate_example, code = "E0123")]
struct ErrorMissingClosingBrace {
- #[suggestion(suggestion, code = "{name")]
+ #[suggestion(no_crate_suggestion, code = "{name")]
suggestion: (Span, Applicability),
name: String,
val: usize,
@@ -184,50 +186,50 @@ struct ErrorMissingClosingBrace {
#[derive(Diagnostic)]
//~^ ERROR invalid format string: unmatched `}`
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorMissingOpeningBrace {
- #[suggestion(suggestion, code = "name}")]
+ #[suggestion(no_crate_suggestion, code = "name}")]
suggestion: (Span, Applicability),
name: String,
val: usize,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct LabelOnSpan {
- #[label(label)]
+ #[label(no_crate_label)]
sp: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct LabelOnNonSpan {
- #[label(label)]
+ #[label(no_crate_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(no_crate_example, code = "E0123")]
struct Suggest {
- #[suggestion(suggestion, code = "This is the suggested code")]
- #[suggestion(suggestion, code = "This is the suggested code", style = "normal")]
- #[suggestion(suggestion, code = "This is the suggested code", style = "short")]
- #[suggestion(suggestion, code = "This is the suggested code", style = "hidden")]
- #[suggestion(suggestion, code = "This is the suggested code", style = "verbose")]
+ #[suggestion(no_crate_suggestion, code = "This is the suggested code")]
+ #[suggestion(no_crate_suggestion, code = "This is the suggested code", style = "normal")]
+ #[suggestion(no_crate_suggestion, code = "This is the suggested code", style = "short")]
+ #[suggestion(no_crate_suggestion, code = "This is the suggested code", style = "hidden")]
+ #[suggestion(no_crate_suggestion, code = "This is the suggested code", style = "verbose")]
suggestion: (Span, Applicability),
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithoutCode {
- #[suggestion(suggestion)]
+ #[suggestion(no_crate_suggestion)]
//~^ ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability),
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithBadKey {
#[suggestion(nonsense = "bar")]
//~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
@@ -236,7 +238,7 @@ struct SuggestWithBadKey {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithShorthandMsg {
#[suggestion(msg = "bar")]
//~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
@@ -245,52 +247,52 @@ struct SuggestWithShorthandMsg {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithoutMsg {
#[suggestion(code = "bar")]
suggestion: (Span, Applicability),
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithTypesSwapped {
- #[suggestion(suggestion, code = "This is suggested code")]
+ #[suggestion(no_crate_suggestion, code = "This is suggested code")]
suggestion: (Applicability, Span),
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithWrongTypeApplicabilityOnly {
- #[suggestion(suggestion, code = "This is suggested code")]
+ #[suggestion(no_crate_suggestion, code = "This is suggested code")]
//~^ ERROR wrong field type for suggestion
suggestion: Applicability,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithSpanOnly {
- #[suggestion(suggestion, code = "This is suggested code")]
+ #[suggestion(no_crate_suggestion, code = "This is suggested code")]
suggestion: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithDuplicateSpanAndApplicability {
- #[suggestion(suggestion, code = "This is suggested code")]
+ #[suggestion(no_crate_suggestion, code = "This is suggested code")]
suggestion: (Span, Span, Applicability),
//~^ ERROR specified multiple times
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct SuggestWithDuplicateApplicabilityAndSpan {
- #[suggestion(suggestion, code = "This is suggested code")]
+ #[suggestion(no_crate_suggestion, code = "This is suggested code")]
suggestion: (Applicability, Applicability, Span),
//~^ ERROR specified multiple times
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct WrongKindOfAnnotation {
#[label = "bar"]
//~^ ERROR `#[label = ...]` is not a valid attribute
@@ -298,38 +300,38 @@ struct WrongKindOfAnnotation {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct OptionsInErrors {
- #[label(label)]
+ #[label(no_crate_label)]
label: Option<Span>,
- #[suggestion(suggestion, code = "...")]
+ #[suggestion(no_crate_suggestion, code = "...")]
opt_sugg: Option<(Span, Applicability)>,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0456")]
+#[diag(no_crate_example, code = "E0456")]
struct MoveOutOfBorrowError<'tcx> {
name: Ident,
ty: Ty<'tcx>,
#[primary_span]
- #[label(label)]
+ #[label(no_crate_label)]
span: Span,
- #[label(label)]
+ #[label(no_crate_label)]
other_span: Span,
- #[suggestion(suggestion, code = "{name}.clone()")]
+ #[suggestion(no_crate_suggestion, code = "{name}.clone()")]
opt_sugg: Option<(Span, Applicability)>,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithLifetime<'a> {
- #[label(label)]
+ #[label(no_crate_label)]
span: Span,
name: &'a str,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithDefaultLabelAttr<'a> {
#[label]
span: Span,
@@ -338,7 +340,7 @@ struct ErrorWithDefaultLabelAttr<'a> {
#[derive(Diagnostic)]
//~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ArgFieldWithoutSkip {
#[primary_span]
span: Span,
@@ -346,7 +348,7 @@ struct ArgFieldWithoutSkip {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ArgFieldWithSkip {
#[primary_span]
span: Span,
@@ -357,132 +359,132 @@ struct ArgFieldWithSkip {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithSpannedNote {
#[note]
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithSpannedNoteCustom {
- #[note(note)]
+ #[note(no_crate_note)]
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
#[note]
struct ErrorWithNote {
val: String,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
-#[note(note)]
+#[diag(no_crate_example, code = "E0123")]
+#[note(no_crate_note)]
struct ErrorWithNoteCustom {
val: String,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithSpannedHelp {
#[help]
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithSpannedHelpCustom {
- #[help(help)]
+ #[help(no_crate_help)]
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
#[help]
struct ErrorWithHelp {
val: String,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
-#[help(help)]
+#[diag(no_crate_example, code = "E0123")]
+#[help(no_crate_help)]
struct ErrorWithHelpCustom {
val: String,
}
#[derive(Diagnostic)]
#[help]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithHelpWrongOrder {
val: String,
}
#[derive(Diagnostic)]
-#[help(help)]
-#[diag(compiletest_example, code = "E0123")]
+#[help(no_crate_help)]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithHelpCustomWrongOrder {
val: String,
}
#[derive(Diagnostic)]
#[note]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithNoteWrongOrder {
val: String,
}
#[derive(Diagnostic)]
-#[note(note)]
-#[diag(compiletest_example, code = "E0123")]
+#[note(no_crate_note)]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithNoteCustomWrongOrder {
val: String,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ApplicabilityInBoth {
- #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
+ #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
//~^ ERROR specified multiple times
suggestion: (Span, Applicability),
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct InvalidApplicability {
- #[suggestion(suggestion, code = "...", applicability = "batman")]
+ #[suggestion(no_crate_suggestion, code = "...", applicability = "batman")]
//~^ ERROR invalid applicability
suggestion: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ValidApplicability {
- #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
+ #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
suggestion: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct NoApplicability {
- #[suggestion(suggestion, code = "...")]
+ #[suggestion(no_crate_suggestion, code = "...")]
suggestion: Span,
}
#[derive(Subdiagnostic)]
-#[note(parse_add_paren)]
+#[note(no_crate_example)]
struct Note;
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct Subdiagnostic {
#[subdiagnostic]
note: Note,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct VecField {
#[primary_span]
#[label]
@@ -490,57 +492,57 @@ struct VecField {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct UnitField {
#[primary_span]
spans: Span,
#[help]
foo: (),
- #[help(help)]
+ #[help(no_crate_help)]
bar: (),
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct OptUnitField {
#[primary_span]
spans: Span,
#[help]
foo: Option<()>,
- #[help(help)]
+ #[help(no_crate_help)]
bar: Option<()>,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingPath {
- #[label(label, foo)]
+ #[label(no_crate_label, foo)]
//~^ ERROR `#[label(foo)]` is not a valid attribute
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingNameValue {
- #[label(label, foo = "...")]
+ #[label(no_crate_label, foo = "...")]
//~^ ERROR `#[label(foo = ...)]` is not a valid attribute
span: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingList {
- #[label(label, foo("..."))]
+ #[label(no_crate_label, foo("..."))]
//~^ ERROR `#[label(foo(...))]` is not a valid attribute
span: Span,
}
#[derive(LintDiagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct LintsGood {}
#[derive(LintDiagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct PrimarySpanOnLint {
#[primary_span]
//~^ ERROR `#[primary_span]` is not a valid attribute
@@ -548,42 +550,42 @@ struct PrimarySpanOnLint {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct ErrorWithMultiSpan {
#[primary_span]
span: MultiSpan,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
#[warning]
struct ErrorWithWarn {
val: String,
}
#[derive(Diagnostic)]
-#[error(compiletest_example, code = "E0123")]
+#[error(no_crate_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_(no_crate_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(no_crate_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(no_crate_example, code = "E0123")]
//~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
@@ -591,55 +593,55 @@ struct LintAttributeOnSessionDiag {}
struct LintAttributeOnLintDiag {}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct DuplicatedSuggestionCode {
- #[suggestion(suggestion, code = "...", code = ",,,")]
+ #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
//~^ ERROR specified multiple times
suggestion: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct InvalidTypeInSuggestionTuple {
- #[suggestion(suggestion, code = "...")]
+ #[suggestion(no_crate_suggestion, code = "...")]
suggestion: (Span, usize),
//~^ ERROR wrong types for suggestion
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct MissingApplicabilityInSuggestionTuple {
- #[suggestion(suggestion, code = "...")]
+ #[suggestion(no_crate_suggestion, code = "...")]
suggestion: (Span,),
//~^ ERROR wrong types for suggestion
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct MissingCodeInSuggestion {
- #[suggestion(suggestion)]
+ #[suggestion(no_crate_suggestion)]
//~^ ERROR suggestion without `code = "..."`
suggestion: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
-#[multipart_suggestion(suggestion)]
+#[diag(no_crate_example, code = "E0123")]
+#[multipart_suggestion(no_crate_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(suggestion)]
+ #[multipart_suggestion(no_crate_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(suggestion, code = "...")]
+#[diag(no_crate_example, code = "E0123")]
+#[suggestion(no_crate_suggestion, code = "...")]
//~^ ERROR `#[suggestion(...)]` is not a valid attribute
struct SuggestionOnStruct {
#[primary_span]
@@ -647,7 +649,7 @@ struct SuggestionOnStruct {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
#[label]
//~^ ERROR `#[label]` is not a valid attribute
struct LabelOnStruct {
@@ -657,30 +659,30 @@ struct LabelOnStruct {
#[derive(Diagnostic)]
enum ExampleEnum {
- #[diag(compiletest_example)]
+ #[diag(no_crate_example)]
Foo {
#[primary_span]
sp: Span,
#[note]
note_sp: Span,
},
- #[diag(compiletest_example)]
+ #[diag(no_crate_example)]
Bar {
#[primary_span]
sp: Span,
},
- #[diag(compiletest_example)]
+ #[diag(no_crate_example)]
Baz,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct RawIdentDiagnosticArg {
pub r#type: String,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticBad {
#[subdiagnostic(bad)]
//~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
@@ -688,7 +690,7 @@ struct SubdiagnosticBad {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticBadStr {
#[subdiagnostic = "bad"]
//~^ ERROR `#[subdiagnostic = ...]` is not a valid attribute
@@ -696,7 +698,7 @@ struct SubdiagnosticBadStr {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticBadTwice {
#[subdiagnostic(bad, bad)]
//~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
@@ -704,7 +706,7 @@ struct SubdiagnosticBadTwice {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticBadLitStr {
#[subdiagnostic("bad")]
//~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
@@ -712,7 +714,7 @@ struct SubdiagnosticBadLitStr {
}
#[derive(LintDiagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticEagerLint {
#[subdiagnostic(eager)]
//~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
@@ -720,7 +722,7 @@ struct SubdiagnosticEagerLint {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticEagerCorrect {
#[subdiagnostic(eager)]
note: Note,
@@ -731,7 +733,7 @@ struct SubdiagnosticEagerCorrect {
// after the `span_suggestion` call - which breaks eager translation.
#[derive(Subdiagnostic)]
-#[suggestion(use_instead, applicability = "machine-applicable", code = "{correct}")]
+#[suggestion(no_crate_example, applicability = "machine-applicable", code = "{correct}")]
pub(crate) struct SubdiagnosticWithSuggestion {
#[primary_span]
span: Span,
@@ -740,7 +742,7 @@ pub(crate) struct SubdiagnosticWithSuggestion {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SubdiagnosticEagerSuggestion {
#[subdiagnostic(eager)]
sub: SubdiagnosticWithSuggestion,
@@ -748,7 +750,7 @@ struct SubdiagnosticEagerSuggestion {
/// with a doc comment on the type..
#[derive(Diagnostic)]
-#[diag(compiletest_example, code = "E0123")]
+#[diag(no_crate_example, code = "E0123")]
struct WithDocComment {
/// ..and the field
#[primary_span]
@@ -756,21 +758,21 @@ struct WithDocComment {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SuggestionsGood {
#[suggestion(code("foo", "bar"))]
sub: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SuggestionsSingleItem {
#[suggestion(code("foo"))]
sub: Span,
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SuggestionsNoItem {
#[suggestion(code())]
//~^ ERROR expected at least one string literal for `code(...)`
@@ -778,7 +780,7 @@ struct SuggestionsNoItem {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SuggestionsInvalidItem {
#[suggestion(code(foo))]
//~^ ERROR `code(...)` must contain only string literals
@@ -786,7 +788,7 @@ struct SuggestionsInvalidItem {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SuggestionsInvalidLiteral {
#[suggestion(code = 3)]
//~^ ERROR `code = "..."`/`code(...)` must contain only string literals
@@ -794,8 +796,16 @@ struct SuggestionsInvalidLiteral {
}
#[derive(Diagnostic)]
-#[diag(compiletest_example)]
+#[diag(no_crate_example)]
struct SuggestionStyleGood {
#[suggestion(code = "", style = "hidden")]
sub: Span,
}
+
+#[derive(Diagnostic)]
+#[diag(no_crate_example)]
+struct SuggestionOnVec {
+ #[suggestion(no_crate_suggestion, code = "")]
+ //~^ ERROR `#[suggestion(...)]` is not a valid attribute
+ sub: Vec<Span>,
+}
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 13e806a43..fc0cd8419 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -1,11 +1,11 @@
error: unsupported type attribute for diagnostic derive enum
- --> $DIR/diagnostic-derive.rs:39:1
+ --> $DIR/diagnostic-derive.rs:41:1
|
-LL | #[diag(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:42:5
+ --> $DIR/diagnostic-derive.rs:44:5
|
LL | Foo,
| ^^^
@@ -13,7 +13,7 @@ LL | Foo,
= 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
+ --> $DIR/diagnostic-derive.rs:46:5
|
LL | Bar,
| ^^^
@@ -21,21 +21,21 @@ LL | Bar,
= 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
+ --> $DIR/diagnostic-derive.rs:52:1
|
LL | #[diag = "E0123"]
| ^^^^^^^^^^^^^^^^^
error: `#[nonsense(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:55:1
+ --> $DIR/diagnostic-derive.rs:57:1
|
-LL | #[nonsense(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[nonsense(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:55:1
+ --> $DIR/diagnostic-derive.rs:57:1
|
-LL | / #[nonsense(compiletest_example, code = "E0123")]
+LL | / #[nonsense(no_crate_example, code = "E0123")]
LL | |
LL | |
LL | |
@@ -45,7 +45,7 @@ LL | | struct InvalidStructAttr {}
= 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
+ --> $DIR/diagnostic-derive.rs:64:8
|
LL | #[diag("E0123")]
| ^^^^^^^
@@ -53,7 +53,7 @@ LL | #[diag("E0123")]
= help: a diagnostic slug is required as the first argument
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:62:1
+ --> $DIR/diagnostic-derive.rs:64:1
|
LL | / #[diag("E0123")]
LL | |
@@ -64,7 +64,7 @@ LL | | struct InvalidLitNestedAttr {}
= 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
+ --> $DIR/diagnostic-derive.rs:75:8
|
LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^
@@ -72,7 +72,7 @@ LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
= help: a diagnostic slug is required as the first argument
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:73:1
+ --> $DIR/diagnostic-derive.rs:75:1
|
LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
LL | |
@@ -83,7 +83,7 @@ LL | | struct InvalidNestedStructAttr1 {}
= 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
+ --> $DIR/diagnostic-derive.rs:81:8
|
LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^^
@@ -91,7 +91,7 @@ LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
= help: only `code` is a valid nested attributes following the slug
error: `#[diag(slug = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:79:42
+ --> $DIR/diagnostic-derive.rs:81:42
|
LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
= help: only `code` is a valid nested attributes following the slug
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:79:1
+ --> $DIR/diagnostic-derive.rs:81:1
|
LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
LL | |
@@ -111,13 +111,13 @@ LL | | struct InvalidNestedStructAttr2 {}
= 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
+ --> $DIR/diagnostic-derive.rs:88:8
|
LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^
error: `#[diag(slug = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:86:38
+ --> $DIR/diagnostic-derive.rs:88:38
|
LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^
@@ -125,7 +125,7 @@ LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
= help: only `code` is a valid nested attributes following the slug
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:86:1
+ --> $DIR/diagnostic-derive.rs:88:1
|
LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
LL | |
@@ -137,65 +137,65 @@ LL | | struct InvalidNestedStructAttr3 {}
= 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:45
+ --> $DIR/diagnostic-derive.rs:95:42
|
-LL | #[diag(compiletest_example, code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
+LL | #[diag(no_crate_example, code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^
|
= help: only `code` is a valid nested attributes following the slug
error: `#[suggestion = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:100:5
+ --> $DIR/diagnostic-derive.rs:102:5
|
LL | #[suggestion = "bar"]
| ^^^^^^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:107:8
+ --> $DIR/diagnostic-derive.rs:109:8
|
-LL | #[diag(compiletest_example, code = "E0456")]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #[diag(no_crate_example, code = "E0456")]
+ | ^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:106:8
+ --> $DIR/diagnostic-derive.rs:108:8
|
-LL | #[diag(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #[diag(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:107:36
+ --> $DIR/diagnostic-derive.rs:109:33
|
-LL | #[diag(compiletest_example, code = "E0456")]
- | ^^^^^^^
+LL | #[diag(no_crate_example, code = "E0456")]
+ | ^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:106:36
+ --> $DIR/diagnostic-derive.rs:108:33
|
-LL | #[diag(compiletest_example, code = "E0123")]
- | ^^^^^^^
+LL | #[diag(no_crate_example, code = "E0123")]
+ | ^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:113:52
+ --> $DIR/diagnostic-derive.rs:115:49
|
-LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
- | ^^^^^^^
+LL | #[diag(no_crate_example, code = "E0456", code = "E0457")]
+ | ^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:113:36
+ --> $DIR/diagnostic-derive.rs:115:33
|
-LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
- | ^^^^^^^
+LL | #[diag(no_crate_example, code = "E0456", code = "E0457")]
+ | ^^^^^^^
-error: `#[diag(compiletest_example)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:118:29
+error: `#[diag(no_crate::example)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:120:26
|
-LL | #[diag(compiletest_example, compiletest_example, code = "E0456")]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #[diag(no_crate_example, no_crate::example, code = "E0456")]
+ | ^^^^^^^^^^^^^^^^^
|
= help: diagnostic slug must be the first argument
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:123:1
+ --> $DIR/diagnostic-derive.rs:125:1
|
LL | struct KindNotProvided {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -203,7 +203,7 @@ LL | struct KindNotProvided {}
= 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
+ --> $DIR/diagnostic-derive.rs:128:1
|
LL | / #[diag(code = "E0456")]
LL | |
@@ -213,31 +213,31 @@ LL | | struct SlugNotProvided {}
= 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
+ --> $DIR/diagnostic-derive.rs:139:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: `#[nonsense]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:145:5
+ --> $DIR/diagnostic-derive.rs:147:5
|
LL | #[nonsense]
| ^^^^^^^^^^^
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/diagnostic-derive.rs:162:5
+ --> $DIR/diagnostic-derive.rs:164:5
|
-LL | #[label(label)]
- | ^^^^^^^^^^^^^^^
+LL | #[label(no_crate_label)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: `name` doesn't refer to a field on this type
- --> $DIR/diagnostic-derive.rs:170:37
+ --> $DIR/diagnostic-derive.rs:172:46
|
-LL | #[suggestion(suggestion, code = "{name}")]
- | ^^^^^^^^
+LL | #[suggestion(no_crate_suggestion, code = "{name}")]
+ | ^^^^^^^^
error: invalid format string: expected `'}'` but string was terminated
- --> $DIR/diagnostic-derive.rs:175:10
+ --> $DIR/diagnostic-derive.rs:177:10
|
LL | #[derive(Diagnostic)]
| ^^^^^^^^^^ expected `'}'` in format string
@@ -246,7 +246,7 @@ LL | #[derive(Diagnostic)]
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid format string: unmatched `}` found
- --> $DIR/diagnostic-derive.rs:185:10
+ --> $DIR/diagnostic-derive.rs:187:10
|
LL | #[derive(Diagnostic)]
| ^^^^^^^^^^ unmatched `}` in format string
@@ -255,19 +255,19 @@ LL | #[derive(Diagnostic)]
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/diagnostic-derive.rs:205:5
+ --> $DIR/diagnostic-derive.rs:207:5
|
-LL | #[label(label)]
- | ^^^^^^^^^^^^^^^
+LL | #[label(no_crate_label)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:224:5
+ --> $DIR/diagnostic-derive.rs:226:5
|
-LL | #[suggestion(suggestion)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:232:18
+ --> $DIR/diagnostic-derive.rs:234:18
|
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^
@@ -275,13 +275,13 @@ LL | #[suggestion(nonsense = "bar")]
= help: only `style`, `code` and `applicability` are valid nested attributes
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:232:5
+ --> $DIR/diagnostic-derive.rs:234:5
|
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion(msg = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:241:18
+ --> $DIR/diagnostic-derive.rs:243:18
|
LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^
@@ -289,15 +289,15 @@ LL | #[suggestion(msg = "bar")]
= help: only `style`, `code` and `applicability` are valid nested attributes
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:241:5
+ --> $DIR/diagnostic-derive.rs:243:5
|
LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: wrong field type for suggestion
- --> $DIR/diagnostic-derive.rs:264:5
+ --> $DIR/diagnostic-derive.rs:266:5
|
-LL | / #[suggestion(suggestion, code = "This is suggested code")]
+LL | / #[suggestion(no_crate_suggestion, code = "This is suggested code")]
LL | |
LL | | suggestion: Applicability,
| |_____________________________^
@@ -305,75 +305,75 @@ LL | | suggestion: Applicability,
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:280:24
+ --> $DIR/diagnostic-derive.rs:282:24
|
LL | suggestion: (Span, Span, Applicability),
| ^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:280:18
+ --> $DIR/diagnostic-derive.rs:282:18
|
LL | suggestion: (Span, Span, Applicability),
| ^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:288:33
+ --> $DIR/diagnostic-derive.rs:290:33
|
LL | suggestion: (Applicability, Applicability, Span),
| ^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:288:18
+ --> $DIR/diagnostic-derive.rs:290:18
|
LL | suggestion: (Applicability, Applicability, Span),
| ^^^^^^^^^^^^^
error: `#[label = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:295:5
+ --> $DIR/diagnostic-derive.rs:297:5
|
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:446:44
+ --> $DIR/diagnostic-derive.rs:448:53
|
-LL | #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:448:24
+ --> $DIR/diagnostic-derive.rs:450:24
|
LL | suggestion: (Span, Applicability),
| ^^^^^^^^^^^^^
error: invalid applicability
- --> $DIR/diagnostic-derive.rs:454:44
+ --> $DIR/diagnostic-derive.rs:456:53
|
-LL | #[suggestion(suggestion, code = "...", applicability = "batman")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "batman")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[label(foo)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:517:20
+ --> $DIR/diagnostic-derive.rs:519:29
|
-LL | #[label(label, foo)]
- | ^^^
+LL | #[label(no_crate_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:525:20
+ --> $DIR/diagnostic-derive.rs:527:29
|
-LL | #[label(label, foo = "...")]
- | ^^^^^^^^^^^
+LL | #[label(no_crate_label, foo = "...")]
+ | ^^^^^^^^^^^
error: `#[label(foo(...))]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:533:20
+ --> $DIR/diagnostic-derive.rs:535:29
|
-LL | #[label(label, foo("..."))]
- | ^^^^^^^^^^
+LL | #[label(no_crate_label, foo("..."))]
+ | ^^^^^^^^^^
error: `#[primary_span]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:545:5
+ --> $DIR/diagnostic-derive.rs:547:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
@@ -381,15 +381,15 @@ LL | #[primary_span]
= help: the `primary_span` field attribute is not valid for lint diagnostics
error: `#[error(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:565:1
+ --> $DIR/diagnostic-derive.rs:567:1
|
-LL | #[error(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[error(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:565:1
+ --> $DIR/diagnostic-derive.rs:567:1
|
-LL | / #[error(compiletest_example, code = "E0123")]
+LL | / #[error(no_crate_example, code = "E0123")]
LL | |
LL | |
LL | |
@@ -399,15 +399,15 @@ LL | | struct ErrorAttribute {}
= 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
+ --> $DIR/diagnostic-derive.rs:574:1
|
-LL | #[warn_(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[warn_(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:572:1
+ --> $DIR/diagnostic-derive.rs:574:1
|
-LL | / #[warn_(compiletest_example, code = "E0123")]
+LL | / #[warn_(no_crate_example, code = "E0123")]
LL | |
LL | |
LL | |
@@ -417,15 +417,15 @@ LL | | struct WarnAttribute {}
= 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
+ --> $DIR/diagnostic-derive.rs:581:1
|
-LL | #[lint(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[lint(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:579:1
+ --> $DIR/diagnostic-derive.rs:581:1
|
-LL | / #[lint(compiletest_example, code = "E0123")]
+LL | / #[lint(no_crate_example, code = "E0123")]
LL | |
LL | |
LL | |
@@ -435,21 +435,21 @@ LL | | struct LintAttributeOnSessionDiag {}
= 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
+ --> $DIR/diagnostic-derive.rs:588:1
|
-LL | #[lint(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[lint(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[lint(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:586:1
+ --> $DIR/diagnostic-derive.rs:588:1
|
-LL | #[lint(compiletest_example, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[lint(no_crate_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:586:1
+ --> $DIR/diagnostic-derive.rs:588:1
|
-LL | / #[lint(compiletest_example, code = "E0123")]
+LL | / #[lint(no_crate_example, code = "E0123")]
LL | |
LL | |
LL | |
@@ -460,19 +460,19 @@ LL | | struct LintAttributeOnLintDiag {}
= 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:44
+ --> $DIR/diagnostic-derive.rs:598:53
|
-LL | #[suggestion(suggestion, code = "...", code = ",,,")]
- | ^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
+ | ^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:596:30
+ --> $DIR/diagnostic-derive.rs:598:39
|
-LL | #[suggestion(suggestion, code = "...", code = ",,,")]
- | ^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
+ | ^^^^^^^^^^^^
error: wrong types for suggestion
- --> $DIR/diagnostic-derive.rs:605:24
+ --> $DIR/diagnostic-derive.rs:607:24
|
LL | suggestion: (Span, usize),
| ^^^^^
@@ -480,7 +480,7 @@ LL | suggestion: (Span, usize),
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
error: wrong types for suggestion
- --> $DIR/diagnostic-derive.rs:613:17
+ --> $DIR/diagnostic-derive.rs:615:17
|
LL | suggestion: (Span,),
| ^^^^^^^
@@ -488,21 +488,21 @@ LL | suggestion: (Span,),
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:620:5
+ --> $DIR/diagnostic-derive.rs:622:5
|
-LL | #[suggestion(suggestion)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[multipart_suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:627:1
+ --> $DIR/diagnostic-derive.rs:629:1
|
-LL | #[multipart_suggestion(suggestion)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[multipart_suggestion(no_crate_suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider creating a `Subdiagnostic` instead
error: `#[multipart_suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:630:1
+ --> $DIR/diagnostic-derive.rs:632:1
|
LL | #[multipart_suggestion()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -510,23 +510,23 @@ LL | #[multipart_suggestion()]
= help: consider creating a `Subdiagnostic` instead
error: `#[multipart_suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:634:5
+ --> $DIR/diagnostic-derive.rs:636:5
|
-LL | #[multipart_suggestion(suggestion)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[multipart_suggestion(no_crate_suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider creating a `Subdiagnostic` instead
error: `#[suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:642:1
+ --> $DIR/diagnostic-derive.rs:644:1
|
-LL | #[suggestion(suggestion, code = "...")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_suggestion, code = "...")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `#[label]` and `#[suggestion]` can only be applied to fields
error: `#[label]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:651:1
+ --> $DIR/diagnostic-derive.rs:653:1
|
LL | #[label]
| ^^^^^^^^
@@ -534,7 +534,7 @@ LL | #[label]
= help: `#[label]` and `#[suggestion]` can only be applied to fields
error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:685:5
+ --> $DIR/diagnostic-derive.rs:687:5
|
LL | #[subdiagnostic(bad)]
| ^^^^^^^^^^^^^^^^^^^^^
@@ -542,13 +542,13 @@ LL | #[subdiagnostic(bad)]
= help: `eager` is the only supported nested attribute for `subdiagnostic`
error: `#[subdiagnostic = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:693:5
+ --> $DIR/diagnostic-derive.rs:695:5
|
LL | #[subdiagnostic = "bad"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:701:5
+ --> $DIR/diagnostic-derive.rs:703:5
|
LL | #[subdiagnostic(bad, bad)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -556,7 +556,7 @@ LL | #[subdiagnostic(bad, bad)]
= help: `eager` is the only supported nested attribute for `subdiagnostic`
error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:709:5
+ --> $DIR/diagnostic-derive.rs:711:5
|
LL | #[subdiagnostic("bad")]
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -564,7 +564,7 @@ LL | #[subdiagnostic("bad")]
= help: `eager` is the only supported nested attribute for `subdiagnostic`
error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:717:5
+ --> $DIR/diagnostic-derive.rs:719:5
|
LL | #[subdiagnostic(eager)]
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -572,85 +572,95 @@ LL | #[subdiagnostic(eager)]
= help: eager subdiagnostics are not supported on lints
error: expected at least one string literal for `code(...)`
- --> $DIR/diagnostic-derive.rs:775:18
+ --> $DIR/diagnostic-derive.rs:777:18
|
LL | #[suggestion(code())]
| ^^^^^^
error: `code(...)` must contain only string literals
- --> $DIR/diagnostic-derive.rs:783:23
+ --> $DIR/diagnostic-derive.rs:785:23
|
LL | #[suggestion(code(foo))]
| ^^^
error: `code = "..."`/`code(...)` must contain only string literals
- --> $DIR/diagnostic-derive.rs:791:18
+ --> $DIR/diagnostic-derive.rs:793:18
|
LL | #[suggestion(code = 3)]
| ^^^^^^^^
+error: `#[suggestion(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:808:5
+ |
+LL | #[suggestion(no_crate_suggestion, code = "")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[suggestion(...)]` applied to `Vec` field is ambiguous
+ = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`
+ = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
+
error: cannot find attribute `nonsense` in this scope
- --> $DIR/diagnostic-derive.rs:55:3
+ --> $DIR/diagnostic-derive.rs:57:3
|
-LL | #[nonsense(compiletest_example, code = "E0123")]
+LL | #[nonsense(no_crate_example, code = "E0123")]
| ^^^^^^^^
error: cannot find attribute `nonsense` in this scope
- --> $DIR/diagnostic-derive.rs:145:7
+ --> $DIR/diagnostic-derive.rs:147:7
|
LL | #[nonsense]
| ^^^^^^^^
error: cannot find attribute `error` in this scope
- --> $DIR/diagnostic-derive.rs:565:3
+ --> $DIR/diagnostic-derive.rs:567:3
|
-LL | #[error(compiletest_example, code = "E0123")]
+LL | #[error(no_crate_example, code = "E0123")]
| ^^^^^
error: cannot find attribute `warn_` in this scope
- --> $DIR/diagnostic-derive.rs:572:3
+ --> $DIR/diagnostic-derive.rs:574:3
|
-LL | #[warn_(compiletest_example, code = "E0123")]
+LL | #[warn_(no_crate_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
+ --> $DIR/diagnostic-derive.rs:581:3
|
-LL | #[lint(compiletest_example, code = "E0123")]
+LL | #[lint(no_crate_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
+ --> $DIR/diagnostic-derive.rs:588:3
|
-LL | #[lint(compiletest_example, code = "E0123")]
+LL | #[lint(no_crate_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
+ --> $DIR/diagnostic-derive.rs:629:3
|
-LL | #[multipart_suggestion(suggestion)]
+LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^
error: cannot find attribute `multipart_suggestion` in this scope
- --> $DIR/diagnostic-derive.rs:630:3
+ --> $DIR/diagnostic-derive.rs:632:3
|
LL | #[multipart_suggestion()]
| ^^^^^^^^^^^^^^^^^^^^
error: cannot find attribute `multipart_suggestion` in this scope
- --> $DIR/diagnostic-derive.rs:634:7
+ --> $DIR/diagnostic-derive.rs:636:7
|
-LL | #[multipart_suggestion(suggestion)]
+LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^
-error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
- --> $DIR/diagnostic-derive.rs:68:8
+error[E0425]: cannot find value `nonsense` in module `crate::fluent_generated`
+ --> $DIR/diagnostic-derive.rs:70:8
|
LL | #[diag(nonsense, code = "E0123")]
- | ^^^^^^^^ not found in `rustc_errors::fluent`
+ | ^^^^^^^^ not found in `crate::fluent_generated`
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
- --> $DIR/diagnostic-derive.rs:339:10
+ --> $DIR/diagnostic-derive.rs:341:10
|
LL | #[derive(Diagnostic)]
| ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
@@ -660,7 +670,7 @@ note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
--> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
= note: this error originates in the derive macro `Diagnostic` which comes from the expansion of the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 83 previous errors
+error: aborting due to 84 previous errors
Some errors have detailed explanations: E0277, E0425.
For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui-fulldeps/session-diagnostic/example.ftl b/tests/ui-fulldeps/session-diagnostic/example.ftl
new file mode 100644
index 000000000..cb2d476d8
--- /dev/null
+++ b/tests/ui-fulldeps/session-diagnostic/example.ftl
@@ -0,0 +1,5 @@
+no_crate_example = this is an example message used in testing
+ .note = with a note
+ .help = with a help
+ .suggestion = with a suggestion
+ .label = with a label
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
index 61ac456a6..c882f7792 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
@@ -15,12 +15,14 @@ extern crate rustc_macros;
extern crate rustc_session;
extern crate rustc_span;
-use rustc_errors::Applicability;
-use rustc_macros::Subdiagnostic;
+use rustc_errors::{Applicability, DiagnosticMessage, SubdiagnosticMessage};
+use rustc_macros::{fluent_messages, Subdiagnostic};
use rustc_span::Span;
+fluent_messages! { "./example.ftl" }
+
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct A {
#[primary_span]
span: Span,
@@ -29,13 +31,13 @@ struct A {
#[derive(Subdiagnostic)]
enum B {
- #[label(parse_add_paren)]
+ #[label(no_crate_example)]
A {
#[primary_span]
span: Span,
var: String,
},
- #[label(parse_add_paren)]
+ #[label(no_crate_example)]
B {
#[primary_span]
span: Span,
@@ -44,7 +46,7 @@ enum B {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
//~^ ERROR label without `#[primary_span]` field
struct C {
var: String,
@@ -120,8 +122,8 @@ struct K {
#[derive(Subdiagnostic)]
#[label(slug)]
-//~^ ERROR cannot find value `slug` in module `rustc_errors::fluent`
-//~^^ NOTE not found in `rustc_errors::fluent`
+//~^ ERROR cannot find value `slug` in module `crate::fluent_generated`
+//~^^ NOTE not found in `crate::fluent_generated`
struct L {
#[primary_span]
span: Span,
@@ -138,7 +140,7 @@ struct M {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren, code = "...")]
+#[label(no_crate_example, code = "...")]
//~^ ERROR `#[label(code = ...)]` is not a valid attribute
struct N {
#[primary_span]
@@ -147,7 +149,7 @@ struct N {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren, applicability = "machine-applicable")]
+#[label(no_crate_example, applicability = "machine-applicable")]
//~^ ERROR `#[label(applicability = ...)]` is not a valid attribute
struct O {
#[primary_span]
@@ -160,7 +162,7 @@ struct O {
//~^ ERROR cannot find attribute `foo` in this scope
//~^^ ERROR unsupported type attribute for subdiagnostic enum
enum P {
- #[label(parse_add_paren)]
+ #[label(no_crate_example)]
A {
#[primary_span]
span: Span,
@@ -230,7 +232,7 @@ enum U {
#[derive(Subdiagnostic)]
enum V {
- #[label(parse_add_paren)]
+ #[label(no_crate_example)]
A {
#[primary_span]
span: Span,
@@ -244,7 +246,7 @@ enum V {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
//~^ ERROR label without `#[primary_span]` field
struct W {
#[primary_span]
@@ -253,7 +255,7 @@ struct W {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct X {
#[primary_span]
span: Span,
@@ -263,7 +265,7 @@ struct X {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct Y {
#[primary_span]
span: Span,
@@ -274,7 +276,7 @@ struct Y {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct Z {
#[primary_span]
span: Span,
@@ -285,7 +287,7 @@ struct Z {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct AA {
#[primary_span]
span: Span,
@@ -296,7 +298,7 @@ struct AA {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct AB {
#[primary_span]
span: Span,
@@ -312,23 +314,23 @@ union AC {
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
+#[label(no_crate_example)]
struct AD {
#[primary_span]
span: Span,
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren, parse_add_paren)]
-//~^ ERROR `#[label(parse_add_paren)]` is not a valid attribute
+#[label(no_crate_example, no_crate::example)]
+//~^ ERROR `#[label(no_crate::example)]` is not a valid attribute
struct AE {
#[primary_span]
span: Span,
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct AF {
#[primary_span]
//~^ NOTE previously specified here
@@ -346,7 +348,7 @@ struct AG {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...")]
+#[suggestion(no_crate_example, code = "...")]
struct AH {
#[primary_span]
span: Span,
@@ -357,7 +359,7 @@ struct AH {
#[derive(Subdiagnostic)]
enum AI {
- #[suggestion(parse_add_paren, code = "...")]
+ #[suggestion(no_crate_example, code = "...")]
A {
#[primary_span]
span: Span,
@@ -365,7 +367,7 @@ enum AI {
applicability: Applicability,
var: String,
},
- #[suggestion(parse_add_paren, code = "...")]
+ #[suggestion(no_crate_example, code = "...")]
B {
#[primary_span]
span: Span,
@@ -376,7 +378,7 @@ enum AI {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...", code = "...")]
+#[suggestion(no_crate_example, code = "...", code = "...")]
//~^ ERROR specified multiple times
//~^^ NOTE previously specified here
struct AJ {
@@ -387,7 +389,7 @@ struct AJ {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...")]
+#[suggestion(no_crate_example, code = "...")]
struct AK {
#[primary_span]
span: Span,
@@ -400,7 +402,7 @@ struct AK {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...")]
+#[suggestion(no_crate_example, code = "...")]
struct AL {
#[primary_span]
span: Span,
@@ -410,14 +412,14 @@ struct AL {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...")]
+#[suggestion(no_crate_example, code = "...")]
struct AM {
#[primary_span]
span: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren)]
+#[suggestion(no_crate_example)]
//~^ ERROR suggestion without `code = "..."`
struct AN {
#[primary_span]
@@ -427,7 +429,7 @@ struct AN {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...", applicability = "foo")]
+#[suggestion(no_crate_example, code = "...", applicability = "foo")]
//~^ ERROR invalid applicability
struct AO {
#[primary_span]
@@ -435,24 +437,24 @@ struct AO {
}
#[derive(Subdiagnostic)]
-#[help(parse_add_paren)]
+#[help(no_crate_example)]
struct AP {
var: String,
}
#[derive(Subdiagnostic)]
-#[note(parse_add_paren)]
+#[note(no_crate_example)]
struct AQ;
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...")]
+#[suggestion(no_crate_example, code = "...")]
//~^ ERROR suggestion without `#[primary_span]` field
struct AR {
var: String,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...", applicability = "machine-applicable")]
+#[suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
struct AS {
#[primary_span]
span: Span,
@@ -462,7 +464,7 @@ struct AS {
#[label]
//~^ ERROR unsupported type attribute for subdiagnostic enum
enum AT {
- #[label(parse_add_paren)]
+ #[label(no_crate_example)]
A {
#[primary_span]
span: Span,
@@ -471,7 +473,7 @@ enum AT {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "{var}", applicability = "machine-applicable")]
+#[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
struct AU {
#[primary_span]
span: Span,
@@ -479,7 +481,7 @@ struct AU {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "{var}", applicability = "machine-applicable")]
+#[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
//~^ ERROR `var` doesn't refer to a field on this type
struct AV {
#[primary_span]
@@ -488,7 +490,7 @@ struct AV {
#[derive(Subdiagnostic)]
enum AW {
- #[suggestion(parse_add_paren, code = "{var}", applicability = "machine-applicable")]
+ #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
A {
#[primary_span]
span: Span,
@@ -498,7 +500,7 @@ enum AW {
#[derive(Subdiagnostic)]
enum AX {
- #[suggestion(parse_add_paren, code = "{var}", applicability = "machine-applicable")]
+ #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
//~^ ERROR `var` doesn't refer to a field on this type
A {
#[primary_span]
@@ -507,18 +509,18 @@ enum AX {
}
#[derive(Subdiagnostic)]
-#[warning(parse_add_paren)]
+#[warning(no_crate_example)]
struct AY {}
#[derive(Subdiagnostic)]
-#[warning(parse_add_paren)]
+#[warning(no_crate_example)]
struct AZ {
#[primary_span]
span: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "...")]
+#[suggestion(no_crate_example, code = "...")]
//~^ ERROR suggestion without `#[primary_span]` field
struct BA {
#[suggestion_part]
@@ -533,7 +535,7 @@ struct BA {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, code = "...", applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, 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 +543,7 @@ struct BBa {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BBb {
#[suggestion_part]
//~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
@@ -549,7 +551,7 @@ struct BBb {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BBc {
#[suggestion_part()]
//~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
@@ -557,7 +559,7 @@ struct BBc {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
//~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
struct BC {
#[primary_span]
@@ -566,7 +568,7 @@ struct BC {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BD {
#[suggestion_part]
//~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
@@ -586,7 +588,7 @@ struct BD {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BE {
#[suggestion_part(code = "...", code = ",,,")]
//~^ ERROR specified multiple times
@@ -595,7 +597,7 @@ struct BE {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BF {
#[suggestion_part(code = "(")]
first: Span,
@@ -604,7 +606,7 @@ struct BF {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BG {
#[applicability]
appl: Applicability,
@@ -615,7 +617,7 @@ struct BG {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BH {
#[applicability]
//~^ ERROR `#[applicability]` has no effect
@@ -627,14 +629,14 @@ struct BH {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
+#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BI {
#[suggestion_part(code = "")]
spans: Vec<Span>,
}
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct BJ {
#[primary_span]
span: Span,
@@ -643,7 +645,7 @@ struct BJ {
/// with a doc comment on the type..
#[derive(Subdiagnostic)]
-#[label(parse_add_paren)]
+#[label(no_crate_example)]
struct BK {
/// ..and the field
#[primary_span]
@@ -654,7 +656,7 @@ struct BK {
#[derive(Subdiagnostic)]
enum BL {
/// ..and the variant..
- #[label(parse_add_paren)]
+ #[label(no_crate_example)]
Foo {
/// ..and the field
#[primary_span]
@@ -663,7 +665,7 @@ enum BL {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BM {
#[suggestion_part(code("foo"))]
//~^ ERROR expected exactly one string literal for `code = ...`
@@ -672,7 +674,7 @@ struct BM {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BN {
#[suggestion_part(code("foo", "bar"))]
//~^ ERROR expected exactly one string literal for `code = ...`
@@ -681,7 +683,7 @@ struct BN {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BO {
#[suggestion_part(code(3))]
//~^ ERROR expected exactly one string literal for `code = ...`
@@ -690,7 +692,7 @@ struct BO {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BP {
#[suggestion_part(code())]
//~^ ERROR expected exactly one string literal for `code = ...`
@@ -699,7 +701,7 @@ struct BP {
}
#[derive(Subdiagnostic)]
-#[multipart_suggestion(parse_add_paren)]
+#[multipart_suggestion(no_crate_example)]
struct BQ {
#[suggestion_part(code = 3)]
//~^ ERROR `code = "..."`/`code(...)` must contain only string literals
@@ -708,42 +710,42 @@ struct BQ {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "")]
+#[suggestion(no_crate_example, code = "")]
struct SuggestionStyleDefault {
#[primary_span]
sub: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = "short")]
+#[suggestion(no_crate_example, code = "", style = "short")]
struct SuggestionStyleShort {
#[primary_span]
sub: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = "hidden")]
+#[suggestion(no_crate_example, code = "", style = "hidden")]
struct SuggestionStyleHidden {
#[primary_span]
sub: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = "verbose")]
+#[suggestion(no_crate_example, code = "", style = "verbose")]
struct SuggestionStyleVerbose {
#[primary_span]
sub: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = "tool-only")]
+#[suggestion(no_crate_example, code = "", style = "tool-only")]
struct SuggestionStyleToolOnly {
#[primary_span]
sub: Span,
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = "hidden", style = "normal")]
+#[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
//~^ ERROR specified multiple times
//~| NOTE previously specified here
struct SuggestionStyleTwice {
@@ -752,7 +754,7 @@ struct SuggestionStyleTwice {
}
#[derive(Subdiagnostic)]
-#[suggestion_hidden(parse_add_paren, code = "")]
+#[suggestion_hidden(no_crate_example, code = "")]
//~^ ERROR #[suggestion_hidden(...)]` is not a valid attribute
struct SuggestionStyleOldSyntax {
#[primary_span]
@@ -760,7 +762,7 @@ struct SuggestionStyleOldSyntax {
}
#[derive(Subdiagnostic)]
-#[suggestion_hidden(parse_add_paren, code = "", style = "normal")]
+#[suggestion_hidden(no_crate_example, code = "", style = "normal")]
//~^ ERROR #[suggestion_hidden(...)]` is not a valid attribute
struct SuggestionStyleOldAndNewSyntax {
#[primary_span]
@@ -768,7 +770,7 @@ struct SuggestionStyleOldAndNewSyntax {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = "foo")]
+#[suggestion(no_crate_example, code = "", style = "foo")]
//~^ ERROR invalid suggestion style
struct SuggestionStyleInvalid1 {
#[primary_span]
@@ -776,7 +778,7 @@ struct SuggestionStyleInvalid1 {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style = 42)]
+#[suggestion(no_crate_example, code = "", style = 42)]
//~^ ERROR `#[suggestion(style = ...)]` is not a valid attribute
struct SuggestionStyleInvalid2 {
#[primary_span]
@@ -784,7 +786,7 @@ struct SuggestionStyleInvalid2 {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style)]
+#[suggestion(no_crate_example, code = "", style)]
//~^ ERROR `#[suggestion(style)]` is not a valid attribute
struct SuggestionStyleInvalid3 {
#[primary_span]
@@ -792,9 +794,19 @@ struct SuggestionStyleInvalid3 {
}
#[derive(Subdiagnostic)]
-#[suggestion(parse_add_paren, code = "", style("foo"))]
+#[suggestion(no_crate_example, code = "", style("foo"))]
//~^ ERROR `#[suggestion(style(...))]` is not a valid attribute
struct SuggestionStyleInvalid4 {
#[primary_span]
sub: Span,
}
+
+#[derive(Subdiagnostic)]
+#[suggestion(no_crate_example, code = "")]
+//~^ ERROR suggestion without `#[primary_span]` field
+struct PrimarySpanOnVec {
+ #[primary_span]
+ //~^ ERROR `#[primary_span]` is not a valid attribute
+ //~| NOTE there must be exactly one primary span
+ sub: Vec<Span>,
+}
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
index b594fa6cd..343134af6 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
@@ -1,7 +1,7 @@
error: label without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:47:1
+ --> $DIR/subdiagnostic-derive.rs:49:1
|
-LL | / #[label(parse_add_paren)]
+LL | / #[label(no_crate_example)]
LL | |
LL | | struct C {
LL | | var: String,
@@ -9,141 +9,141 @@ LL | | }
| |_^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:54:1
+ --> $DIR/subdiagnostic-derive.rs:56:1
|
LL | #[label]
| ^^^^^^^^
error: `#[foo]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:63:1
+ --> $DIR/subdiagnostic-derive.rs:65:1
|
LL | #[foo]
| ^^^^^^
error: `#[label = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:73:1
+ --> $DIR/subdiagnostic-derive.rs:75:1
|
LL | #[label = "..."]
| ^^^^^^^^^^^^^^^^
error: `#[label(bug = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:82:9
+ --> $DIR/subdiagnostic-derive.rs:84:9
|
LL | #[label(bug = "...")]
| ^^^^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:82:1
+ --> $DIR/subdiagnostic-derive.rs:84:1
|
LL | #[label(bug = "...")]
| ^^^^^^^^^^^^^^^^^^^^^
error: `#[label("...")]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:92:9
+ --> $DIR/subdiagnostic-derive.rs:94:9
|
LL | #[label("...")]
| ^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:92:1
+ --> $DIR/subdiagnostic-derive.rs:94:1
|
LL | #[label("...")]
| ^^^^^^^^^^^^^^^
error: `#[label(slug = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:102:9
+ --> $DIR/subdiagnostic-derive.rs:104:9
|
LL | #[label(slug = 4)]
| ^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:102:1
+ --> $DIR/subdiagnostic-derive.rs:104:1
|
LL | #[label(slug = 4)]
| ^^^^^^^^^^^^^^^^^^
error: `#[label(slug(...))]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:112:9
+ --> $DIR/subdiagnostic-derive.rs:114:9
|
LL | #[label(slug("..."))]
| ^^^^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:112:1
+ --> $DIR/subdiagnostic-derive.rs:114:1
|
LL | #[label(slug("..."))]
| ^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:132:1
+ --> $DIR/subdiagnostic-derive.rs:134:1
|
LL | #[label()]
| ^^^^^^^^^^
error: `#[label(code = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:141:26
+ --> $DIR/subdiagnostic-derive.rs:143:27
|
-LL | #[label(parse_add_paren, code = "...")]
- | ^^^^^^^^^^^^
+LL | #[label(no_crate_example, code = "...")]
+ | ^^^^^^^^^^^^
error: `#[label(applicability = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:150:26
+ --> $DIR/subdiagnostic-derive.rs:152:27
|
-LL | #[label(parse_add_paren, applicability = "machine-applicable")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(no_crate_example, applicability = "machine-applicable")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unsupported type attribute for subdiagnostic enum
- --> $DIR/subdiagnostic-derive.rs:159:1
+ --> $DIR/subdiagnostic-derive.rs:161:1
|
LL | #[foo]
| ^^^^^^
error: `#[bar]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:173:5
+ --> $DIR/subdiagnostic-derive.rs:175:5
|
LL | #[bar]
| ^^^^^^
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:185:5
+ --> $DIR/subdiagnostic-derive.rs:187:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:197:5
+ --> $DIR/subdiagnostic-derive.rs:199:5
|
LL | #[bar = 4]
| ^^^^^^^^^^
error: `#[bar(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:209:5
+ --> $DIR/subdiagnostic-derive.rs:211:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
error: `#[label(code = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:221:13
+ --> $DIR/subdiagnostic-derive.rs:223:13
|
LL | #[label(code = "...")]
| ^^^^^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:221:5
+ --> $DIR/subdiagnostic-derive.rs:223:5
|
LL | #[label(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/subdiagnostic-derive.rs:250:5
+ --> $DIR/subdiagnostic-derive.rs:252:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: label without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:247:1
+ --> $DIR/subdiagnostic-derive.rs:249:1
|
-LL | / #[label(parse_add_paren)]
+LL | / #[label(no_crate_example)]
LL | |
LL | | struct W {
LL | | #[primary_span]
@@ -153,13 +153,13 @@ LL | | }
| |_^
error: `#[applicability]` is only valid on suggestions
- --> $DIR/subdiagnostic-derive.rs:260:5
+ --> $DIR/subdiagnostic-derive.rs:262:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: `#[bar]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:270:5
+ --> $DIR/subdiagnostic-derive.rs:272:5
|
LL | #[bar]
| ^^^^^^
@@ -167,13 +167,13 @@ LL | #[bar]
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:281:5
+ --> $DIR/subdiagnostic-derive.rs:283:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
error: `#[bar(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:292:5
+ --> $DIR/subdiagnostic-derive.rs:294:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
@@ -181,7 +181,7 @@ LL | #[bar("...")]
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: unexpected unsupported untagged union
- --> $DIR/subdiagnostic-derive.rs:308:1
+ --> $DIR/subdiagnostic-derive.rs:310:1
|
LL | / union AC {
LL | |
@@ -190,78 +190,78 @@ LL | | b: u64,
LL | | }
| |_^
-error: `#[label(parse_add_paren)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:323:26
+error: `#[label(no_crate::example)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:325:27
|
-LL | #[label(parse_add_paren, parse_add_paren)]
- | ^^^^^^^^^^^^^^^
+LL | #[label(no_crate_example, no_crate::example)]
+ | ^^^^^^^^^^^^^^^^^
|
= help: a diagnostic slug must be the first argument to the attribute
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:336:5
+ --> $DIR/subdiagnostic-derive.rs:338:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:333:5
+ --> $DIR/subdiagnostic-derive.rs:335:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: subdiagnostic kind not specified
- --> $DIR/subdiagnostic-derive.rs:342:8
+ --> $DIR/subdiagnostic-derive.rs:344:8
|
LL | struct AG {
| ^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:379:45
+ --> $DIR/subdiagnostic-derive.rs:381:46
|
-LL | #[suggestion(parse_add_paren, code = "...", code = "...")]
- | ^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "...", code = "...")]
+ | ^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:379:31
+ --> $DIR/subdiagnostic-derive.rs:381:32
|
-LL | #[suggestion(parse_add_paren, code = "...", code = "...")]
- | ^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "...", code = "...")]
+ | ^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:397:5
+ --> $DIR/subdiagnostic-derive.rs:399:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:394:5
+ --> $DIR/subdiagnostic-derive.rs:396:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
- --> $DIR/subdiagnostic-derive.rs:407:5
+ --> $DIR/subdiagnostic-derive.rs:409:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: suggestion without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:420:1
+ --> $DIR/subdiagnostic-derive.rs:422:1
|
-LL | #[suggestion(parse_add_paren)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid applicability
- --> $DIR/subdiagnostic-derive.rs:430:45
+ --> $DIR/subdiagnostic-derive.rs:432:46
|
-LL | #[suggestion(parse_add_paren, code = "...", applicability = "foo")]
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
+ | ^^^^^^^^^^^^^^^^^^^^^
error: suggestion without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:448:1
+ --> $DIR/subdiagnostic-derive.rs:450:1
|
-LL | / #[suggestion(parse_add_paren, code = "...")]
+LL | / #[suggestion(no_crate_example, code = "...")]
LL | |
LL | | struct AR {
LL | | var: String,
@@ -269,25 +269,25 @@ LL | | }
| |_^
error: unsupported type attribute for subdiagnostic enum
- --> $DIR/subdiagnostic-derive.rs:462:1
+ --> $DIR/subdiagnostic-derive.rs:464:1
|
LL | #[label]
| ^^^^^^^^
error: `var` doesn't refer to a field on this type
- --> $DIR/subdiagnostic-derive.rs:482:38
+ --> $DIR/subdiagnostic-derive.rs:484:39
|
-LL | #[suggestion(parse_add_paren, code = "{var}", applicability = "machine-applicable")]
- | ^^^^^^^
+LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
+ | ^^^^^^^
error: `var` doesn't refer to a field on this type
- --> $DIR/subdiagnostic-derive.rs:501:42
+ --> $DIR/subdiagnostic-derive.rs:503:43
|
-LL | #[suggestion(parse_add_paren, code = "{var}", applicability = "machine-applicable")]
- | ^^^^^^^
+LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
+ | ^^^^^^^
error: `#[suggestion_part]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:524:5
+ --> $DIR/subdiagnostic-derive.rs:526:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
@@ -295,7 +295,7 @@ LL | #[suggestion_part]
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
error: `#[suggestion_part(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:527:5
+ --> $DIR/subdiagnostic-derive.rs:529:5
|
LL | #[suggestion_part(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -303,9 +303,9 @@ LL | #[suggestion_part(code = "...")]
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions
error: suggestion without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:521:1
+ --> $DIR/subdiagnostic-derive.rs:523:1
|
-LL | / #[suggestion(parse_add_paren, code = "...")]
+LL | / #[suggestion(no_crate_example, 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:41
+ --> $DIR/subdiagnostic-derive.rs:538:42
|
-LL | #[multipart_suggestion(parse_add_paren, code = "...", applicability = "machine-applicable")]
- | ^^^^^^^^^^^^
+LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
+ | ^^^^^^^^^^^^
|
= help: only `style` and `applicability` are valid nested attributes
error: multipart suggestion without any `#[suggestion_part(...)]` fields
- --> $DIR/subdiagnostic-derive.rs:536:1
+ --> $DIR/subdiagnostic-derive.rs:538:1
|
-LL | / #[multipart_suggestion(parse_add_paren, code = "...", applicability = "machine-applicable")]
+LL | / #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
LL | |
LL | |
LL | | struct BBa {
@@ -334,19 +334,19 @@ LL | | }
| |_^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:546:5
+ --> $DIR/subdiagnostic-derive.rs:548:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:554:5
+ --> $DIR/subdiagnostic-derive.rs:556:5
|
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
error: `#[primary_span]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:563:5
+ --> $DIR/subdiagnostic-derive.rs:565:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
@@ -354,9 +354,9 @@ LL | #[primary_span]
= help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
error: multipart suggestion without any `#[suggestion_part(...)]` fields
- --> $DIR/subdiagnostic-derive.rs:560:1
+ --> $DIR/subdiagnostic-derive.rs:562:1
|
-LL | / #[multipart_suggestion(parse_add_paren)]
+LL | / #[multipart_suggestion(no_crate_example)]
LL | |
LL | | struct BC {
LL | | #[primary_span]
@@ -366,19 +366,19 @@ LL | | }
| |_^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:571:5
+ --> $DIR/subdiagnostic-derive.rs:573:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:574:5
+ --> $DIR/subdiagnostic-derive.rs:576:5
|
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion_part(foo = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:577:23
+ --> $DIR/subdiagnostic-derive.rs:579:23
|
LL | #[suggestion_part(foo = "bar")]
| ^^^^^^^^^^^
@@ -386,181 +386,202 @@ LL | #[suggestion_part(foo = "bar")]
= help: `code` is the only valid nested attribute
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/subdiagnostic-derive.rs:580:5
+ --> $DIR/subdiagnostic-derive.rs:582:5
|
LL | #[suggestion_part(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/subdiagnostic-derive.rs:583:5
+ --> $DIR/subdiagnostic-derive.rs:585:5
|
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:591:37
+ --> $DIR/subdiagnostic-derive.rs:593:37
|
LL | #[suggestion_part(code = "...", code = ",,,")]
| ^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:591:23
+ --> $DIR/subdiagnostic-derive.rs:593:23
|
LL | #[suggestion_part(code = "...", code = ",,,")]
| ^^^^^^^^^^^^
error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
- --> $DIR/subdiagnostic-derive.rs:620:5
+ --> $DIR/subdiagnostic-derive.rs:622:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:668:23
+ --> $DIR/subdiagnostic-derive.rs:670:23
|
LL | #[suggestion_part(code("foo"))]
| ^^^^^^^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:677:23
+ --> $DIR/subdiagnostic-derive.rs:679:23
|
LL | #[suggestion_part(code("foo", "bar"))]
| ^^^^^^^^^^^^^^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:686:23
+ --> $DIR/subdiagnostic-derive.rs:688:23
|
LL | #[suggestion_part(code(3))]
| ^^^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:695:23
+ --> $DIR/subdiagnostic-derive.rs:697:23
|
LL | #[suggestion_part(code())]
| ^^^^^^
error: `code = "..."`/`code(...)` must contain only string literals
- --> $DIR/subdiagnostic-derive.rs:704:23
+ --> $DIR/subdiagnostic-derive.rs:706:23
|
LL | #[suggestion_part(code = 3)]
| ^^^^^^^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:746:60
+ --> $DIR/subdiagnostic-derive.rs:748:61
|
-LL | #[suggestion(parse_add_paren, code = "", style = "hidden", style = "normal")]
- | ^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
+ | ^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:746:42
+ --> $DIR/subdiagnostic-derive.rs:748:43
|
-LL | #[suggestion(parse_add_paren, code = "", style = "hidden", style = "normal")]
- | ^^^^^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
+ | ^^^^^^^^^^^^^^^^
error: `#[suggestion_hidden(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:755:1
+ --> $DIR/subdiagnostic-derive.rs:757:1
|
-LL | #[suggestion_hidden(parse_add_paren, code = "")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion_hidden(no_crate_example, code = "")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Use `#[suggestion(..., style = "hidden")]` instead
error: `#[suggestion_hidden(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:763:1
+ --> $DIR/subdiagnostic-derive.rs:765:1
|
-LL | #[suggestion_hidden(parse_add_paren, code = "", style = "normal")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Use `#[suggestion(..., style = "hidden")]` instead
error: invalid suggestion style
- --> $DIR/subdiagnostic-derive.rs:771:50
+ --> $DIR/subdiagnostic-derive.rs:773:51
|
-LL | #[suggestion(parse_add_paren, code = "", style = "foo")]
- | ^^^^^
+LL | #[suggestion(no_crate_example, code = "", style = "foo")]
+ | ^^^^^
|
= help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
error: `#[suggestion(style = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:779:42
+ --> $DIR/subdiagnostic-derive.rs:781:43
|
-LL | #[suggestion(parse_add_paren, code = "", style = 42)]
- | ^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "", style = 42)]
+ | ^^^^^^^^^^
error: `#[suggestion(style)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:787:42
+ --> $DIR/subdiagnostic-derive.rs:789:43
|
-LL | #[suggestion(parse_add_paren, code = "", style)]
- | ^^^^^
+LL | #[suggestion(no_crate_example, code = "", style)]
+ | ^^^^^
|
= help: a diagnostic slug must be the first argument to the attribute
error: `#[suggestion(style(...))]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:795:42
+ --> $DIR/subdiagnostic-derive.rs:797:43
|
-LL | #[suggestion(parse_add_paren, code = "", style("foo"))]
- | ^^^^^^^^^^^^
+LL | #[suggestion(no_crate_example, code = "", style("foo"))]
+ | ^^^^^^^^^^^^
+
+error: `#[primary_span]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:808:5
+ |
+LL | #[primary_span]
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: there must be exactly one primary span
+ = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
+
+error: suggestion without `#[primary_span]` field
+ --> $DIR/subdiagnostic-derive.rs:805:1
+ |
+LL | / #[suggestion(no_crate_example, code = "")]
+LL | |
+LL | | struct PrimarySpanOnVec {
+LL | | #[primary_span]
+... |
+LL | | sub: Vec<Span>,
+LL | | }
+ | |_^
error: cannot find attribute `foo` in this scope
- --> $DIR/subdiagnostic-derive.rs:63:3
+ --> $DIR/subdiagnostic-derive.rs:65:3
|
LL | #[foo]
| ^^^
error: cannot find attribute `foo` in this scope
- --> $DIR/subdiagnostic-derive.rs:159:3
+ --> $DIR/subdiagnostic-derive.rs:161:3
|
LL | #[foo]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:173:7
+ --> $DIR/subdiagnostic-derive.rs:175:7
|
LL | #[bar]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:185:7
+ --> $DIR/subdiagnostic-derive.rs:187:7
|
LL | #[bar = "..."]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:197:7
+ --> $DIR/subdiagnostic-derive.rs:199:7
|
LL | #[bar = 4]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:209:7
+ --> $DIR/subdiagnostic-derive.rs:211:7
|
LL | #[bar("...")]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:270:7
+ --> $DIR/subdiagnostic-derive.rs:272:7
|
LL | #[bar]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:281:7
+ --> $DIR/subdiagnostic-derive.rs:283:7
|
LL | #[bar = "..."]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:292:7
+ --> $DIR/subdiagnostic-derive.rs:294:7
|
LL | #[bar("...")]
| ^^^
-error[E0425]: cannot find value `slug` in module `rustc_errors::fluent`
- --> $DIR/subdiagnostic-derive.rs:122:9
+error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
+ --> $DIR/subdiagnostic-derive.rs:124:9
|
LL | #[label(slug)]
- | ^^^^ not found in `rustc_errors::fluent`
+ | ^^^^ not found in `crate::fluent_generated`
-error: aborting due to 79 previous errors
+error: aborting due to 81 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui-fulldeps/issue-15149.rs b/tests/ui-fulldeps/std/issue-15149.rs
index 064472f57..064472f57 100644
--- a/tests/ui-fulldeps/issue-15149.rs
+++ b/tests/ui-fulldeps/std/issue-15149.rs
diff --git a/tests/ui-fulldeps/issue-81357-unsound-file-methods.rs b/tests/ui-fulldeps/std/issue-81357-unsound-file-methods.rs
index fdf1150f8..fdf1150f8 100644
--- a/tests/ui-fulldeps/issue-81357-unsound-file-methods.rs
+++ b/tests/ui-fulldeps/std/issue-81357-unsound-file-methods.rs
diff --git a/tests/ui-fulldeps/stdio-from.rs b/tests/ui-fulldeps/std/stdio-from.rs
index fef9f27fc..fef9f27fc 100644
--- a/tests/ui-fulldeps/stdio-from.rs
+++ b/tests/ui-fulldeps/std/stdio-from.rs
diff --git a/tests/ui-fulldeps/switch-stdout.rs b/tests/ui-fulldeps/std/switch-stdout.rs
index e9501a809..e9501a809 100644
--- a/tests/ui-fulldeps/switch-stdout.rs
+++ b/tests/ui-fulldeps/std/switch-stdout.rs