Skip to content

Commit 79009ed

Browse files
author
Alexander Regueiro
committed
Updated diagnostics.
1 parent 856e84f commit 79009ed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,17 +770,17 @@ match x {
770770
"##,
771771

772772
E0411: r##"
773-
The `Self` keyword was used outside an impl or a trait.
773+
The `Self` keyword was used outside an impl, trait, or type definition.
774774
775775
Erroneous code example:
776776
777777
```compile_fail,E0411
778-
<Self>::foo; // error: use of `Self` outside of an impl or trait
778+
<Self>::foo; // error: use of `Self` outside of an impl, trait, or type definition
779779
```
780780
781781
The `Self` keyword represents the current type, which explains why it can only
782-
be used inside an impl or a trait. It gives access to the associated items of a
783-
type:
782+
be used inside an impl, trait, or type definition. It gives access to the
783+
associated items of a type:
784784
785785
```
786786
trait Foo {

src/librustc_resolve/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,7 +2977,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
29772977
if is_self_type(path, ns) {
29782978
__diagnostic_used!(E0411);
29792979
err.code(DiagnosticId::Error("E0411".into()));
2980-
err.span_label(span, "`Self` is only available in traits and impls");
2980+
err.span_label(span, "`Self` is only available in traits, impls, and type definitions");
29812981
return (err, Vec::new());
29822982
}
29832983
if is_self_value(path, ns) {

0 commit comments

Comments
 (0)