Commit Graph

207 Commits

Author SHA1 Message Date
ggomez
b2fd882972 Add E0522 long error explanation 2016-03-14 22:29:57 +01:00
ggomez
a2e4ab2ab2 Forbid creation of lang item from user code 2016-03-15 15:49:08 +01:00
ggomez
1c8766761e Global error explanations improvements 2016-02-15 17:57:21 +01:00
Guillaume Gomez
ed6b575648 Update Makefile 2016-02-09 05:22:24 +01:00
Guillaume Gomez
6407b9405f Update long error explanations 2016-02-07 13:03:35 +01:00
ggomez
c78bf9d90c Add check for unused error codes 2016-01-29 16:37:02 +01:00
Oliver Schneider
c124deca7b move more checks out of librustc 2016-01-21 10:52:37 +01:00
bors
c14b615534 Auto merge of #30533 - nikomatsakis:fulfillment-tree, r=aturon
This PR introduces an `ObligationForest` data structure that the fulfillment context can use to track what's going on, instead of the current flat vector. This enables a number of improvements:

1. transactional support, at least for pushing new obligations
2. remove the "errors will be reported" hack -- instead, we only add types to the global cache once their entire subtree has been proven safe. Before, we never knew when this point was reached because we didn't track the subtree.
   - this in turn allows us to limit coinductive reasoning to structural traits, which sidesteps #29859
3. keeping the backtrace should allow for an improved error message, where we give the user full context
    - we can also remove chained obligation causes

This PR is not 100% complete. In particular:

- [x] Currently, types that embed themselves like `struct Foo { f: Foo }` give an overflow when evaluating whether `Foo: Sized`. This is not a very user-friendly error message, and this is a common beginner error. I plan to special-case this scenario, I think.
- [x] I should do some perf. measurements. (Update: 2% regression.)
- [x] More tests targeting #29859
- [ ] The transactional support is not fully integrated, though that should be easy enough.
- [ ] The error messages are not taking advantage of the backtrace.

I'd certainly like to do 1 through 3 before landing, but 4 and 5 could come as separate PRs.

r? @aturon // good way to learn more about this part of the trait system
f? @arielb1 // already knows this part of the trait system :)
2016-01-16 16:03:22 +00:00
Niko Matsakis
3046ac217f Detect cycles and specialize error reporting for Sized. It is important
to get the `Sized` error usable, since that hits new users
frequently. Further work is needed for the error reporting for non-Sized
cycle cases; those currently just fallback to the old path. Also adjust tests.
2016-01-16 05:22:32 -05:00
Oliver Schneider
1471d932a9 move const block checks before lowering step
this makes sure the checks run before typeck (which might use the constant or const
function to calculate an array length) and gives prettier error messages in case of for
loops and such (since they aren't expanded yet).
2016-01-15 13:16:54 +01:00
Steve Klabnik
ce49e3225e Expand EO308 to mention try!
Fixes #28953
2016-01-07 14:09:20 -05:00
bors
4744472fe0 Auto merge of #30264 - GuillaumeGomez:patch-5, r=Manishearth
r? @Manishearth

Also: should I merged both commits? Not sure if it's really useful to keep the first one.
2016-01-02 16:56:15 +00:00
bors
7d9543345c Auto merge of #28469 - DenisKolodin:master, r=steveklabnik 2015-12-31 18:57:27 +00:00
Jake Goulding
936149fc25 Remove rogue I 2015-12-16 13:25:46 -05:00
Denis Kolodin
50b43f6bd8 E0283 error explain 2015-12-14 23:25:43 +03:00
Guillaume Gomez
1671af1394 Add E0269 error explanation 2015-12-09 16:25:17 +01:00
Steve Klabnik
24a163344a Rollup merge of #30201 - GuillaumeGomez:patch-3, r=Manishearth
r? @Manishearth
2015-12-09 00:01:17 -05:00
Guillaume Gomez
467c668115 Unused error codes 2015-12-08 12:34:39 +01:00
Guillaume Gomez
1b984b501d Add E0264 error explanation 2015-12-07 15:56:36 +01:00
Alex Crichton
464cdff102 std: Stabilize APIs for the 1.6 release
This commit is the standard API stabilization commit for the 1.6 release cycle.
The list of issues and APIs below have all been through their cycle-long FCP and
the libs team decisions are listed below

Stabilized APIs

* `Read::read_exact`
* `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`)
* libcore -- this was a bit of a nuanced stabilization, the crate itself is now
  marked as `#[stable]` and the methods appearing via traits for primitives like
  `char` and `str` are now also marked as stable. Note that the extension traits
  themeselves are marked as unstable as they're imported via the prelude. The
  `try!` macro was also moved from the standard library into libcore to have the
  same interface. Otherwise the functions all have copied stability from the
  standard library now.
* The `#![no_std]` attribute
* `fs::DirBuilder`
* `fs::DirBuilder::new`
* `fs::DirBuilder::recursive`
* `fs::DirBuilder::create`
* `os::unix::fs::DirBuilderExt`
* `os::unix::fs::DirBuilderExt::mode`
* `vec::Drain`
* `vec::Vec::drain`
* `string::Drain`
* `string::String::drain`
* `vec_deque::Drain`
* `vec_deque::VecDeque::drain`
* `collections::hash_map::Drain`
* `collections::hash_map::HashMap::drain`
* `collections::hash_set::Drain`
* `collections::hash_set::HashSet::drain`
* `collections::binary_heap::Drain`
* `collections::binary_heap::BinaryHeap::drain`
* `Vec::extend_from_slice` (renamed from `push_all`)
* `Mutex::get_mut`
* `Mutex::into_inner`
* `RwLock::get_mut`
* `RwLock::into_inner`
* `Iterator::min_by_key` (renamed from `min_by`)
* `Iterator::max_by_key` (renamed from `max_by`)

Deprecated APIs

* `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`)
* `OsString::from_bytes`
* `OsStr::to_cstring`
* `OsStr::to_bytes`
* `fs::walk_dir` and `fs::WalkDir`
* `path::Components::peek`
* `slice::bytes::MutableByteVector`
* `slice::bytes::copy_memory`
* `Vec::push_all` (renamed to `extend_from_slice`)
* `Duration::span`
* `IpAddr`
* `SocketAddr::ip`
* `Read::tee`
* `io::Tee`
* `Write::broadcast`
* `io::Broadcast`
* `Iterator::min_by` (renamed to `min_by_key`)
* `Iterator::max_by` (renamed to `max_by_key`)
* `net::lookup_addr`

New APIs (still unstable)

* `<[T]>::sort_by_key` (added to mirror `min_by_key`)

Closes #27585
Closes #27704
Closes #27707
Closes #27710
Closes #27711
Closes #27727
Closes #27740
Closes #27744
Closes #27799
Closes #27801
cc #27801 (doesn't close as `Chars` is still unstable)
Closes #28968
2015-12-05 15:09:44 -08:00
Guillaume Gomez
67eaa9e327 Add E0452 error explanation 2015-12-04 13:19:35 +01:00
Guillaume Gomez
e10fe2ed99 Add E0400 error explanation 2015-12-03 17:33:42 +01:00
Guillaume Gomez
1099af732d Reword E0492 2015-11-30 11:13:37 +01:00
Guillaume Gomez
483656b606 Add E0492 error explanation 2015-11-29 01:23:24 +01:00
Guillaume Gomez
1904b333eb Add E0498 error explanation 2015-11-28 06:19:47 +01:00
Ariel Ben-Yehuda
0a8bb4c509 split the metadata code into rustc_metadata
tests & rustdoc still broken
2015-11-26 18:22:40 +02:00
Ariel Ben-Yehuda
1430a35000 move librustc/plugin to librustc_plugin
this is a [breaking-change] to all plugin authors - sorry
2015-11-26 18:22:39 +02:00
bors
e24fffef8a Auto merge of #29716 - Manishearth:repr-error, r=Gankro
r? @Gankro
2015-11-22 08:43:22 +00:00
Manish Goregaokar
bef93557e5 Improve transmute diagnostics with a note about destructors
fixes #29922
2015-11-22 10:26:50 +05:30
Manish Goregaokar
92df8a9a99 Add E0517, E0518 for repr() errors 2015-11-20 21:23:58 +05:30
Guillaume Gomez
df7d3b916d Add error explanation for E0496 2015-10-06 18:04:09 +02:00
Ariel Ben-Yehuda
9699adc508 store the rustc version in metadata and check it
This prevents ICEs when old crates are used with a new version of
rustc. Currently, the linking of crates compiled with different
versions of rustc is completely unsupported.

Fixes #28700
2015-09-29 21:27:08 +03:00
Manish Goregaokar
dcf49b5f68 Don't recommend const fns on a stable build without a note about nightlies
Fixes #28490
2015-09-20 07:12:36 +05:30
bors
8dfb89067a Auto merge of #28353 - GuillaumeGomez:error_codes, r=Manishearth
r? @Manishearth 

This is a work in progress.
2015-09-16 08:51:30 +00:00
Guillaume Gomez
e6f6da119e End of adding error codes in librustc 2015-09-16 08:44:29 +02:00
Ariel Ben-Yehuda
5d4455510a ensure projections are prohibited when type parameters are
Technically a [breaking-change], but the broken code is useless,
like `i32<Param=()>`.

Fixes #24682
2015-09-13 23:47:41 +03:00
Guillaume Gomez
7358a5e8ea Add part of new error codes in librustc 2015-09-13 00:38:36 +02:00
Guillaume Gomez
771ab35c3d Add erroneous code example for E0010 2015-09-05 11:23:50 +02:00
Guillaume Gomez
ec4ba272b0 Add span_help for E0002 2015-09-04 18:09:16 +02:00
Alisdair Owens
9ed30c6214 add diagnostics for E0281 2015-08-29 16:50:35 +01:00
Steve Klabnik
c4847a11da Rollup merge of #27988 - nagisa:diags-e0139, r=brson
Fixes #27946
2015-08-25 09:43:07 -04:00
Simonas Kazlauskas
067ad9928f Fix E0139 code
Fixes #27946
2015-08-25 01:44:18 +03:00
Tshepang Lekhonkhobe
2c899ffe13 doc: improve E0133 explanation 2015-08-19 19:47:01 +02:00
Ariel Ben-Yehuda
5f3c1412ad use VariantDef instead of struct_fields 2015-08-06 16:54:40 +03:00
Manish Goregaokar
c9a34d2092 Rollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnik
r? @steveklabnik
2015-07-30 01:43:53 +05:30
Simonas Kazlauskas
91397a6aa3 Replace occurences of illegal in user facing docs 2015-07-28 17:55:44 +03:00
bors
0469be1eb7 Auto merge of #26876 - liigo:patch-3, r=Gankro 2015-07-27 04:20:27 +00:00
Manish Goregaokar
c5889358f2 Address comments 2015-07-25 00:04:11 +05:30
Manish Goregaokar
522a9785e4 Add long diagnostic for E0276 2015-07-25 00:04:11 +05:30
Manish Goregaokar
b5317761b8 Add long diagnostic explanation for E0275 2015-07-25 00:04:11 +05:30