Commit Graph

64541 Commits

Author SHA1 Message Date
Corey Farwell
9d68a231e6 Rollup merge of #42324 - seanmonstar:41323-compare_const_impl, r=nikomatsakis
associated_consts: check trait obligations and regionck for associated consts

Closes #41323

r? @nikomatsakis
2017-06-01 00:09:25 -04:00
Corey Farwell
a554b74316 Rollup merge of #42314 - jannic:patch-1, r=japaric
ARMv5 needs +strict-align

Without that flag, LLVM generates unaligned memory access instructions, which are not allowed on ARMv5.

For example, the 'hello world' example from `cargo --new` failed with:
```
$ ./hello
Hello, world!
thread 'main' panicked at 'assertion failed: end <= len', src/libcollections/vec.rs:1113
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

I traced this error back to the following assembler code in `BufWriter::flush_buf`:
```
    6f44:       e28d0018        add     r0, sp, #24
[...]
    6f54:       e280b005        add     fp, r0, #5
[...]
    7018:       e5cd001c        strb    r0, [sp, #28]
    701c:       e1a0082a        lsr     r0, sl, #16
    7020:       03a01001        moveq   r1, #1
    7024:       e5cb0002        strb    r0, [fp, #2]
    7028:       e1cba0b0        strh    sl, [fp]
```

Note that `fp` points to `sp + 29`, so the three `str*`-instructions should fill up a 32bit - value at `sp + 28`, which is later used as the value `n` in `Ok(n) => written += n`. This doesn't work on ARMv5 as the `strh` can't write to the unaligned contents of `fp`, so the upper bits of `n` won't get cleared, leading to the assertion failure in Vec::drain.

With `+strict-align`, the code works as expected.
2017-06-01 00:09:25 -04:00
Corey Farwell
2221f9c6b9 Rollup merge of #42306 - efyang:rls-packaging, r=alexcrichton
Add the RLS to .exe, .msi, and .pkg installers

This directly addresses issue #42157, adding the RLS as a non-default component in the mentioned installers. The windows installers appear to have the right functionality added, but I don't have a machine that runs OSX, so it would be great if someone could test whether my .pkg commit adds the RLS correctly. The final commit also fixes some formatting issues I'd noticed while working on the installers, but I don't know if that's within the scope of this PR, so input would be appreciated.
2017-06-01 00:09:24 -04:00
Corey Farwell
a3b842e191 Rollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=Susurrus
New error codes next

Part #42229.
To be merged after #42264.

cc @Susurrus
2017-06-01 00:09:23 -04:00
Corey Farwell
b03ed42c36 Rollup merge of #42297 - tschottdorf:proj-ty, r=nikomatsakis
Upgrade ProjectionTy's Name to a DefId

Part of #42171, in preparation for downgrading the contained `TraitRef` to
only its `substs`.

Some inline questions in the diff. Look for `FIXME(tschottdorf)`. These comments
should be addressed before merging.
2017-06-01 00:09:22 -04:00
Corey Farwell
ae75dbfc23 Rollup merge of #42286 - ollie27:rustdoc_assoc_const, r=GuillaumeGomez
rustdoc: Cleanup associated const value rendering

Rather than (ab)using Debug for outputting the type in plain text use the
alternate format parameter which already does exactly that. This fixes
type parameters for example which would output raw HTML.

Also cleans up adding parens around references to trait objects.
2017-06-01 00:09:21 -04:00
Corey Farwell
dbc9d71b17 Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakis
Lower `?` to `Try` instead of `Carrier`

The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments.

Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs.

Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following:

- 00206e34c6/src/serialize.rs (L38)
- b1325898f4/src/result.rs (L50)

The other results appear to be files from libcore or its tests.  I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better.

r? @nikomatsakis

Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.
2017-06-01 00:09:20 -04:00
Corey Farwell
422faf7a6f Rollup merge of #42136 - petrochenkov:oldhard, r=nikomatsakis
Turn sufficiently old compatibility lints into hard errors

It's been almost 7 months since https://github.com/rust-lang/rust/pull/36894 was merged, so it's time to take the next step.

[breaking-change], needs crater run.

PRs/issues submitted to affected crates:
https://github.com/alexcrichton/ctest/pull/17
https://github.com/Sean1708/rusty-cheddar/pull/55
https://github.com/m-r-r/helianto/pull/3
https://github.com/azdle/virgil/pull/1
https://github.com/rust-locale/rust-locale/issues/24
https://github.com/mneumann/acyclic-network-rs/pull/1
https://github.com/reem/rust-typemap/pull/38

cc https://internals.rust-lang.org/t/moving-forward-on-forward-compatibility-lints/4204
cc https://github.com/rust-lang/rust/issues/34537 https://github.com/rust-lang/rust/issues/36887
Closes https://github.com/rust-lang/rust/issues/36886
Closes https://github.com/rust-lang/rust/issues/36888
Closes https://github.com/rust-lang/rust/issues/36890
Closes https://github.com/rust-lang/rust/issues/36891
Closes https://github.com/rust-lang/rust/issues/36892
r? @nikomatsakis
2017-06-01 00:09:19 -04:00
bors
e0cc22b4ba Auto merge of #42336 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 7 pull requests

- Successful merges: #42126, #42196, #42252, #42277, #42315, #42329, #42330
- Failed merges:
2017-05-31 21:14:02 +00:00
Oliver Middleton
86ea93e83c rustdoc: Cleanup associated const value rendering
Rather than (ab)using Debug for outputting the type in plain text use the
alternate format parameter which already does exactly that. This fixes
type parameters for example which would output raw HTML.

Also cleans up adding parens around references to trait objects.
2017-05-31 20:05:28 +01:00
Mark Simulacrum
7f286a8e38 Rollup merge of #42330 - qnighy:macro-named-default, r=petrochenkov
Parse macros named "default" correctly.

Fixes #42292.
2017-05-31 10:52:50 -06:00
Mark Simulacrum
0c339ffbc0 Rollup merge of #42329 - rap2hpoutre:patch-6, r=steveklabnik
fix links to "module-level documentation"

see https://github.com/rust-lang/rust/issues/42267
2017-05-31 10:52:49 -06:00
Mark Simulacrum
b62eb7fed8 Rollup merge of #42315 - scottmcm:rangefrom-sizehint, r=alexcrichton
RangeFrom should have an infinite size_hint

Before,
```rust
(0..).take(4).size_hint() == (0, Some(4))
```

With this change,
```rust
(0..).take(4).size_hint() == (4, Some(4))
```
2017-05-31 10:52:48 -06:00
Mark Simulacrum
0daa27f3c2 Rollup merge of #42277 - citizen428:remove-crate-type-metadata, r=nikomatsakis
Remove --crate-type=metadata deprecation warning

Fixes #38640
2017-05-31 10:52:47 -06:00
Mark Simulacrum
c0df1d4e80 Rollup merge of #42252 - stjepang:clarify-alignof-docs, r=nikomatsakis
Clarify the docs for align_of and its variants

It's okay to have unaligned raw pointers and then use `ptr::write_unaligned` and `ptr::read_unaligned`.
However, using unaligned `&T` and `&mut T` would be undefined behavior.

The current documentation seems to indicate that everything has to be aligned, but in reality only references do. This PR changes the text of docs accordingly.

r? @sfackler
2017-05-31 10:52:46 -06:00
Mark Simulacrum
b851d1cdb4 Rollup merge of #42196 - tommyip:explain_closure_err, r=nikomatsakis
Explain why a closure is `FnOnce` in closure errors.

Issue: #42065
@nikomatsakis Am I going the right direction with this?

~~I am stuck in a few bits:~~
~~1. How to trace the code to get the upvar instead of the original variable's span?~~
~~2. How to find the node id of the upvar where the move occured?~~
2017-05-31 10:52:45 -06:00
Mark Simulacrum
d5a7fd585f Rollup merge of #42126 - clarcharr:into_docs, r=steveklabnik
Clarify docs on implementing Into.

This was suggested by @dtolnay in #40380.

This explicitly clarifies in what circumstances you should implement `Into` instead of `From`.
2017-05-31 10:52:44 -06:00
Tobias Schottdorf
e5e664fb07 Upgrade ProjectionTy's Name to a DefId
Part of #42171, in preparation for downgrading the contained `TraitRef` to
only its `substs`.
2017-05-31 12:35:13 -04:00
Masaki Hara
b670930933
Emit proper expectation for the "default" keyword. 2017-05-31 23:22:33 +09:00
Masaki Hara
54edfee71a
Parse macros named "default" correctly. 2017-05-31 19:24:01 +09:00
Raphaël Huchet
69f822524f fix links to "module-level documentation" 2017-05-31 11:38:19 +02:00
Scott McMurray
3119e634e1 Add some try_trait ramblings to the unstable book 2017-05-31 02:16:01 -07:00
Tommy Ip
c2f7e94552 Update closure errors to use span_note 2017-05-31 10:15:00 +01:00
bors
fd7b44b78e Auto merge of #42318 - GuillaumeGomez:rustdoc-fix-signature, r=QuietMisdreavus
Fix signature by adding parens when needed

Fixes #42299.
2017-05-31 08:48:16 +00:00
Scott McMurray
7a87469af7 Give the try_trait feature its own tracking issue 2017-05-31 01:30:13 -07:00
Sean McArthur
62989c1a0c associated_consts: check trait obligations and regionck for associated consts
Closes #41323
2017-05-30 22:21:04 -07:00
Guillaume Gomez
171d285756 Fix signature by adding parens when needed 2017-05-30 23:04:03 +02:00
Stjepan Glavina
c25e271858 Add 'the' 2017-05-30 21:34:50 +02:00
Vadim Petrochenkov
26d5c0e20c Turn invalid_type_param_default into a lint again 2017-05-30 22:00:30 +03:00
Vadim Petrochenkov
d73a0fef38 Turn public reexporting of private extern crates into a lint again 2017-05-30 22:00:30 +03:00
Vadim Petrochenkov
caecb76f08 Turn sufficiently old compatibility lints into hard errors 2017-05-30 22:00:30 +03:00
Guillaume Gomez
a333be7cfe Add new error code 2017-05-30 19:19:34 +02:00
Scott McMurray
265dce66b6 RangeFrom should have an infinite size_hint
This makes the size_hint from things like `take` more precise.
2017-05-30 09:15:25 -07:00
Jan Niehusmann
4450807ead ARMv5 needs +strict-align
Without that flag, LLVM generates unaligned memory access instructions, which are not allowed on ARMv5.

For example, the 'hello world' example from `cargo --new` failed with:
```
$ ./hello
Hello, world!
thread 'main' panicked at 'assertion failed: end <= len', src/libcollections/vec.rs:1113
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

I traced this error back to the following assembler code in `BufWriter::flush_buf`:
```
    6f44:       e28d0018        add     r0, sp, #24
[...]
    6f54:       e280b005        add     fp, r0, #5
[...]
    7018:       e5cd001c        strb    r0, [sp, #28]
    701c:       e1a0082a        lsr     r0, sl, #16
    7020:       03a01001        moveq   r1, #1
    7024:       e5cb0002        strb    r0, [fp, #2]
    7028:       e1cba0b0        strh    sl, [fp]
```

Note that `fp` points to `sp + 29`, so the three `str*`-instructions should fill up a 32bit - value at `sp + 28`, which is later used as the value `n` in `Ok(n) => written += n`. This doesn't work on ARMv5 as the `strh` can't write to the unaligned contents of `fp`, so the upper bits of `n` won't get cleared, leading to the assertion failure in Vec::drain.

With `+strict-align`, the code works as expected.
2017-05-30 17:50:44 +02:00
bors
f89d8d1844 Auto merge of #42311 - bjorn3:patch-1, r=frewsxcv
Syntax highlight all rust code in librustc/traits/README.md

Also replace `...` with `/*...*/`
2017-05-30 12:38:57 +00:00
bjorn3
681d97f19c Syntax highlight all rust code in librustc/traits/README.md
Also replace `...` with `/*...*/`
2017-05-30 14:37:19 +02:00
Tommy Ip
31bfdd7f17 Update fn_once-moved test 2017-05-30 11:21:24 +01:00
Tommy Ip
ee88a870b6 Explain why closure is moved in error message 2017-05-30 11:05:16 +01:00
bors
e1fe1a8933 Auto merge of #42283 - Mark-Simulacrum:issue-40341, r=pnkfelix
Add note regarding parent module containing use statement.

Fixes #40341.
2017-05-30 05:01:10 +00:00
Edward Yang
f3b29d3f01 Fix formatting issues in Distribution.xml 2017-05-29 21:55:35 -05:00
Edward Yang
7c362732dc Add RLS to .pkg installer 2017-05-29 21:50:23 -05:00
bors
77d096a2bb Auto merge of #42282 - Mark-Simulacrum:issue-40342, r=arielb1
Don't warn on lifetime generic no_mangle functions.

Fixes #40342.
2017-05-30 02:38:18 +00:00
Edward Yang
eeebfd667b Add RLS to .exe and .msi installers 2017-05-29 21:31:33 -05:00
bors
0c4fb24a07 Auto merge of #42180 - GuillaumeGomez:update-rustdoc-man, r=QuietMisdreavus
Update rustdoc man page

r? @rust-lang/docs
r? @rust-lang/dev-tools
2017-05-30 00:18:23 +00:00
bors
cb7c60f2a0 Auto merge of #42264 - GuillaumeGomez:new-error-codes, r=Susurrus
New error codes

Part of #42229.
2017-05-29 21:55:57 +00:00
bors
5de00925bd Auto merge of #42214 - RalfJung:rust-src, r=alexcrichton
rust-src: include everything needed to compile libstd with jemalloc

I am not very happy about all this `Path::new`, but did not find a nice way to avoid it. Also, this shouldn't be very performance-critical.

With this patch, rust-src-1.19.0-dev.tar.gz grows from 1.4 to 3.1 MiB (new uncompressed size: 15.5 MiB). Not great, but shipping incomplete sources is also not great, and this is still much smaller than pre-#41546. Excluding the entire `src/jemalloc/test` does not work, unfortunately; there is a file in there that is needed to build libstd. (And anyway there's just 190 KiB uncompressed left in that folder.)

In principle, we could try excluding the Rust test suite directories (that would be `libcore/tests` and `libcollection/tests`). I don't know enough about how this component is used to judge whether that would cause any problems. Anyway this is just 600 KiB uncompressed.

Fixes #41952
2017-05-29 19:31:03 +00:00
bors
d78c2b483e Auto merge of #42192 - michaelwoerister:no_deptracking_map_in_queries, r=nikomatsakis
incr.comp.: Remove DepGraph::write() and its callers

After months of yak shaving, we are finally there `:)`

The existence of `DepGraph::write()` was one of the two main ways for introducing cycles into the dep-graph -- something we need to avoid in the future. The other way, re-opening nodes to add more edges, is next on the list.

r? @nikomatsakis
2017-05-29 17:10:08 +00:00
Michael Kohl
9873acc54b Remove --crate-type=metadata deprecation warning
Fixes #38640
2017-05-30 00:02:03 +07:00
bors
03bed65514 Auto merge of #41856 - qnighy:prohibit-parenthesized-params-in-more-types, r=arielb1
Prohibit parenthesized params in more types.

Prohibit parenthesized parameters in primitive types, type parameters, `Self`, etc.

Fixes #32995.
2017-05-29 11:32:14 +00:00
Michael Woerister
c150301a5b Remove DepGraph::write() and its callers. 2017-05-29 13:16:28 +02:00