Commit Graph

74495 Commits

Author SHA1 Message Date
Manish Goregaokar
d0ab8f03bb Convert tyvar_behind_raw_pointer to hard error for the 2018 epoch 2018-02-05 22:16:42 -05:00
Manish Goregaokar
2cff123416 Add -Zepoch 2018-02-05 22:16:42 -05:00
Zack M. Davis
b55e07ee50 correct E0619 span re method call receivers whose type must be known
Previously, when the type of a method receiver could not be determined,
the error message would, potentially confusingly, highlight the span of
the entire method call.

Resolves #36598, resolves #42234.
2018-02-05 18:09:51 -08:00
David Wood
5cd4b4fd95
Swapped order of left/right visits to ensure consistency in read/write pass ordering when -O is passed. 2018-02-05 22:31:56 +00:00
Ralf Jung
2aae22746e Warn about more ignored bounds on type aliases 2018-02-05 21:20:57 +01:00
bobtwinkles
eae1a35f55 mir: Add and fix tests for FalseUnwinds
Fix instructions on existing mir-opt tests after introducing false edges from
loops. Also, add a test for issue 46036: infinite loops.
2018-02-05 15:00:40 -05:00
bobtwinkles
ed6a2ebcd6 mir: Add false edge cleanup out of infinite loops
Fixes #46036
2018-02-05 15:00:40 -05:00
bobtwinkles
bdc37aa057 mir: Add TerminatorKind::FalseUnwind
Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the
case of infinite loops such as those introduced by a loop statement without any
other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator
kind is used when we want borrowck to consider an unwind path, but real control
flow should never actually take it.
2018-02-05 15:00:40 -05:00
bobtwinkles
5ca88ae6ae Fix comment in ExprKind::LogicalOp
The comment previously implied that the true branch would result in the false
block. Fortunately the implementation is correct.
2018-02-05 15:00:40 -05:00
Alex Crichton
27a4e73ca5 rustc: Add #[rustc_args_required_const]
This commit adds a new unstable attribute to the compiler which requires that
arguments to a function are always provided as constants. The primary use case
for this is SIMD intrinsics where arguments are defined by vendors to be
constant and in LLVM they indeed must be constant as well.

For now this is mostly just a semantic guarantee in rustc that an argument is a
constant when invoked, phases like trans don't actually take advantage of it
yet. This means that we'll be able to use this in stdsimd but we won't be able
to remove the `constify_*` macros just yet. Hopefully soon though!
2018-02-05 10:58:13 -08:00
kennytm
0553dc81d3
Rollup merge of #48007 - nrc:rls-field-init, r=eddyb
save-analysis: avoid implicit unwrap

When looking up a field defintion, since the name might be incorrect in the field init shorthand case.

cc https://github.com/rust-lang-nursery/rls/issues/699

r? @eddyb
2018-02-06 02:13:55 +08:00
kennytm
e2f6e134c1
Rollup merge of #48003 - mbrubeck:docs, r=steveklabnik
Fix info about generic impls in AsMut docs

This text was copy-pasted from the `AsRef` docs to `AsMut`, but needed some additional adjustments for correctness.
2018-02-06 02:13:54 +08:00
kennytm
daecd15271
Rollup merge of #47959 - Manishearth:rustdoc-ice, r=Mark-Simulacrum
Fix rustdoc ICE on macros defined within functions

fixes #47639
2018-02-06 02:13:52 +08:00
kennytm
55aef3c9c7
Rollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, r=petrochenkov
Stabilize use_nested_groups

As requested in #44494. Documentation PRs already sent.
2018-02-06 02:13:51 +08:00
kennytm
e8688b4a24
Rollup merge of #47807 - tbu-:pr_doc_constanttime_cstr, r=steveklabnik
Make wording around 0-cost casts more precise
2018-02-06 02:13:50 +08:00
kennytm
ddc4284b71
Rollup merge of #47753 - steveklabnik:update-book, r=alexcrichton
Update book

This PR does two things:

1. update the book to include https://github.com/rust-lang/book/pull/1088
2. update to mdbook 0.1

Both of these things are big changes, so I want to land them now, well before the next branch, so we can kick the tires.

------------------------------

Locally, I'm seeing some weirdness around the reference and this:

![image](https://user-images.githubusercontent.com/27786/35411917-8dcbb31a-01e8-11e8-8c30-0bd280d93b9d.png)

Putting this PR up so others can try and build and see if it reproduces for them.
2018-02-06 02:13:49 +08:00
kennytm
a405a08d72
Rollup merge of #47704 - dsprenkels:issue-44415, r=alexcrichton
Add a regression test for #44415

This PR adds a regression test for issue #44415.

Fixes #44415.
2018-02-06 02:13:48 +08:00
kennytm
9dab73773a
Rollup merge of #47543 - topecongiro:issue-42344, r=nikomatsakis
Disallow mutable borrow to non-mut statics

Closes #42344.
2018-02-06 02:13:46 +08:00
kennytm
cde119db8e
Rollup merge of #47496 - QuietMisdreavus:rls-doc-include, r=estebank
add documentation from doc(include) to analysis data

cc #44732

Currently save-analysis only loads docs from plain doc comments and doc attributes. Since `#[doc(include="filename.md")]` doesn't create a plain doc attribute when it loads the file, we need to be sure to pick up this info for the analysis data.
2018-02-06 02:13:45 +08:00
kennytm
eb5a4617a5
Rollup merge of #46030 - Zoxc:asm-volatile, r=nikomatsakis
Make inline assembly volatile if it has no outputs. Fixes #46026
2018-02-06 02:13:44 +08:00
O01eg
7be8e2fbb3
Add build.tools option to manage installation of extended rust tools. 2018-02-05 20:10:05 +03:00
Ralf Jung
c83dd03062 Clarify 'trait bounds ignored' wording 2018-02-05 17:31:46 +01:00
bors
6c04c41034 Auto merge of #47881 - oli-obk:miri_clippy, r=Manishearth
Update clippy and miri submodule

r? @Manishearth

cc @kennytm I needed to touch the miri submodule's Cargo.toml to make sure that clippy gets the newest compiletest_rs. This will not fix miri, but since I touched the miri submodule, will this PR fail?

miri is unfixable until #46882 is merged
2018-02-05 15:05:43 +00:00
John Kåre Alsaker
a29d8545b5 Make inline assembly volatile if it has no outputs. Fixes #46026 2018-02-05 15:56:44 +01:00
Oliver Schneider
70717f20f5
Update clippy and miri submodule 2018-02-05 11:36:51 +01:00
Pietro Albini
01f0814a2a
Stabilize use_nested_groups 2018-02-05 10:23:40 +01:00
bors
b0a396bb0a Auto merge of #47920 - Aaron1011:nll-overflow, r=pnkfelix
Fix overflow when performing drop check calculations in NLL

Clearing out the infcx's region constraints after processing each type
ends up interacting badly with normalizing associated types. This commit
keeps all region constraints intact until the end of
TypeLivenessGenerator.add_drop_live_constraint, ensuring that normalized
types are able to re-use existing inference variables.

Fixes #47589
2018-02-05 09:17:00 +00:00
Onur Aslan
1461d12b3c Use time crate in bootstrap dist instead of date 2018-02-05 11:39:54 +03:00
Scott McMurray
1b1e887f4d Override try_[r]fold for RangeInclusive
Because the last item needs special handling, it seems that LLVM has trouble canonicalizing the loops in external iteration.  With the override, it becomes obvious that the start==end case exits the loop (as opposed to the one *after* that exiting the loop in external iteration).
2018-02-04 23:48:40 -08:00
bors
07ea260407 Auto merge of #47873 - Aaron1011:final-ref-coerce, r=nikomatsakis
Fix ref-to-ptr coercions not working with NLL in certain cases

Implicit coercions from references to pointers were lowered to slightly
different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted
in certain uses of self-referential structs compiling correctly when an
explicit cast was used, but not when the implicit coercion was used.

To fix this, this commit adds an outer 'Use' expr when applying a
raw-ptr-borrow adjustment. This makes the lowered Mir for coercions
identical to that of explicit coercions, allowing the original code to
compile regardless of how the raw ptr cast occurs.

Fixes #47722
2018-02-05 04:32:06 +00:00
bors
dd29d3dd76 Auto merge of #47865 - Manishearth:cleanup-shim, r=nikomatsakis
Cleanup the shim code

 - We now write directly to `RETURN_PLACE` instead of creating intermediates
 - `tuple_like_shim` takes an iterator (used by #47867)
 - `tuple_like_shim` no longer relies on it being the first thing to create blocks, and uses relative block indexing in a cleaner way (necessary for #47867)
 - All the shim builders take `dest, src` arguments instead of hardcoding RETURN_PLACE

r? @eddyb
2018-02-05 01:45:46 +00:00
panicbit
b439632a75 Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs} 2018-02-05 00:00:09 +01:00
bors
e7e982ac03 Auto merge of #47998 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests

- Successful merges: #47862, #47877, #47896, #47912, #47947, #47958, #47978, #47996, #47999, #47892
- Failed merges:
2018-02-04 22:58:10 +00:00
Nick Cameron
3c72a848e9 save-analysis: avoid implicit unwrap
When looking up a field defintion, since the name might be incorrect in the field init shorthand case.

cc https://github.com/rust-lang-nursery/rls/issues/699
2018-02-05 11:00:56 +13:00
steveklabnik
983cc00b80 add exceptions for new deps 2018-02-04 15:47:36 -05:00
steveklabnik
5437188e10 update mdbook to 0.1.2
and improve printing of errors
2018-02-04 15:47:35 -05:00
steveklabnik
b320829da4 update reference 2018-02-04 15:44:48 -05:00
steveklabnik
dcb3e21b06 update trpl
Includes https://github.com/rust-lang/book/pull/1088 and
62210e326c
2018-02-04 15:44:48 -05:00
Matt Brubeck
f243f9239d Fix info about generic impls in AsMut docs
This text was copy-pasted from the `AsRef` docs to `AsMut`, but needed
some additional adjustments for correctness.
2018-02-04 11:57:36 -08:00
kennytm
e17ebdf344
Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obk
Turn `type_id` into a constant intrinsic

https://github.com/rust-lang/rust/issues/27745

The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. This PR makes the `type_id` intrinsic a constant intrinsic, the same as `size_of` and `align_of`, allowing `TypeId::of` to be a `const fn`, which will allow using an associated constant in `Any`.
2018-02-05 01:27:36 +08:00
kennytm
66d6c855bd
Rollup merge of #47999 - jaystrictor:master, r=Mark-Simulacrum
Remove 'the this' in doc comments.
2018-02-05 01:20:56 +08:00
kennytm
adb5849b79
Rollup merge of #47996 - Zoxc:run-make-last, r=Mark-Simulacrum
Run the `run-make` tests last, so more tests run on Windows when `make` is unavailable
2018-02-05 01:19:41 +08:00
kennytm
393cd89267
Rollup merge of #47978 - eddyb:iu, r=kennytm
ui tests: diff from old (expected) to new (actual) instead of backwards.

Previously `actual` was "old" and `expected` was "new" which resulted in `+` before `-`.
AFAIK all diff tools put `-` before `+`, which made the previous behavior *very confusing*.

r? @nikomatsakis
2018-02-04 23:29:01 +08:00
kennytm
e58cff2a4d
Rollup merge of #47958 - frewsxcv:frewsxcv-try-clone, r=aidanhs
Clarify shared file handler behavior of File::try_clone.

Fixes https://github.com/rust-lang/rust/issues/46578.
2018-02-04 23:28:59 +08:00
kennytm
1439c2ac35
Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, r=petrochenkov
Stabilize feature(match_beginning_vert)

With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm.

Reference PR: rust-lang-nursery/reference#231

Closes #44101
2018-02-04 23:28:58 +08:00
kennytm
8b8c6ee796
Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton
Use a range to identify SIGSEGV in stack guards

Previously, the `guard::init()` and `guard::current()` functions were
returning a `usize` address representing the top of the stack guard,
respectively for the main thread and for spawned threads.  The `SIGSEGV`
handler on `unix` targets checked if a fault was within one page below that
address, if so reporting it as a stack overflow.

Now `unix` targets report a `Range<usize>` representing the guard memory,
so it can cover arbitrary guard sizes.  Non-`unix` targets which always
return `None` for guards now do so with `Option<!>`, so they don't pay any
overhead.

For `linux-gnu` in particular, the previous guard upper-bound was
`stackaddr + guardsize`, as the protected memory was *inside* the stack.
This was a glibc bug, and starting from 2.27 they are moving the guard
*past* the end of the stack.  However, there's no simple way for us to know
where the guard page actually lies, so now we declare it as the whole range
of `stackaddr ± guardsize`, and any fault therein will be called a stack
overflow.  This fixes #47863.
2018-02-04 23:28:57 +08:00
kennytm
349115efda
Rollup merge of #47896 - zackmdavis:and_the_case_of_the_necessary_unnecessary_parens, r=nikomatsakis
decline to lint technically-unnecessary parens in function or method arguments inside of nested macros

In #46980 ("in which the unused-parens lint..." (14982db2d6)), the
unused-parens lint was made to check function and method arguments,
which it previously did not (seemingly due to oversight rather than
willful design). However, in #47775 and discussion thereon,
user–developers of Geal/nom and graphql-rust/juniper reported that the
lint was seemingly erroneously triggering on certain complex macros in
those projects. While this doesn't seem like a bug in the lint in the
particular strict sense that the expanded code would, in fact, contain
unncecessary parentheses, it also doesn't seem like the sort of thing
macro authors should have to think about: the spirit of the
unused-parens lint is to prevent needless clutter in code, not to give
macro authors extra heartache in the handling of token trees.

We propose the expediency of declining to lint unused parentheses in
function or method args inside of nested expansions: we believe that
this should eliminate the petty, troublesome lint warnings reported
in the issue, without forgoing the benefits of the lint in simpler
macros.

It seemed like too much duplicated code for the `Call` and `MethodCall`
match arms to duplicate the nested-macro check in addition to each
having their own `for` loop, so this occasioned a slight refactor so
that the function and method cases could share code—hopefully the
overall intent is at least no less clear to the gentle reader.

This is concerning #47775.
2018-02-04 23:28:56 +08:00
kennytm
f3dc75602f
Rollup merge of #47877 - spastorino:lifetime-bounds-in-copy, r=nikomatsakis
Do not ignore lifetime bounds in Copy impls

cc #29149

r? @nikomatsakis
2018-02-04 23:28:54 +08:00
kennytm
686986375b
Rollup merge of #47862 - GuillaumeGomez:const-evaluation-ice, r=eddyb
Fix const evaluation ICE in rustdoc

Fixes #47860.

r? @eddyb
2018-02-04 23:28:53 +08:00
Jay Strict
f168700ba6 Remove 'the this' in doc comments. 2018-02-04 16:24:18 +01:00