Skip to content

Rollup of 5 pull requests #25357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
May 13, 2015
Merged
Changes from 8 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
51a1e83
doc: Remove mention of 30 minute intro
brson May 8, 2015
9b3d315
std: Update crate docs
brson May 8, 2015
7d9e605
Add error explanation for E0317.
meqif May 10, 2015
c0412bc
Fix documentation URL in diagnostic message.
meqif May 10, 2015
f3a3684
Add error explanation for E0154.
meqif May 10, 2015
e7fa00a
Add error explanation for E0259.
meqif May 10, 2015
60ec4ab
Add error explanation for E0260.
meqif May 10, 2015
bff1707
Fixed one textual mistake and one casing error.
michal-czardybon May 8, 2015
ef03055
Improve wording in error explanation.
meqif May 11, 2015
aa529ef
Add missing keyword in `extern crate` declarations.
meqif May 11, 2015
f6119f1
Update rust-installer
brson May 11, 2015
d13f765
Make mention of `if` more generic
frewsxcv May 12, 2015
93c21c7
Correct claims about &T's Copyness.
Ms2ger May 12, 2015
a5cac55
Add wait and waitpid to libc.
mfs May 12, 2015
1d1570a
Add regression test for #18075
jooert May 11, 2015
23300a3
Add regression test for #20413
jooert May 12, 2015
6faa8d6
Add a link to the error index to the main doc page.
michaelsproul May 12, 2015
e780fb2
TRPL: Borrow and AsRef
steveklabnik Apr 30, 2015
a22b327
book: typo fixes, wording improvements.
wheals May 12, 2015
393a37e
Correct various small points, expand some sections, while avoiding
nikomatsakis May 12, 2015
6f3701d
readme: Rework the arch support matrix
richo May 12, 2015
3ca008d
Auto merge of #25316 - brson:installer, r=alexcrichton
bors May 12, 2015
12dc6ee
Rollup merge of #24996 - steveklabnik:gh24163, r=aturon
Manishearth May 12, 2015
bea12a9
Rollup merge of #25220 - brson:doc1, r=steveklabnik
Manishearth May 12, 2015
e91d272
Rollup merge of #25221 - michal-czardybon:master, r=steveklabnik
Manishearth May 12, 2015
bb15c47
Rollup merge of #25267 - meqif:explain_e0317, r=alexcrichton
Manishearth May 12, 2015
e216057
Rollup merge of #25322 - frewsxcv:patch-23, r=steveklabnik
Manishearth May 12, 2015
78cf0f8
Rollup merge of #25327 - Ms2ger:copy-ref, r=pnkfelix
Manishearth May 12, 2015
866991e
Rollup merge of #25329 - jooert:tests, r=alexcrichton
Manishearth May 12, 2015
210f4b9
Rollup merge of #25330 - mfs:add-wait-waitpid, r=alexcrichton
Manishearth May 12, 2015
3981481
Rollup merge of #25331 - michaelsproul:err-idx-doc-link, r=Manishearth
Manishearth May 12, 2015
2581565
Rollup merge of #25335 - nikomatsakis:updates-to-reference-manual, r=…
Manishearth May 12, 2015
6ebba71
doc: Address feedback
brson May 12, 2015
0ad15bb
TRPL: release channels
steveklabnik May 7, 2015
9a3e98b
TRPL: Drop
steveklabnik May 11, 2015
c2b30b8
Auto merge of #25340 - Manishearth:rollup, r=Manishearth
bors May 12, 2015
fc6372e
TRPL: Rust inside other languages
steveklabnik May 12, 2015
2ba6169
TRPL: dining philosophers
steveklabnik May 11, 2015
3dee0df
Rollup merge of #25224 - brson:stddoc, r=steveklabnik
steveklabnik May 13, 2015
fe8a4e3
Rollup merge of #25317 - steveklabnik:trpl_drop, r=alexcrichton
steveklabnik May 13, 2015
7964d4e
Rollup merge of #25321 - steveklabnik:second_tutorial, r=alexcrichton
steveklabnik May 13, 2015
e8c69e5
Rollup merge of #25324 - richo:richo-compat, r=huonw
steveklabnik May 13, 2015
dd11c7f
Rollup merge of #25348 - geofft:trpl-fix-enums, r=steveklabnik
steveklabnik May 13, 2015
f26a2a6
Merge branch 'doc_release_channels' into rollup
steveklabnik May 13, 2015
704fb9c
Merge branch 'doc-fixes' of https://github.com/wheals/rust into rollup
steveklabnik May 13, 2015
11f945c
Merge branch 'trpl_embedding' into rollup
steveklabnik May 13, 2015
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
108 changes: 104 additions & 4 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,111 @@

#![allow(non_snake_case)]

// Error messages for EXXXX errors.
// Each message should start and end with a new line, and be wrapped to 80 characters.
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
register_long_diagnostics! {

E0154: r##"
Imports (`use` statements) are not allowed after non-item statements, such as
variable declarations and expression statements.

Here is an example that demonstrates the error:
```
fn f() {
// Variable declaration before import
let x = 0;
use std::io::Read;
...
}
```

The solution is to declare the imports at the top of the block, function, or
file.

Here is the previous example again, with the correct order:
```
fn f() {
use std::io::Read;
let x = 0;
...
}
```

See the Declaration Statements section of the reference for more information
about what constitutes an Item declaration and what does not:

http://doc.rust-lang.org/reference.html#statements
"##,

E0259: r##"
The name chosen for an external crate conflicts with another external crate that
has been imported into the current module.

Wrong example:
```
extern crate a;
extern crate crate_a as a;
```

The solution is to choose a different name that doesn't conflict with any
external crate imported into the current module.

Correct example:
```
extern crate a;
extern crate crate_a as other_name;
```
"##,

E0260: r##"
The name for an item declaration conflicts with an external crate's name.

For instance,
```
extern crate abc;

struct abc;
```

There are two possible solutions:

Solution #1: Rename the item.

```
extern crate abc;

struct xyz;
```

Solution #2: Import the crate with a different name.

```
extern crate abc as xyz;

struct abc;
```

See the Declaration Statements section of the reference for more information
about what constitutes an Item declaration and what does not:

http://doc.rust-lang.org/reference.html#statements
"##,

E0317: r##"
User-defined types or type parameters cannot shadow the primitive types.
This error indicates you tried to define a type, struct or enum with the same
name as an existing primitive type.

See the Types section of the reference for more information about the primitive
types:

http://doc.rust-lang.org/reference.html#types
"##

}

register_diagnostics! {
E0154,
E0157,
E0153,
E0251, // a named type or value has already been imported in this module
Expand All @@ -22,9 +125,6 @@ register_diagnostics! {
E0256, // import conflicts with type in this module
E0257, // inherent implementations are only allowed on types defined in the current module
E0258, // import conflicts with existing submodule
E0259, // an extern crate has already been imported into this module
E0260, // name conflicts with an external crate that has been imported into this module
E0317, // user-defined types or type parameters cannot shadow the primitive types
E0364, // item is private
E0365 // item is private
}