diff options
| author | Zack M. Davis <code@zackmdavis.net> | 2016-05-30 16:45:41 -0700 |
|---|---|---|
| committer | Zack M. Davis <code@zackmdavis.net> | 2016-05-30 16:45:41 -0700 |
| commit | 06ebda837e50634cd1a73d54ce36a6fdec9688c5 (patch) | |
| tree | 129b92a4ddd25f711c0c85b6870b8da64222f93c | |
| parent | a2b7dfa3493b146936547b0f4ca44cc9cd57dd95 (diff) | |
| download | rust-06ebda837e50634cd1a73d54ce36a6fdec9688c5.tar.gz rust-06ebda837e50634cd1a73d54ce36a6fdec9688c5.zip | |
revise explanation for E0429 (focus on error first)
| -rw-r--r-- | src/librustc_resolve/diagnostics.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 177a85709e4..88eee54852e 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1030,10 +1030,8 @@ struct Bar2; // ok! "##, E0429: r##" -To import a namespace itself in addition to some of its members, the `self` -keyword may appear in a brace-enclosed list as the last segment in a `use` -declaration. However, `self` cannot be used alone, without the brace -syntax. +The `self` keyword cannot appear alone as the last segment in a `use` +declaration. Example of erroneous code: @@ -1041,17 +1039,17 @@ Example of erroneous code: use std::fmt::self; // error: `self` imports are only allowed within a { } list ``` -If you only want to import the namespace, do so directly: +To use a namespace itself in addition to some of its members, `self` may appear +as part of a brace-enclosed list of imports: ``` -use std::fmt; +use std::fmt::{self, Debug}; ``` -If you also want to import members in the same statement, you may use the brace -syntax: +If you only want to import the namespace, do so directly: ``` -use std::fmt::{self, Debug}; +use std::fmt; ``` "##, |
