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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extern crate rustc_fluent_macro;
extern crate rustc_macros;
extern crate rustc_session;
extern crate rustc_span;
extern crate core;

use rustc_errors::{Applicability, DiagMessage, SubdiagMessage};
use rustc_macros::{Diagnostic, Subdiagnostic};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `NotIntoDiagArg: IntoDiagArg` is not satisfied
--> $DIR/diagnostic-derive-doc-comment-field.rs:36:10
--> $DIR/diagnostic-derive-doc-comment-field.rs:37:10
|
LL | #[derive(Diagnostic)]
| ---------- required by a bound introduced by this call
Expand All @@ -8,7 +8,7 @@ LL | arg: NotIntoDiagArg,
| ^^^^^^^^^^^^^^ unsatisfied trait bound
|
help: the nightly-only, unstable trait `IntoDiagArg` is not implemented for `NotIntoDiagArg`
--> $DIR/diagnostic-derive-doc-comment-field.rs:28:1
--> $DIR/diagnostic-derive-doc-comment-field.rs:29:1
|
LL | struct NotIntoDiagArg;
| ^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -21,7 +21,7 @@ note: required by a bound in `Diag::<'a, G>::arg`
= note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `NotIntoDiagArg: IntoDiagArg` is not satisfied
--> $DIR/diagnostic-derive-doc-comment-field.rs:46:10
--> $DIR/diagnostic-derive-doc-comment-field.rs:47:10
|
LL | #[derive(Subdiagnostic)]
| ------------- required by a bound introduced by this call
Expand All @@ -30,7 +30,7 @@ LL | arg: NotIntoDiagArg,
| ^^^^^^^^^^^^^^ unsatisfied trait bound
|
help: the nightly-only, unstable trait `IntoDiagArg` is not implemented for `NotIntoDiagArg`
--> $DIR/diagnostic-derive-doc-comment-field.rs:28:1
--> $DIR/diagnostic-derive-doc-comment-field.rs:29:1
|
LL | struct NotIntoDiagArg;
| ^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 5 additions & 3 deletions tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ use rustc_errors::{Applicability, DiagMessage, ErrCode, MultiSpan, SubdiagMessag

extern crate rustc_session;

extern crate core;

rustc_fluent_macro::fluent_messages! { "./example.ftl" }

// E0123 and E0456 are no longer used, so we define our own constants here just for this test.
Expand Down Expand Up @@ -56,7 +58,7 @@ enum DiagnosticOnEnum {
#[derive(Diagnostic)]
#[diag(no_crate_example, code = E0123)]
#[diag = "E0123"]
//~^ ERROR failed to resolve: you might be missing crate `core`
//~^ ERROR expected parentheses: #[diag(...)]
struct WrongStructAttrStyle {}

#[derive(Diagnostic)]
Expand Down Expand Up @@ -801,15 +803,15 @@ struct SuggestionsNoItem {
struct SuggestionsInvalidItem {
#[suggestion(code(foo))]
//~^ ERROR `code(...)` must contain only string literals
//~| ERROR failed to resolve: you might be missing crate `core`
//~| ERROR unexpected token, expected `)`
sub: Span,
}

#[derive(Diagnostic)] //~ ERROR cannot find value `__code_34` in this scope
#[diag(no_crate_example)]
struct SuggestionsInvalidLiteral {
#[suggestion(code = 3)]
//~^ ERROR failed to resolve: you might be missing crate `core`
//~^ ERROR expected string literal
sub: Span,
}

Expand Down
Loading
Loading