Commit Graph

63805 Commits

Author SHA1 Message Date
Esteban Küber
4bc7f5b52c Always show end line of multiline annotations
```rust
error[E0046]: not all trait items implemented, missing: `Item`
  --> $DIR/issue-23729.rs:20:9
   |
20 |           impl Iterator for Recurrence {
   |  _________^ starting here...
21 | |             //~^ ERROR E0046
22 | |             //~| NOTE missing `Item` in implementation
23 | |             //~| NOTE `Item` from trait: `type Item;`
...  |
36 | |             }
37 | |         }
   | |_________^ ...ending here: missing `Item` in implementation
   |
   = note: `Item` from trait: `type Item;`
```

instead of

```rust
error[E0046]: not all trait items implemented, missing: `Item`
  --> $DIR/issue-23729.rs:20:9
   |
20 |         impl Iterator for Recurrence {
   |         ^ missing `Item` in implementation
   |
   = note: `Item` from trait: `type Item;`
```
2017-04-09 13:48:25 -07:00
Nick Cameron
5766d526a2 Remove --enable-save-analysis configure flag 2017-04-10 08:46:20 +12:00
Nick Cameron
223b280f31 Reviewer changes 2017-04-10 08:30:34 +12:00
Nick Cameron
c55325e0f7 Build an RLS package as part of the dist target 2017-04-10 08:30:34 +12:00
Nick Cameron
7da12c8541 Add the RLS as a submodule 2017-04-10 08:30:34 +12:00
Corey Farwell
f789d896cb Print tidy errors to stderr, prefix with 'tidy error: ', handle 'bad' state. 2017-04-09 13:59:09 -04:00
bors
d616f47cd0 Auto merge of #41084 - QuietMisdreavus:rustdoc-format-redux, r=frewsxcxv,GuillaumeGomez
rustdoc: update formatting of fn signatures and where clauses to match style rfcs

Recent updates to style RFCs ([where clauses](https://github.com/rust-lang-nursery/fmt-rfcs/issues/38), [function definitions](https://github.com/rust-lang-nursery/fmt-rfcs/issues/39)) changed the "canonical" style for these items, so this is a rustdoc update to make it emit that style where necessary. This is mainly a conversion from visual indent to block indent, which helps out in situations where there was excessive indent causing lines to wrap regardless.

Samples:

![std::iter::IntoIterator](https://cloud.githubusercontent.com/assets/5217170/24712947/e586604c-19e9-11e7-87ae-4fe64d689dc3.png)

![excerpt from std::iter::Iterator](https://cloud.githubusercontent.com/assets/5217170/24713209/91e65112-19ea-11e7-9ff8-d4cf6b31aae1.png)

![std::iter::FromIterator](https://cloud.githubusercontent.com/assets/5217170/24713138/59f36114-19ea-11e7-9dbb-5f5ba7126e2e.png)

![std::cmp::min](https://cloud.githubusercontent.com/assets/5217170/24713038/1bab88b4-19ea-11e7-935d-defed5648de4.png)

![some trait impls on std::collections::HashMap](https://cloud.githubusercontent.com/assets/5217170/24713251/b7ef69e8-19ea-11e7-94a7-e01fbf89fa31.png)

![`fn extract_code_blocks`, an example given in #40687](https://cloud.githubusercontent.com/assets/5217170/24713159/672717cc-19ea-11e7-9acb-6ac278b90339.png)

![excerpt from itertools::Itertools](https://cloud.githubusercontent.com/assets/5217170/24713323/f06716ea-19ea-11e7-94cc-6ef68d9980ec.png)

fixes #41025 and #40687

r? @rust-lang/docs
2017-04-09 17:51:32 +00:00
Guillaume Gomez
d4aecf52db Fix block code headers parsing 2017-04-09 18:31:59 +02:00
Aaron Hill
63a291feba
Fix rustdoc infinitely recursing when an external crate reexports itself
Previously, rustdoc's LibEmbargoVisitor unconditionally visited the
child modules of an external crate. If a module re-exported its parent
via 'pub use super::*', rustdoc would re-walk the parent, leading to
infinite recursion.

This commit makes LibEmbargoVisitor store already visited modules in an
FxHashSet, ensuring that each module is only walked once.

Fixes #40936
2017-04-09 12:12:05 -04:00
Simonas Kazlauskas
c337b99f4c Fix test failures 2017-04-09 18:55:49 +03:00
Simonas Kazlauskas
486345551c into_inner to associated function 2017-04-09 18:55:49 +03:00
Simonas Kazlauskas
c94b3f1266 Replace the forget intrinsic with ManuallyDrop
less intrinsics = better life
2017-04-09 18:55:49 +03:00
Simonas Kazlauskas
38713126dd Move away from the ad-hoc NoDrop unions 2017-04-09 18:55:47 +03:00
Simonas Kazlauskas
f6e566185e Implement Manually Drop 2017-04-09 18:50:50 +03:00
QuietMisdreavus
8dd4c44ef6 merge with master to pick up pulldown switch 2017-04-09 10:38:38 -05:00
bors
fa332c9015 Auto merge of #40829 - mgattozzi:ChildStderr, r=steveklabnik
Update ChildStderr docs to be clearer

Before the docs only had a line about where it was found and that it was
a handle to stderr. This commit changes it so that the summary second line is
removed and that it's a bit clearer about what can be done with it. Part of
#29370
2017-04-09 15:30:20 +00:00
bors
2c48ae6f7f Auto merge of #40658 - eddyb:lay-more-out, r=arielb1
Use ty::layout for ABI computation instead of LLVM types.

This is the first step in creating a backend-agnostic library for computing call ABI details from signatures.
I wanted to open the PR *before* attempting to move `cabi_*` from trans to avoid rebase churn in #39999.
**EDIT**: As I suspected, #39999 needs this PR to fully work (see https://github.com/rust-lang/rust/pull/39999#issuecomment-287723379).

The first 3 commits add more APIs to `ty::layout` and replace non-ABI uses of `sizing_type_of`.
These APIs are probably usable by other backends, and miri too (cc @stoklund @solson).

The last commit rewrites `rustc_trans::cabi_*` to use `ty::layout` and new `rustc_trans::abi` APIs.
Also, during the process, a couple trivial bugs were identified and fixed:
* `msp430`, `nvptx`, `nvptx64`: type sizes *in bytes* were compared with `32` and `64`
* `x86` (`fastcall`): `f64` was incorrectly not treated the same way as `f32`

Although not urgent, this PR also uses the more general "homogenous aggregate" logic to fix #32045.
2017-04-09 13:08:10 +00:00
Eduard-Mihai Burtescu
f0636b61c7 rustc_trans: use ty::layout for ABI computation instead of LLVM types. 2017-04-09 16:06:56 +03:00
bors
ebb10a6131 Auto merge of #41095 - clarcharr:as_extras, r=alexcrichton
Add as_c_str

Again, tying up some consistencies with `CString`.
2017-04-09 09:17:34 +00:00
bors
cff81da514 Auto merge of #41163 - nagisa:ldflags-llvm-config, r=alexcrichton
Specify type libraries for llvm-config --ldflags

This matters on systems where static libraries and dynamic libraries reside in
different location
2017-04-09 05:49:31 +00:00
bors
c2d186a3c9 Auto merge of #41154 - bluss:slice-rfind, r=alexcrichton
Implement .rfind() for slice iterators Iter and IterMut

Just like the forward case find, implement rfind explicitly for slice iterators Iter and IterMut.
2017-04-09 03:30:09 +00:00
Paul Faria
a6f7628ea2 Use the existing path when removing the prefix fails. This allows the use of out-of-tree paths to be specified 2017-04-08 18:53:57 -04:00
bors
b2d9b6323e Auto merge of #41092 - jonhoo:std-fence-intrinsics, r=alexcrichton
Add safe wrapper for atomic_compilerfence intrinsics

This PR adds a proposed safe wrapper for the `atomic_singlethreadfence_*` intrinsics introduced by [RFC #888](https://github.com/rust-lang/rfcs/pull/888). See #41091 for further discussion.
2017-04-08 22:37:35 +00:00
Jorge Aparicio
2fed2a2395 this code block is text not Rust code 2017-04-08 15:51:18 -05:00
Eduard-Mihai Burtescu
43b227f3bd rustc: add some abstractions to ty::layout for a more concise API. 2017-04-08 23:41:18 +03:00
Eduard-Mihai Burtescu
c977daf97c rustc_trans: avoid sizing_type_of everywhere possible. 2017-04-08 23:40:54 +03:00
Eduard-Mihai Burtescu
49872b859e rustc: add a TyLayout helper for type-related layout queries. 2017-04-08 23:40:52 +03:00
Shiz
536011d929 Fix jemalloc support for musl
Just like DragonFlyBSD, using the same symbols as the system allocator will
result in a segmentation fault at runtime due to allocator mismatches.
As such, prefix the jemalloc symbols instead.
2017-04-08 22:28:32 +02:00
Alex Crichton
d94f2c928c Update cargo submodules
Brings in a fix for #40955 through rust-lang/cargo#3898.

Closes #40955
2017-04-08 13:10:08 -07:00
bors
666e7148d1 Auto merge of #41148 - arielb1:dead-unwind, r=nagisa
borrowck::mir::dataflow: ignore unwind edges of empty drops

This avoids creating drop flags in many unnecessary situations.

Fixes #41110.

r? @nagisa

beta-nominating because regression. However, that is merely a small perf regression and codegen changes are always risky, so we might let this slide for 1.17.
2017-04-08 19:47:31 +00:00
Ariel Ben-Yehuda
6979798687 borrowck::mir::dataflow: ignore unwind edges of empty drops
This avoids creating drop flags in many unnecessary situations.

Fixes #41110.
2017-04-08 22:46:50 +03:00
projektir
28a232a59a Adding links around Sender/SyncSender/Receiver errors; Adding more documentation to channel() and sync_channel(); adding more links #29377 2017-04-08 15:33:21 -04:00
Jon Gjengset
f093d59c31
Address @parched's comments 2017-04-08 14:03:17 -04:00
Simonas Kazlauskas
aeab73c938 Specify type libraries for llvm-config --ldflags
This matters on systems where static libraries and dynamic libraries reside in
different location
2017-04-08 17:53:16 +03:00
bors
a61011761d Auto merge of #41055 - Archytaus:compile-fail/const-match-pattern-arm, r=arielb1
Fixed ICEs with pattern matching in const expression

Fixed 2 ICEs with when pattern matching inside a constant expression.

Both of these ICEs now resolve to an appropriate compiler error.

1. ICE was caused by a compiler bug to implement discriminant const qualify.

    I removed this intentionally thrown bug and changed it to a FIXME as the unimplemented expression type is handled as a compiler error elsewhere.

2. ICE was caused during a drop check when checking if a variable lifetime outlives the current scope if there was no parent scope .

    I've changed it to stop checking if there is no parent scope for the current scope. It is valid syntax for a const variable to be assigned a match expression with no enclosing scope.

    The ICE seemed to mainly be used as a defensive check for bugs elsewhere.

Fixes #38199.
Fixes #31577.
Fixes #29093.
Fixes #40012.
2017-04-08 14:05:06 +00:00
bors
fe39e94d6c Auto merge of #40887 - estebank:ty-placeholder, r=petrochenkov
Introduce `TyErr` independent from `TyInfer`

Add a `TyErr` type to represent unknown types in places where
parse errors have happened, while still able to build the AST.

Initially only used to represent incorrectly written fn arguments and
avoid "expected X parameters, found Y" errors when called with the
appropriate amount of parameters. We cannot use `TyInfer` for this as
`_` is not allowed as a valid argument type.

Example output:

```rust
error: expected one of `:` or `@`, found `,`
  --> file.rs:12:9
   |
12 | fn bar(x, y: usize) {}
   |         ^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> file.rs:19:9
   |
12 | fn bar(x, y) {}
   | --------------- defined here
...
19 |     bar(1, 2, 3);
   |         ^^^^^^^ expected 2 parameters
```

Fix #34264.
2017-04-08 11:47:48 +00:00
bors
4cadff61ef Auto merge of #40775 - estebank:variant-as-type, r=petrochenkov
Suggest using enum when a variant is used as a type

Given a file:

```rust
enum Fruit {
    Apple(i64),
    Orange(i64),
}

fn should_return_fruit() -> Apple {
    Apple(5)
}
```

Provide the following output:

```rust
error[E0412]: cannot find type `Apple` in this scope
  --> file.rs:16:29
   |
16 | fn should_return_fruit() -> Apple {
   |                             ^^^^^ not found in this scope
   |
help: there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`?
  --> file.rs:12:5
   |
12 |     Apple(i64),
   |     ^^^^^^^^^^

error[E0425]: cannot find function `Apple` in this scope
  --> file.rs:17:5
   |
17 |     Apple(5)
   |     ^^^^^ not found in this scope
   |
   = help: possible candidate is found in another module, you can import it into scope:
             `use Fruit::Apple;`
```

Fix #35675.
2017-04-08 09:23:28 +00:00
Vadim Petrochenkov
ad58d37c56 Fix move checking for nested union fields 2017-04-08 11:52:37 +03:00
bors
3178d4318c Auto merge of #41156 - TimNN:rollup, r=TimNN
Rollup of 4 pull requests

- Successful merges: #41135, #41143, #41146, #41152
- Failed merges:
2017-04-08 06:56:17 +00:00
Tim Neumann
c04b39f1f8 Rollup merge of #41152 - cuviper:bootstrap-armv7, r=japaric
bootstrap.py: fix armv7 detection

This matches the logic that was in `./configure` before f8ca805422.
2017-04-08 08:55:10 +02:00
Tim Neumann
d6c17735cb Rollup merge of #41146 - est31:master, r=nrc
pub(restricted) didn't make it into 1.17

Gets shipped in 1.18 instead.
2017-04-08 08:55:10 +02:00
Tim Neumann
2e4ab07fa0 Rollup merge of #41143 - stjepang:optimize-bool-fetch-nand, r=nagisa
Optimize AtomicBool::fetch_nand

This is an attempt to push the PR #40563 to completion.

Benchmark: [source](https://gist.github.com/stjepang/023f5025623f5474184f9f4dfd6379ae)
Improvement:

```
 name  old_ ns/iter  new_ce_ ns/iter  diff ns/iter   diff %
 1t    146,440       89,904                -56,536  -38.61%
 2t    561,456       316,835              -244,621  -43.57%
 4t    2,822,821     1,005,424          -1,817,397  -64.38%
```

r? @eddyb
cc @alexcrichton @nagisa
2017-04-08 08:55:09 +02:00
Tim Neumann
29880e678f Rollup merge of #41135 - japaric:unstable-docs, r=steveklabnik
document some existing unstable features

"msp430-interrupt", "ptx-kernel" and #![compiler_builtins_lib]

r? @steveklabnik
2017-04-08 08:55:08 +02:00
bors
547c12b8a6 Auto merge of #41147 - aidanhs:aphs-fix-appveyor-cache, r=TimNN
Disable errexit for sanity checking git repo

Unblock appveyor
2017-04-08 04:21:43 +00:00
Jorge Aparicio
f76a3036ef fake the feature-gate-linker-flavor compile fail test
as there's no way to generate a `#![feature(linker_flavor)]` error
2017-04-07 21:47:58 -05:00
Ulrik Sverdrup
5d2f270395 slice: Implement .rfind() for slice iterators Iter and IterMut
Just like the forward case find, implement rfind explicitly
2017-04-08 03:45:48 +02:00
Esteban Küber
2b2eeda083 Move tests from ui to cfail 2017-04-07 17:22:55 -07:00
Josh Stone
5c0c3e803d bootstrap.py: fix armv7 detection
This matches the logic that was in `./configure` before f8ca805422.
2017-04-07 17:16:52 -07:00
Dylan Maccora
d35fa1e98b Removing broken examples 2017-04-08 08:12:50 +10:00
Esteban Küber
8c31412c2f Merge branch 'master' into ty-placeholder 2017-04-07 14:55:45 -07:00