mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rollup merge of #119888 - weiznich:stablize_diagnostic_namespace, r=compiler-errors
Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute This PR stabilizes the `#[diagnostic]` attribute namespace and a minimal option of the `#[diagnostic::on_unimplemented]` attribute. The `#[diagnostic]` attribute namespace is meant to provide a home for attributes that allow users to influence error messages emitted by the compiler. The compiler is not guaranteed to use any of this hints, however it should accept any (non-)existing attribute in this namespace and potentially emit lint-warnings for unused attributes and options. This is meant to allow discarding certain attributes/options in the future to allow fundamental changes to the compiler without the need to keep then non-meaningful options working. The `#[diagnostic::on_unimplemented]` attribute is allowed to appear on a trait definition. This allows crate authors to hint the compiler to emit a specific error message if a certain trait is not implemented. For the `#[diagnostic::on_unimplemented]` attribute the following options are implemented: * `message` which provides the text for the top level error message * `label` which provides the text for the label shown inline in the broken code in the error message * `note` which provides additional notes. The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Any other occurrence generates an lint warning. For any other non-existing option a lint-warning is generated. All three options accept a text as argument. This text is allowed to contain format parameters referring to generic argument or `Self` by name via the `{Self}` or `{NameOfGenericArgument}` syntax. For any non-existing argument a lint warning is generated. This allows to have a trait definition like: ```rust #[diagnostic::on_unimplemented( message = "My Message for `ImportantTrait<{A}>` is not implemented for `{Self}`", label = "My Label", note = "Note 1", note = "Note 2" )] trait ImportantTrait<A> {} ``` which then generates for the following code ```rust fn use_my_trait(_: impl ImportantTrait<i32>) {} fn main() { use_my_trait(String::new()); } ``` this error message: ``` error[E0277]: My Message for `ImportantTrait<i32>` is not implemented for `String` --> src/main.rs:14:18 | 14 | use_my_trait(String::new()); | ------------ ^^^^^^^^^^^^^ My Label | | | required by a bound introduced by this call | = help: the trait `ImportantTrait<i32>` is not implemented for `String` = note: Note 1 = note: Note 2 ``` [Playground with the unstable feature](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=05133acce8e1d163d481e97631f17536) Fixes #111996
This commit is contained in:
commit
b0d7f2bb0e
@ -206,14 +206,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
||||
);
|
||||
}
|
||||
}
|
||||
if !attr.is_doc_comment()
|
||||
&& let [seg, _] = attr.get_normal_item().path.segments.as_slice()
|
||||
&& seg.ident.name == sym::diagnostic
|
||||
&& !self.features.diagnostic_namespace
|
||||
{
|
||||
let msg = "`#[diagnostic]` attribute name space is experimental";
|
||||
gate!(self, diagnostic_namespace, seg.ident.span, msg);
|
||||
}
|
||||
|
||||
// Emit errors for non-staged-api crates.
|
||||
if !self.features.staged_api {
|
||||
|
@ -146,6 +146,8 @@ declare_features! (
|
||||
(accepted, derive_default_enum, "1.62.0", Some(86985)),
|
||||
/// Allows the use of destructuring assignments.
|
||||
(accepted, destructuring_assignment, "1.59.0", Some(71126)),
|
||||
/// Allows using the `#[diagnostic]` attribute tool namespace
|
||||
(accepted, diagnostic_namespace, "CURRENT_RUSTC_VERSION", Some(111996)),
|
||||
/// Allows `#[doc(alias = "...")]`.
|
||||
(accepted, doc_alias, "1.48.0", Some(50146)),
|
||||
/// Allows `..` in tuple (struct) patterns.
|
||||
|
@ -436,8 +436,6 @@ declare_features! (
|
||||
(unstable, deprecated_safe, "1.61.0", Some(94978)),
|
||||
/// Allows having using `suggestion` in the `#[deprecated]` attribute.
|
||||
(unstable, deprecated_suggestion, "1.61.0", Some(94785)),
|
||||
/// Allows using the `#[diagnostic]` attribute tool namespace
|
||||
(unstable, diagnostic_namespace, "1.73.0", Some(111996)),
|
||||
/// Controls errors in trait implementations.
|
||||
(unstable, do_not_recommend, "1.67.0", Some(51992)),
|
||||
/// Tells rustdoc to automatically generate `#[doc(cfg(...))]`.
|
||||
|
@ -202,6 +202,7 @@
|
||||
//
|
||||
// Language features:
|
||||
// tidy-alphabetical-start
|
||||
#![cfg_attr(bootstrap, feature(diagnostic_namespace))]
|
||||
#![cfg_attr(bootstrap, feature(platform_intrinsics))]
|
||||
#![feature(abi_unadjusted)]
|
||||
#![feature(adt_const_params)]
|
||||
@ -223,7 +224,6 @@
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(deprecated_suggestion)]
|
||||
#![feature(diagnostic_namespace)]
|
||||
#![feature(doc_cfg)]
|
||||
#![feature(doc_cfg_hide)]
|
||||
#![feature(doc_notable_trait)]
|
||||
|
@ -1,84 +0,0 @@
|
||||
# `diagnostic_namespace`
|
||||
|
||||
The tracking issue for this feature is: [#111996]
|
||||
|
||||
[#111996]: https://github.com/rust-lang/rust/issues/111996
|
||||
|
||||
------------------------
|
||||
|
||||
The `diagnostic_namespace` feature permits customization of compilation errors.
|
||||
|
||||
## diagnostic::on_unimplemented
|
||||
|
||||
With [#114452] support for `diagnostic::on_unimplemented` was added.
|
||||
|
||||
When used on a trait declaration, the following options are available:
|
||||
|
||||
* `message` to customize the primary error message
|
||||
* `note` to add a customized note message to an error message
|
||||
* `label` to customize the label part of the error message
|
||||
|
||||
The attribute will hint to the compiler to use these in error messages:
|
||||
```rust
|
||||
// some library
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(
|
||||
message = "cannot insert element",
|
||||
label = "cannot be put into a table",
|
||||
note = "see <link> for more information about the Table api"
|
||||
)]
|
||||
pub trait Element {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
```rust,compile_fail,E0277
|
||||
# #![feature(diagnostic_namespace)]
|
||||
#
|
||||
# #[diagnostic::on_unimplemented(
|
||||
# message = "cannot insert element",
|
||||
# label = "cannot be put into a table",
|
||||
# note = "see <link> for more information about the Table api"
|
||||
# )]
|
||||
# pub trait Element {
|
||||
# // ...
|
||||
# }
|
||||
# struct Table;
|
||||
# impl Table {
|
||||
# fn insert<T: Element>(&self, element: T) {
|
||||
# // ..
|
||||
# }
|
||||
# }
|
||||
# fn main() {
|
||||
# let table = Table;
|
||||
# let element = ();
|
||||
// user code
|
||||
table.insert(element);
|
||||
# }
|
||||
```
|
||||
|
||||
```text
|
||||
error[E0277]: cannot insert element
|
||||
--> src/main.rs:24:18
|
||||
|
|
||||
24 | table.insert(element);
|
||||
| ------ ^^^^^^^ cannot be put into a table
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= help: the trait `Element` is not implemented for `<type>`
|
||||
= note: see <link> for more information about the Table api
|
||||
note: required by a bound in `Table::insert`
|
||||
--> src/main.rs:15:18
|
||||
|
|
||||
15 | fn insert<T: Element>(&self, element: T) {
|
||||
| ^^^^^^^ required by this bound in `Table::insert`
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
```
|
||||
|
||||
See [RFC 3368] for more information.
|
||||
|
||||
[#114452]: https://github.com/rust-lang/rust/pull/114452
|
||||
[RFC 3368]: https://github.com/rust-lang/rfcs/blob/master/text/3368-diagnostic-attribute-namespace.md
|
@ -1,4 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
//@ check-pass
|
||||
//@ aux-build:proc-macro-helper.rs
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
#[diagnostic::non_existing_attribute]
|
||||
//~^ERROR `#[diagnostic]` attribute name space is experimental [E0658]
|
||||
//~|WARNING unknown diagnostic attribute [unknown_or_malformed_diagnostic_attributes]
|
||||
pub trait Bar {
|
||||
}
|
||||
|
||||
#[diagnostic::non_existing_attribute(with_option = "foo")]
|
||||
//~^ERROR `#[diagnostic]` attribute name space is experimental [E0658]
|
||||
//~|WARNING unknown diagnostic attribute [unknown_or_malformed_diagnostic_attributes]
|
||||
struct Foo;
|
||||
|
||||
fn main() {
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
error[E0658]: `#[diagnostic]` attribute name space is experimental
|
||||
--> $DIR/feature-gate-diagnostic_namespace.rs:1:3
|
||||
|
|
||||
LL | #[diagnostic::non_existing_attribute]
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
|
||||
= help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: `#[diagnostic]` attribute name space is experimental
|
||||
--> $DIR/feature-gate-diagnostic_namespace.rs:7:3
|
||||
|
|
||||
LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
|
||||
= help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
warning: unknown diagnostic attribute
|
||||
--> $DIR/feature-gate-diagnostic_namespace.rs:1:15
|
||||
|
|
||||
LL | #[diagnostic::non_existing_attribute]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
|
||||
|
||||
warning: unknown diagnostic attribute
|
||||
--> $DIR/feature-gate-diagnostic_namespace.rs:7:15
|
||||
|
|
||||
LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors; 2 warnings emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
@ -1,4 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
//@ check-pass
|
||||
#[diagnostic::non_existing_attribute]
|
||||
//~^WARN unknown diagnostic attribute
|
||||
|
@ -1,5 +1,5 @@
|
||||
warning: unknown diagnostic attribute
|
||||
--> $DIR/non_existing_attributes_accepted.rs:3:15
|
||||
--> $DIR/non_existing_attributes_accepted.rs:2:15
|
||||
|
|
||||
LL | #[diagnostic::non_existing_attribute]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -7,7 +7,7 @@ LL | #[diagnostic::non_existing_attribute]
|
||||
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
|
||||
|
||||
warning: unknown diagnostic attribute
|
||||
--> $DIR/non_existing_attributes_accepted.rs:8:15
|
||||
--> $DIR/non_existing_attributes_accepted.rs:7:15
|
||||
|
|
||||
LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(
|
||||
message = "Message",
|
||||
note = "Note",
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(
|
||||
on(_Self = "&str"),
|
||||
//~^WARN malformed `on_unimplemented` attribute
|
||||
|
@ -1,5 +1,5 @@
|
||||
warning: `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:24:1
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:22:1
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Not allowed to apply it on a impl")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -7,7 +7,7 @@ LL | #[diagnostic::on_unimplemented(message = "Not allowed to apply it on a impl
|
||||
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:4:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:2:5
|
||||
|
|
||||
LL | on(_Self = "&str"),
|
||||
| ^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -15,7 +15,7 @@ LL | on(_Self = "&str"),
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:10:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:8:5
|
||||
|
|
||||
LL | parent_label = "in this scope",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -23,7 +23,7 @@ LL | parent_label = "in this scope",
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:13:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:11:5
|
||||
|
|
||||
LL | append_const_msg
|
||||
| ^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -31,7 +31,7 @@ LL | append_const_msg
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:19:32
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:17:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented = "Message"]
|
||||
| ^^^^^^^^^^^ invalid option found here
|
||||
@ -39,7 +39,7 @@ LL | #[diagnostic::on_unimplemented = "Message"]
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: there is no parameter `from_desugaring` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -47,7 +47,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `direct` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -55,7 +55,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `cause` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -63,7 +63,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `integral` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -71,7 +71,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `integer` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -79,7 +79,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `float` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -87,7 +87,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `_Self` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -95,7 +95,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `crate_local` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -103,7 +103,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `Trait` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -111,7 +111,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: there is no parameter `ItemContext` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -119,7 +119,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:4:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:2:5
|
||||
|
|
||||
LL | on(_Self = "&str"),
|
||||
| ^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -128,7 +128,7 @@ LL | on(_Self = "&str"),
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:10:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:8:5
|
||||
|
|
||||
LL | parent_label = "in this scope",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -137,7 +137,7 @@ LL | parent_label = "in this scope",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:13:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:11:5
|
||||
|
|
||||
LL | append_const_msg
|
||||
| ^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -146,7 +146,7 @@ LL | append_const_msg
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: trait has `()` and `i32` as params
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:61:15
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:59:15
|
||||
|
|
||||
LL | takes_foo(());
|
||||
| --------- ^^ trait has `()` and `i32` as params
|
||||
@ -156,18 +156,18 @@ LL | takes_foo(());
|
||||
= help: the trait `Foo<i32>` is not implemented for `()`
|
||||
= note: trait has `()` and `i32` as params
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:17:1
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:15:1
|
||||
|
|
||||
LL | trait Foo<T> {}
|
||||
| ^^^^^^^^^^^^
|
||||
note: required by a bound in `takes_foo`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:56:22
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:54:22
|
||||
|
|
||||
LL | fn takes_foo(_: impl Foo<i32>) {}
|
||||
| ^^^^^^^^ required by this bound in `takes_foo`
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:19:32
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:17:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented = "Message"]
|
||||
| ^^^^^^^^^^^ invalid option found here
|
||||
@ -176,7 +176,7 @@ LL | #[diagnostic::on_unimplemented = "Message"]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: the trait bound `(): Bar` is not satisfied
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:63:15
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:61:15
|
||||
|
|
||||
LL | takes_bar(());
|
||||
| --------- ^^ the trait `Bar` is not implemented for `()`
|
||||
@ -185,13 +185,13 @@ LL | takes_bar(());
|
||||
|
|
||||
= help: the trait `Bar` is implemented for `i32`
|
||||
note: required by a bound in `takes_bar`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:57:22
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:55:22
|
||||
|
|
||||
LL | fn takes_bar(_: impl Bar) {}
|
||||
| ^^^ required by this bound in `takes_bar`
|
||||
|
||||
warning: there is no parameter `from_desugaring` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -200,7 +200,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `direct` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -209,7 +209,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `cause` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -218,7 +218,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `integral` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -227,7 +227,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `integer` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:31:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:29:5
|
||||
|
|
||||
LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -236,7 +236,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `float` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -245,7 +245,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `_Self` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -254,7 +254,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `crate_local` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -263,7 +263,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `Trait` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -272,7 +272,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: there is no parameter `ItemContext` on trait `Baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:42:5
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:40:5
|
||||
|
|
||||
LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -281,7 +281,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}"
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: {from_desugaring}{direct}{cause}{integral}{integer}
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:65:15
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:63:15
|
||||
|
|
||||
LL | takes_baz(());
|
||||
| --------- ^^ {float}{_Self}{crate_local}{Trait}{ItemContext}
|
||||
@ -290,12 +290,12 @@ LL | takes_baz(());
|
||||
|
|
||||
= help: the trait `Baz` is not implemented for `()`
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:54:1
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:52:1
|
||||
|
|
||||
LL | trait Baz {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `takes_baz`
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:58:22
|
||||
--> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:56:22
|
||||
|
|
||||
LL | fn takes_baz(_: impl Baz) {}
|
||||
| ^^^ required by this bound in `takes_baz`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(unsupported = "foo")]
|
||||
//~^WARN malformed `on_unimplemented` attribute
|
||||
//~|WARN malformed `on_unimplemented` attribute
|
||||
|
@ -1,5 +1,5 @@
|
||||
warning: `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:8:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:6:1
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Baz")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -7,7 +7,7 @@ LL | #[diagnostic::on_unimplemented(message = "Baz")]
|
||||
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:1:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
|
||||
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -15,7 +15,7 @@ LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:12:50
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:10:50
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
|
||||
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -23,7 +23,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:17:50
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:50
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -31,7 +31,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:22:32
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:20:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented = "boom"]
|
||||
| ^^^^^^^^ invalid option found here
|
||||
@ -39,7 +39,7 @@ LL | #[diagnostic::on_unimplemented = "boom"]
|
||||
= help: only `message`, `note` and `label` are allowed as options
|
||||
|
||||
warning: missing options for `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:26:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:24:1
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -47,7 +47,7 @@ LL | #[diagnostic::on_unimplemented]
|
||||
= help: at least one of the `message`, `note` and `label` options are expected
|
||||
|
||||
warning: there is no parameter `DoesNotExist` on trait `Test`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:31:32
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -55,7 +55,7 @@ LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
|
||||
= help: expect either a generic argument name or `{Self}` as format argument
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:1:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
|
||||
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -64,7 +64,7 @@ LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: the trait bound `i32: Foo` is not satisfied
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:43:14
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:41:14
|
||||
|
|
||||
LL | take_foo(1_i32);
|
||||
| -------- ^^^^^ the trait `Foo` is not implemented for `i32`
|
||||
@ -72,18 +72,18 @@ LL | take_foo(1_i32);
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:6:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:4:1
|
||||
|
|
||||
LL | trait Foo {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `take_foo`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:36:21
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:34:21
|
||||
|
|
||||
LL | fn take_foo(_: impl Foo) {}
|
||||
| ^^^ required by this bound in `take_foo`
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:12:50
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:10:50
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
|
||||
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -92,7 +92,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: Boom
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:45:14
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:43:14
|
||||
|
|
||||
LL | take_baz(1_i32);
|
||||
| -------- ^^^^^ the trait `Baz` is not implemented for `i32`
|
||||
@ -100,18 +100,18 @@ LL | take_baz(1_i32);
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:13:1
|
||||
|
|
||||
LL | trait Baz {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `take_baz`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:37:21
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:35:21
|
||||
|
|
||||
LL | fn take_baz(_: impl Baz) {}
|
||||
| ^^^ required by this bound in `take_baz`
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:17:50
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:50
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -120,7 +120,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: Boom
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:47:15
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:45:15
|
||||
|
|
||||
LL | take_boom(1_i32);
|
||||
| --------- ^^^^^ the trait `Boom` is not implemented for `i32`
|
||||
@ -128,18 +128,18 @@ LL | take_boom(1_i32);
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:20:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:18:1
|
||||
|
|
||||
LL | trait Boom {}
|
||||
| ^^^^^^^^^^
|
||||
note: required by a bound in `take_boom`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:38:22
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:36:22
|
||||
|
|
||||
LL | fn take_boom(_: impl Boom) {}
|
||||
| ^^^^ required by this bound in `take_boom`
|
||||
|
||||
warning: missing options for `on_unimplemented` attribute
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:26:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:24:1
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -148,7 +148,7 @@ LL | #[diagnostic::on_unimplemented]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: the trait bound `i32: Whatever` is not satisfied
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:49:19
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:47:19
|
||||
|
|
||||
LL | take_whatever(1_i32);
|
||||
| ------------- ^^^^^ the trait `Whatever` is not implemented for `i32`
|
||||
@ -156,18 +156,18 @@ LL | take_whatever(1_i32);
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:27:1
|
||||
|
|
||||
LL | trait Whatever {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
note: required by a bound in `take_whatever`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:39:26
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:37:26
|
||||
|
|
||||
LL | fn take_whatever(_: impl Whatever) {}
|
||||
| ^^^^^^^^ required by this bound in `take_whatever`
|
||||
|
||||
warning: there is no parameter `DoesNotExist` on trait `Test`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:31:32
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:32
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -176,7 +176,7 @@ LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: {DoesNotExist}
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:51:15
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:49:15
|
||||
|
|
||||
LL | take_test(());
|
||||
| --------- ^^ the trait `Test` is not implemented for `()`
|
||||
@ -184,12 +184,12 @@ LL | take_test(());
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:34:1
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:32:1
|
||||
|
|
||||
LL | trait Test {}
|
||||
| ^^^^^^^^^^
|
||||
note: required by a bound in `take_test`
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:40:22
|
||||
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:38:22
|
||||
|
|
||||
LL | fn take_test(_: impl Test) {}
|
||||
| ^^^^ required by this bound in `take_test`
|
||||
|
@ -1,7 +0,0 @@
|
||||
#[diagnostic::on_unimplemented(message = "Foo")]
|
||||
//~^ERROR `#[diagnostic]` attribute name space is experimental [E0658]
|
||||
pub trait Bar {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
error[E0658]: `#[diagnostic]` attribute name space is experimental
|
||||
--> $DIR/feature-gate-diagnostic_on_unimplemented.rs:1:3
|
||||
|
|
||||
LL | #[diagnostic::on_unimplemented(message = "Foo")]
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
|
||||
= help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(
|
||||
if(Self = "()"),
|
||||
//~^WARN malformed `on_unimplemented` attribute
|
||||
|
@ -1,5 +1,5 @@
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:4:5
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:2:5
|
||||
|
|
||||
LL | if(Self = "()"),
|
||||
| ^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -8,7 +8,7 @@ LL | if(Self = "()"),
|
||||
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
|
||||
|
||||
warning: `message` is ignored due to previous definition of `message`
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:10:32
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:8:32
|
||||
|
|
||||
LL | message = "custom message",
|
||||
| -------------------------- `message` is first declared here
|
||||
@ -17,7 +17,7 @@ LL | #[diagnostic::on_unimplemented(message = "fallback!!")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ `message` is already declared here
|
||||
|
||||
warning: malformed `on_unimplemented` attribute
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:4:5
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:2:5
|
||||
|
|
||||
LL | if(Self = "()"),
|
||||
| ^^^^^^^^^^^^^^^ invalid option found here
|
||||
@ -26,7 +26,7 @@ LL | if(Self = "()"),
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: `message` is ignored due to previous definition of `message`
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:10:32
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:8:32
|
||||
|
|
||||
LL | message = "custom message",
|
||||
| -------------------------- `message` is first declared here
|
||||
@ -37,7 +37,7 @@ LL | #[diagnostic::on_unimplemented(message = "fallback!!")]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: custom message
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:20:15
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:18:15
|
||||
|
|
||||
LL | takes_foo(());
|
||||
| --------- ^^ fallback label
|
||||
@ -48,12 +48,12 @@ LL | takes_foo(());
|
||||
= note: custom note
|
||||
= note: fallback note
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:15:1
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:13:1
|
||||
|
|
||||
LL | trait Foo {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `takes_foo`
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:17:22
|
||||
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:15:22
|
||||
|
|
||||
LL | fn takes_foo(_: impl Foo) {}
|
||||
| ^^^ required by this bound in `takes_foo`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(message = "Foo", label = "Bar", note = "Baz", note = "Boom")]
|
||||
trait Foo {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0277]: Foo
|
||||
--> $DIR/multiple_notes.rs:14:15
|
||||
--> $DIR/multiple_notes.rs:12:15
|
||||
|
|
||||
LL | takes_foo(());
|
||||
| --------- ^^ Bar
|
||||
@ -10,18 +10,18 @@ LL | takes_foo(());
|
||||
= note: Baz
|
||||
= note: Boom
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/multiple_notes.rs:4:1
|
||||
--> $DIR/multiple_notes.rs:2:1
|
||||
|
|
||||
LL | trait Foo {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `takes_foo`
|
||||
--> $DIR/multiple_notes.rs:10:22
|
||||
--> $DIR/multiple_notes.rs:8:22
|
||||
|
|
||||
LL | fn takes_foo(_: impl Foo) {}
|
||||
| ^^^ required by this bound in `takes_foo`
|
||||
|
||||
error[E0277]: Bar
|
||||
--> $DIR/multiple_notes.rs:16:15
|
||||
--> $DIR/multiple_notes.rs:14:15
|
||||
|
|
||||
LL | takes_bar(());
|
||||
| --------- ^^ Foo
|
||||
@ -32,12 +32,12 @@ LL | takes_bar(());
|
||||
= note: Baz
|
||||
= note: Baz2
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/multiple_notes.rs:8:1
|
||||
--> $DIR/multiple_notes.rs:6:1
|
||||
|
|
||||
LL | trait Bar {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `takes_bar`
|
||||
--> $DIR/multiple_notes.rs:11:22
|
||||
--> $DIR/multiple_notes.rs:9:22
|
||||
|
|
||||
LL | fn takes_bar(_: impl Bar) {}
|
||||
| ^^^ required by this bound in `takes_bar`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(message = "Foo", label = "Bar", note = "Baz")]
|
||||
trait Foo {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0277]: Foo
|
||||
--> $DIR/on_unimplemented_simple.rs:9:15
|
||||
--> $DIR/on_unimplemented_simple.rs:7:15
|
||||
|
|
||||
LL | takes_foo(());
|
||||
| --------- ^^ Bar
|
||||
@ -9,12 +9,12 @@ LL | takes_foo(());
|
||||
= help: the trait `Foo` is not implemented for `()`
|
||||
= note: Baz
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/on_unimplemented_simple.rs:4:1
|
||||
--> $DIR/on_unimplemented_simple.rs:2:1
|
||||
|
|
||||
LL | trait Foo {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `takes_foo`
|
||||
--> $DIR/on_unimplemented_simple.rs:6:22
|
||||
--> $DIR/on_unimplemented_simple.rs:4:22
|
||||
|
|
||||
LL | fn takes_foo(_: impl Foo) {}
|
||||
| ^^^ required by this bound in `takes_foo`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic::on_unimplemented(
|
||||
message = "first message",
|
||||
label = "first label",
|
||||
|
@ -1,5 +1,5 @@
|
||||
warning: `message` is ignored due to previous definition of `message`
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:9:5
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:7:5
|
||||
|
|
||||
LL | message = "first message",
|
||||
| ------------------------- `message` is first declared here
|
||||
@ -10,7 +10,7 @@ LL | message = "second message",
|
||||
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
|
||||
|
||||
warning: `label` is ignored due to previous definition of `label`
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:12:5
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:10:5
|
||||
|
|
||||
LL | label = "first label",
|
||||
| --------------------- `label` is first declared here
|
||||
@ -19,7 +19,7 @@ LL | label = "second label",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ `label` is already declared here
|
||||
|
||||
warning: `message` is ignored due to previous definition of `message`
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:9:5
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:7:5
|
||||
|
|
||||
LL | message = "first message",
|
||||
| ------------------------- `message` is first declared here
|
||||
@ -30,7 +30,7 @@ LL | message = "second message",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: `label` is ignored due to previous definition of `label`
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:12:5
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:10:5
|
||||
|
|
||||
LL | label = "first label",
|
||||
| --------------------- `label` is first declared here
|
||||
@ -41,7 +41,7 @@ LL | label = "second label",
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: first message
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:23:15
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:21:15
|
||||
|
|
||||
LL | takes_foo(());
|
||||
| --------- ^^ first label
|
||||
@ -52,12 +52,12 @@ LL | takes_foo(());
|
||||
= note: custom note
|
||||
= note: second note
|
||||
help: this trait has no implementations, consider adding one
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:17:1
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:15:1
|
||||
|
|
||||
LL | trait Foo {}
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `takes_foo`
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:20:22
|
||||
--> $DIR/report_warning_on_duplicated_options.rs:18:22
|
||||
|
|
||||
LL | fn takes_foo(_: impl Foo) {}
|
||||
| ^^^ required by this bound in `takes_foo`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(diagnostic_namespace)]
|
||||
|
||||
#[diagnostic]
|
||||
//~^ERROR cannot find attribute `diagnostic` in this scope
|
||||
pub struct Bar;
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: cannot find attribute `diagnostic` in this scope
|
||||
--> $DIR/requires_path.rs:3:3
|
||||
--> $DIR/requires_path.rs:1:3
|
||||
|
|
||||
LL | #[diagnostic]
|
||||
| ^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user