Commit Graph

56152 Commits

Author SHA1 Message Date
Nick Cameron
5aa89d8bf6 Remove the Option and bool impls for carrier and add a dummy impl
The dummy impl should ensure the same type checking behaviour as having other (real) Carrier impls.
2016-08-19 13:31:55 +12:00
Michael Layne
39f318bb4d
Update error format for E0232 2016-08-18 15:31:34 -07:00
Jonathan Turner
ffbb8600fb Add workaround to detect correct compiler version 2016-08-18 15:22:23 -07:00
Matthew Piziak
6c66eaa035 replace AddAssign example with something more evocative of addition
This is analogous to PR #35709 for the `Add` trait.
2016-08-18 16:58:38 -04:00
Matthew Piziak
a516dbb7d9 note that calling drop() explicitly is a compiler error
Part of #29365

explain that std::mem::drop in prelude will invoke Drop

change "prelude" -> "the prelude"; change links to reference-style

move link references to links' section
2016-08-18 16:31:32 -04:00
pliniker
161cb36159 Update error message for E0084 2016-08-18 16:27:33 -04:00
Nick Cameron
301401e568 Redirect 2016-08-19 08:20:06 +12:00
Matthew Piziak
469b7fd1c0 split example into three sections with explanation 2016-08-18 16:12:40 -04:00
Matthew Piziak
9563f14eb5 demonstrate RHS != Self use cases for Mul and Div
Vector-scalar multipication is a good usecase for this. Thanks #rust!
2016-08-18 16:04:53 -04:00
Andrew Cantino
06302cb983 Fix minor typo 2016-08-18 15:06:05 -04:00
Steven Allen
de91872a33 Add a FusedIterator trait.
This trait can be used to avoid the overhead of a fuse wrapper when an iterator
is already well-behaved.

Conforming to: RFC 1581
Closes: #35602
2016-08-18 12:16:29 -04:00
bors
499484f56d Auto merge of #35684 - nikomatsakis:incr-comp-metadata-audit-35111, r=mw
Restructure metadata encoder to track deps precisely

This issue restructures meta-data encoding to track dependencies very precisely. It uses a cute technique I hope to spread elsewhere, where we can guard the data flowing into a new dep-graph task and ensure that it is not "leaking" information from the outside, which would result in missing edges. There are no tests because we don't know of any bugs in the old system, but it's clear that there was leaked data.

The commit series is standalone, but the refactorings are kind of "windy". It's a good idea to read the comment in `src/librustc_metadata/index_builder.rs` to get a feeling for the overall strategy I was aiming at.

In several cases, I wound up adding some extra hashtable lookups, I think primarily for looking up `AdtDef` instances. We could remove these by implementing `DepGraphRead` for an `AdtDef` and then having it register a read to the adt-defs table, I guess, but I doubt it is really noticeable.

Eventually I think I'd like to extend this pattern to the dep-graph more generally, since it effectively guarantees that data cannot leak.

Fixes #35111.

r? @michaelwoerister
2016-08-18 08:54:10 -07:00
Corey Farwell
c2b6f72114 Add a few doc examples for std::ffi::OsStr.
* `std::ffi::OsStr::new`.
* `std::ffi::OsStr::is_empty`.
* `std::ffi::OsStr::len`.
2016-08-18 10:34:54 -04:00
bors
43c090ed69 Auto merge of #35732 - jonathandturner:region_error_labels, r=nikomatsakis
Move 'doesn't live long enough' errors to labels

This patch moves the "doesn't live long enough" region-style errors to instead use labels.

An example follows.

Before:

```
error: `x` does not live long enough
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:26:18
   |
26 |         let y = &x;
   |                  ^
   |
note: reference must be valid for the block at 23:10...
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:23:11
   |
23 | fn main() {
   |           ^
note: ...but borrowed value is only valid for the block suffix following statement 0 at 25:18
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:25:19
   |
25 |         let x = 1;
   |                   ^
```

After:

```
error: `x` does not live long enough
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:26:18
   |
26 |         let y = &x;
   |                  ^ does not live long enough
...
32 |     };
   |     - borrowed value only valid until here
...
35 | }
   | - borrowed value must be valid until here
```

r? @nikomatsakis
2016-08-18 05:39:11 -07:00
Jeffrey Seyfried
a6e8f3ba83 Add type Determinacy. 2016-08-18 08:09:24 +00:00
Jeffrey Seyfried
951d3d6872 Fix fallout in tests. 2016-08-18 08:09:24 +00:00
Jeffrey Seyfried
cc079c3af2 Refactor away ImportResolvingError. 2016-08-18 08:09:24 +00:00
Jeffrey Seyfried
6cd43f6ee9 Rename source -> name in finalize_import. 2016-08-18 08:09:24 +00:00
Jeffrey Seyfried
11c38fdce0 Rename target_module to module or imported_module. 2016-08-18 08:09:24 +00:00
Jeffrey Seyfried
5b969a2a58 Improve import failure detection. 2016-08-18 08:09:22 +00:00
bors
9d6520f97b Auto merge of #35769 - eddyb:rollup, r=eddyb
Rollup of 12 pull requests

- Successful merges: #35346, #35734, #35739, #35740, #35742, #35744, #35749, #35750, #35751, #35756, #35766, #35768
- Failed merges:
2016-08-18 00:15:11 -07:00
Erik Uggeldahl
6976991569 Fix tiny spelling mistake in book
Changed datastructure to data structure
2016-08-18 02:03:42 -04:00
clementmiao
dae1406b82 updated E0396 to new error format 2016-08-17 22:45:21 -07:00
clementmiao
0dc13ee7f2 updated E0395 to new error format 2016-08-17 22:03:52 -07:00
Nick Cameron
683bcc0295 Use a Carrier trait with the ? operator
Allows use with `Option` and custom `Result`-like types.
2016-08-18 16:51:56 +12:00
Nick Cameron
e6cc4c5d13 Fix links 2016-08-18 15:43:35 +12:00
Nick Cameron
da1f7731f6 rustdoc: remove the ! from macro URLs and titles 2016-08-18 15:40:56 +12:00
Jeffrey Seyfried
fbc322975f Refactor out finalize_import() from resolve_import(). 2016-08-18 03:31:10 +00:00
Jeffrey Seyfried
165b0b618c Check privacy in resolve_name_in_module. 2016-08-18 03:22:48 +00:00
Jeffrey Seyfried
e1c9efcba4 Refactor value_determined -> value_result, type_determined -> type_result. 2016-08-18 03:22:48 +00:00
Jeffrey Seyfried
7608bbdea8 Refactor resolve_module_path to take an Option<Span> instead of a Span. 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
05afe15d1f Refactor record_used: bool -> record_used: Option<Span>. 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
75c3fd89d4 Refactor away the field arenas of ModuleS. 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
bfc98f59a4 Refactor away module.resolve_name(). 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
89de52eff0 Add field current_vis to Resolver. 2016-08-18 03:22:43 +00:00
Jeffrey Seyfried
c1362d8cc5 Clean up build_reduced_graph.rs. 2016-08-18 03:13:43 +00:00
Jeffrey Seyfried
37154ca95d Refactor unresolved_imports -> indeterminate_imports. 2016-08-18 03:13:42 +00:00
Jeffrey Seyfried
c64cd86be8 Add field parent to ImportDirective. 2016-08-18 03:13:41 +00:00
Jeffrey Seyfried
d107d22590 Refactor module.add_import_directive() -> resolver.add_import_directive(). 2016-08-18 03:13:39 +00:00
Eduard-Mihai Burtescu
d69cd7207b Rollup merge of #35770 - crypto-universe:E0221, r=jonathandturner
Updated test for E0221

As a part of issue #35233
?r @GuillaumeGomez
2016-08-18 06:12:23 +03:00
Eduard-Mihai Burtescu
d36b296cb6 Rollup merge of #35768 - GuillaumeGomez:err_codes, r=jonathandturner
Add new error code tests

r? @jonathandturner
2016-08-18 06:12:23 +03:00
Eduard-Mihai Burtescu
8ccc11b31b Rollup merge of #35765 - KiChjang:e0053-bonus, r=jonathandturner
Additional span info for E0053

Part of #35233.
Fixes #35212.

r? @jonathandturner
2016-08-18 06:12:23 +03:00
Eduard-Mihai Burtescu
c3601d40ec Rollup merge of #35756 - crypto-universe:E0407, r=GuillaumeGomez
New output for E0407

Issue #35697 as a part of #35233.
r? @GuillaumeGomez
2016-08-18 06:12:23 +03:00
Eduard-Mihai Burtescu
64c1aef5c8 Rollup merge of #35751 - nagisa:mir-scope-fix-again, r=eddyb
Fix the invalidation of the MIR early exit cache

~~The #34307 introduced a cache for early exits in order to help with O(n*m) explosion of cleanup blocks but the cache is invalidated incorrectly and I can’t seem to figure out why (caching is hard!)~~

~~Remove the cache for now to fix the immediate correctness issue and worry about the performance later.~~

Cache invalidation got fixed.

Fixes #35737

r? @nikomatsakis
2016-08-18 06:12:23 +03:00
Eduard-Mihai Burtescu
1e13de810f Rollup merge of #35750 - SimonSapin:help, r=alexcrichton
Add 'make help' for rustbuild

It is still advertised by the configure script.
2016-08-18 06:12:22 +03:00
Eduard-Mihai Burtescu
f1861b814a Rollup merge of #35749 - GuillaumeGomez:raw_field, r=jonathandturner
Fixes issue #11004

Fixes #11004.

r? @jonathandturner
2016-08-18 06:12:22 +03:00
Eduard-Mihai Burtescu
394c4497de Rollup merge of #35744 - DevShep:ds/update_E0009, r=jonathandturner
Update E0009 to new format

Part of #35233
Fixes #35193

r? @jonathandturner
2016-08-18 06:12:22 +03:00
Eduard-Mihai Burtescu
7a274441ae Rollup merge of #35742 - spladug:readme-cmake-version, r=nikomatsakis
Update minimum CMake version in README

The minimum got bumped in the LLVM upgrade of #34743.
2016-08-18 06:12:22 +03:00
Eduard-Mihai Burtescu
99e5efdbe6 Rollup merge of #35740 - eddyb:llvm-prl-fix, r=alexcrichton
Update LLVM to include 4 backported commits by @majnemer.

Partial fix for rust-lang/rust#35662, should help at least loops on small arrays.

Nominated for backporting into the new beta (not the one that's being released as stable this week).

r? @alexcrichton
2016-08-18 06:12:21 +03:00
Eduard-Mihai Burtescu
71759ec52c Rollup merge of #35739 - circuitfox:E0403-update-error-format, r=jonathandturner
E0403 update error format

Fixes #35696

Part of #35233

r? @jonathandturner

Also did the bonus for this one.
2016-08-18 06:12:21 +03:00