114 Commits

Author SHA1 Message Date
Nick Hamann
fdf3ce76cf Change E0015 and E0378 explanations to link to text of RFC 911, not rfc PR. 2015-05-28 21:12:46 -05:00
Nick Hamann
364035497c Revise E0015 according to feedback. 2015-05-28 21:02:13 -05:00
Nick Hamann
7e78e708fb Convert mutable statics error to have error code and add explanation.
Also changes 'owned pointers' => 'boxes' in the error message.
2015-05-28 19:28:07 -05:00
Nick Hamann
eb15030dc1 Add error explanations for E0040, E0087, E0378, E0379, E0394. 2015-05-28 17:54:19 -05:00
Nick Hamann
f6074406db Update E0015 explanation, fix E0053. 2015-05-28 17:54:13 -05:00
bors
a5a5fcee38 Auto merge of #25834 - steveklabnik:gh25326, r=alexcrichton
Fixes #25326
2015-05-28 13:57:36 +00:00
Ariel Ben-Yehuda
080311d1f9 Prevent comparison and dereferencing of raw pointers in constexprs
Fixes #25826.
2015-05-28 03:22:44 +03:00
Steve Klabnik
62e5dee1c5 fix example for E0018
Fixes #25326
2015-05-27 14:51:58 -04:00
Nick Hamann
570a043576 Convert 15 diagnostics to have error codes (E0380-E0394).
Also adds explanations for E0380 and E0381.
2015-05-26 15:12:52 -05:00
Nick Hamann
b593359f7f Add error explanations for E0055, E0089, E0192, E0261, E0262, E0263, E0318. 2015-05-26 15:12:52 -05:00
Niko Matsakis
df93deab10 Make various fixes:
- add feature gate
- add basic tests
- adjust parser to eliminate conflict between `const fn` and associated
constants
- allow `const fn` in traits/trait-impls, but forbid later in type check
- correct some merge conflicts
2015-05-21 11:47:30 -04:00
Ariel Ben-Yehuda
83acebc462 Overhaul cast semantics and make them follow RFC401
This should hopefully fix all cast-related ICEs once and for all.

I managed to make diagnostics hate me and give me spurious "decoder error"
 - removing $build/tmp/extended-errors seems to fix it.
2015-05-19 17:42:14 +03:00
Ricardo Martins
06b084fc9f Markdown formatting for error explanations. 2015-05-13 12:12:19 +01:00
Nick Cameron
5d4cce6cec Rebasing 2015-05-13 14:35:53 +12:00
Nick Cameron
843db01bd9 eddyb's changes for DST coercions
+ lots of rebasing
2015-05-13 14:19:51 +12:00
Michael Sproul
6faa8d6793 Add a link to the error index to the main doc page.
I also capitalised "The Standard Library" and neatened a few bits of grammar.

Also fixed: `#[main]` inside one of the error descriptions.
2015-05-12 21:21:26 +10:00
Michael Sproul
ce7ef32982 Markdown formatting for error explanations. 2015-05-11 23:04:31 +10:00
Nick Hamann
f736468c06 Add long diagnostic for E0137 2015-05-09 13:56:18 -05:00
Guillaume Gomez
30f88c841b Use of @pnkfelix code and fix typos 2015-05-09 17:54:53 +02:00
Steve Klabnik
74d24ad6af Rollup merge of #24966 - ruud-v-a:explain, r=pnkfelix
The error message was misleading, so I adjusted it, and I also added the long diagnostics for this error (resolves one point in #24407).

I was unsure about how to phrase the error message. Is “generic parameter binding” the correct term for this?
2015-05-07 12:21:01 +02:00
Steve Klabnik
52174305a0 Rollup merge of #24576 - cactorium:errorcodes, r=pnkfelix
For https://github.com/rust-lang/rust/issues/24407
2015-05-07 12:21:01 +02:00
Kelvin Ly
4174aa40f4 Reword with pnkfelix's suggestion 2015-05-06 05:43:05 -04:00
Michael Sproul
68f5c8475a Markdown edits for diagnostic errors. 2015-05-05 21:38:06 +10:00
bors
e962870420 Auto merge of #24975 - michaelsproul:enum-diagnostics, r=pnkfelix
Explanations for E0079, E0080, E0081, E0082, E0083 and E0084 as part of #24407.

All the errors concern the use of `#[repr(X)]` with enum types.

I also updated the short description for E0079 so that it takes sign into account.
2015-04-30 18:59:11 +00:00
bors
f9ecc6e888 Auto merge of #24892 - robinst:issue-24407-E0010, r=pnkfelix
Part of #24407.
2015-04-30 12:01:44 +00:00
Michael Sproul
63e63218a1 Add long diagnostics for enum repr errors. 2015-04-30 20:24:30 +10:00
Ruud van Asseldonk
414dfb13df rustc: Improve long diagnostics for E0282
The new example uses a `char` iterator instead of `i32`, to avoid interplay
between type inference and the default type for integer literals.
2015-04-30 11:51:40 +02:00
bors
ac5f595d0a Auto merge of #24884 - michaelsproul:extended-errors, r=nrc
I've been working on improving the diagnostic registration system so that it can:

* Check uniqueness of error codes *across the whole compiler*. The current method using `errorck.py` is prone to failure as it relies on simple text search - I found that it breaks when referencing an error's ident within a string (e.g. `"See also E0303"`).
* Provide JSON output of error metadata, to eventually facilitate HTML output, as well as tracking of which errors need descriptions. The current schema is:

```
<error code>: {
    "description": <long description>,
    "use_site": {
        "filename": <filename where error is used>,
        "line": <line in file where error is used>
    }
}
```

[Here's][metadata-dump] a pretty-printed sample dump for `librustc`.

One thing to note is that I had to move the diagnostics arrays out of the diagnostics modules. I really wanted to be able to capture error usage information, which only becomes available as a crate is compiled. Hence all invocations of `__build_diagnostics_array!` have been moved to the ends of their respective `lib.rs` files. I tried to avoid moving the array by making a plugin that expands to nothing but couldn't invoke it in item position and gave up on hackily generating a fake item. I also briefly considered using a lint, but it seemed like it would impossible to get access to the data stored in the thread-local storage.

The next step will be to generate a web page that lists each error with its rendered description and use site. Simple mapping and filtering of the metadata files also allows us to work out which error numbers are absent, which errors are unused and which need descriptions.

[metadata-dump]: https://gist.github.com/michaelsproul/3246846ff1bea71bd049
2015-04-30 02:03:27 +00:00
Robin Stocker
95ad630187 Add error explanation for E0010 2015-04-30 11:21:04 +10:00
Michael Sproul
d27230bb6d Add metadata output to the diagnostics system.
Diagnostic errors are now checked for uniqueness across the compiler and
error metadata is written to JSON files.
2015-04-30 08:59:53 +10:00
Ruud van Asseldonk
6b292cd4c4 rustc: Add long diagnostics for E0282 2015-04-30 00:58:43 +02:00
Alex Crichton
4ff558cdba rollup merge of #24894: bguiz/diagnostic-E0267
This error indicates that a constant references itself.
All constants need to resolve to a value in an acyclic manner.

For example, neither of the following can be sensibly compiled:

```
const X: u32 = X;
```

```
const X: u32 = Y;
const Y: u32 = X;
```
2015-04-29 15:45:43 -07:00
Robin Stocker
6cdb57d4b6 Add error explanation for E0013 2015-04-28 20:46:24 +10:00
Brendan Graetz
1335be33e4 =BG= change definition to use 'statics' as well as 'constants' 2015-04-28 20:22:26 +10:00
Brendan Graetz
8933253f2b =BG= Add detailed error message for E0265
This error indicates that a constant references itself.
All constants need to resolve to a value in an acyclic manner.

For example, neither of the following can be sensibly compiled:

```
const X: u32 = X;
```

```
const X: u32 = Y;
const Y: u32 = X;
```
2015-04-28 20:09:38 +10:00
Manish Goregaokar
50833a3f83 Rollup merge of #24523 - GuillaumeGomez:clean-error-codes, r=Manishearth 2015-04-24 19:21:12 +05:30
Guillaume Gomez
2ddc8f5eb5 Update diagnostics.rs 2015-04-23 18:43:58 +02:00
Steve Klabnik
9cc0af8d69 Refocus unsafe code chapter on unsafe itself. 2015-04-21 08:28:06 -04:00
bors
fe11393172 Auto merge of #24525 - GuillaumeGomez:check-const, r=pnkfelix
Part of #24407.
2015-04-20 10:26:17 +00:00
Guillaume Gomez
737005a110 Fix typos 2015-04-20 12:01:56 +02:00
Guillaume Gomez
8a6980c553 Add long explanation for E0018 2015-04-20 00:49:53 +02:00
Kelvin Ly
4420f31808 Fix trailing whitespaces 2015-04-19 01:59:29 -04:00
Kelvin Ly
99d2552c4e Fix typo 2015-04-18 20:25:24 -04:00
Ricardo Martins
5c7a0ba06e Add long diagnostics for E0133. 2015-04-19 00:36:59 +01:00
Guillaume Gomez
1d7d0192d2 Add backquotes to have better looking rust code 2015-04-19 00:01:58 +02:00
Kelvin Ly
d6227dcd6e Added error explanations for E0308, E0309, and E0310 2015-04-18 08:28:49 -04:00
Guillaume Gomez
50f75f3e2a Add long diagnostics for "bind by-ref and by-move" 2015-04-18 08:45:50 +10:00
Nick Hamann
017bc44712 Add long diagnostics for E0015 2015-04-18 08:41:20 +10:00
Nick Hamann
22ce069c7e Add long diagnostics for E0020 2015-04-18 08:40:57 +10:00
Michael Sproul
6d2b6d5a19 Enforce 80 char lines in extended errors. 2015-04-17 21:35:24 +10:00