Commit Graph

86258 Commits

Author SHA1 Message Date
bors
248745ab0c Auto merge of #55569 - durka:must-use-external-macro, r=alexcrichton
enforce unused-must-use lint in macros

Fixes #55516 by turning on the UNUSED_MUST_USE lint within macros.
2018-11-04 22:56:23 +00:00
Matthias Krüger
1351b942b3 submodules: update clippy from 71ec4ff6 to d8b42690
Fixes clippy toolstate.

Changes:

````
rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference)
Fix typo
Improve clippy_dev help text
RIIR update lints: Generate lint group registrations
Test clippy_dev on CI and fix test
RIIR update lints: Generate modules section
````
2018-11-04 23:49:42 +01:00
QuietMisdreavus
560a01c795 fix formatting 2018-11-04 16:44:28 -06:00
QuietMisdreavus
d0c9385781 add Debug impls for the Options structs 2018-11-04 16:39:24 -06:00
bors
e6c5cf9234 Auto merge of #55665 - eddyb:by-ref-layout-of, r=oli-obk
rustc_target: pass contexts by reference, not value.

`LayoutOf` now takes `&self` instead of `self`, and so does every method generic over a context that implements `LayoutOf` and/or other traits, like `HasDataLayout`, `HasTyCtxt`, etc.

Originally using by-value `Copy` types was relevant because `TyCtxt` was one of those types, but now `TyCtxt::layout_of` is separate from `LayoutOf`, and `TyCtxt` is not an often used layout context.

Passing these context by reference is a lot nicer for miri, which has `self: &mut EvalContext`, and needed `f(&self)` (that is, creating `&&mut EvalContext` references) for layout purposes.
Now, the `&mut EvalContext` can be passed to a function expecting `&C`, directly.

This should help with #54012 / #55627 (to not need `where &'a T::Cx: LayoutOf` bounds).

r? @nikomatsakis or @oli-obk or @nagisa cc @sunfishcode
2018-11-04 18:56:43 +00:00
Eduard-Mihai Burtescu
d00d42d079 rustc_target: pass contexts by reference, not value. 2018-11-04 20:33:57 +02:00
Nikita Popov
463ad9098e Support memcpy/memmove with differing src/dst alignment
If LLVM 7 is used, generate memcpy/memmove with differing
src/dst alignment. I've added new FFI functions to construct
these through the builder API, which is more convenient than
dealing with differing intrinsic signatures depending on the
LLVM version.
2018-11-04 18:54:37 +01:00
Nikita Popov
c14bc575d6 Don't export non-function symbols with emscripten
Emscripten only provides an export mechanism for functions.
Exporting statics does not make sense conceptually in this case,
and will result in emcc undefined function errors.
2018-11-04 18:50:58 +01:00
Nikita Popov
131fda40af Ignore some more tests on emscripten
Either missing i128 or asm support
2018-11-04 18:50:57 +01:00
Nikita Popov
97e1d36937 Fix two run-fail tests for asmjs
Use eprintln!() to make sure stdio is flushed.
2018-11-04 18:50:57 +01:00
Nikita Popov
9eb19273a3 Update llvm-emscripten
This updates emscripten to version 1.38.15, which is based on
LLVM 6.0.1.
2018-11-04 18:50:57 +01:00
David Wood
ba09ed5208
Update test to force error under NLL.
In each of the three cases in this test, there is a mutable borrow
of some field of the union and then a shared borrow of some other field
immediately following.

Under NLL, the mutable borrow is killed straight away as it isn't
used later - therefore not causing a conflict with the shared borrow.
This commit adds a use of the first mutable borrow to force the intended
errors to appear under NLL.
2018-11-04 18:36:30 +01:00
David Wood
1854dde30a
Correct indentation on documentation comment.
This commit adjusts the indentation of code within a documentation
comment so that it is correctly highlighted as code by rustdoc.
2018-11-04 18:05:54 +01:00
bors
ca4fa6f567 Auto merge of #55393 - oli-obk:immediate_immediately, r=RalfJung
Rename `Value` to `Immediate` for miri

r? @RalfJung
2018-11-04 15:06:32 +00:00
Ralf Jung
bb17f71749 also test with PhantomData 2018-11-04 14:43:05 +01:00
bors
ac708826b0 Auto merge of #55349 - bjorn3:rustc_mir_collect_and_partition_mono_items, r=oli-obk
Move collect_and_partition_mono_items to rustc_mir

Most of the logic of it is inside rustc_mir anyway.

Also removes the single function crate rustc_metadata_utils. Based on #55225
2018-11-04 12:20:55 +00:00
Guillaume Gomez
424fecdfb6 Add precision for create_dir function 2018-11-04 12:37:43 +01:00
Ralf Jung
aca76d42a0 test for offset and alignment of the sized part, instead of field count 2018-11-04 11:55:39 +01:00
Ralf Jung
e753d21051 miri: accept extern types in structs if they are the only field 2018-11-04 11:23:34 +01:00
bors
86b88e6a85 Auto merge of #55432 - zackmdavis:single_life, r=nikomatsakis
single life

 * structured ~~autofixable~~ (well, pending #53934 and rust-lang-nursery/rustfix#141) suggestions for the single-use-lifetimes lint in the case of function and method reference args
 * don't consider the anonymous lifetime `'_` as "single-use" (it's intended for exactly this sort of thing)

![single_life](https://user-images.githubusercontent.com/1076988/47613227-3b2b6400-da48-11e8-8efd-cb975ddf537d.png)

r? @nikomatsakis
2018-11-04 09:45:49 +00:00
bors
794fc062be Auto merge of #55455 - estebank:expected-descr, r=michaelwoerister
Use token description in "expected/found" parse messages

Fix #54309.
2018-11-04 06:56:11 +00:00
Hideki Sekine
f872303623 [ci] run-make/thumb-none-qemu: add .cargo/config 2018-11-04 12:32:25 +09:00
bors
6d69fe7a2f Auto merge of #54861 - rep-nop:find_main_in_doctest, r=estebank
rustdoc: Replaces fn main search and extern crate search with proper parsing during doctests.

Fixes #21299.
Fixes #33731.

Let me know if there's any additional changes you'd like made!
2018-11-04 01:43:40 +00:00
varkor
8277ba2d30 Make "all possible cases" help message uniform with existing help messages
Specifically no capitalisation or trailing full stops.
2018-11-03 23:53:10 +00:00
bors
4c5c05d7d9 Auto merge of #55662 - matthiaskrgr:clippy_update, r=oli-obk
submodules: update clippy from a20599ab to 71ec4ff6

Should fix clippy toolstat.

Changes:

````
rustup https://github.com/rust-lang/rust/pull/55330/
Update stderr
Rename test files
Also lint cfg_attr(.., rustfmt::skip)
Add tests from rustfmt::skip test file
Run update_lints.py script
Add test for non-crate-level inner attributes
Differ between inner and outer attributes
Add tests
Add cfg_attr(rustfmt) lint
Addressed comments.
Fix dogfood error.
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.
Allow single_match_else
Update stderr
Add copyright statement©
Fix typos
Fix dogfood error
Fix typo and indentation
run update_lints script
Add tests for unknwon_clippy_lints lint
Add new lint: unknwon_clippy_lintsg
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Fix a false-positive of needless_borrow
UI test cleanup: Extract match_overlapping_arm tests
UI test cleanup: Extract expect_fun_call tests
Add missing code of conduct file
Use slice patterns instead of padding
Fix dogfood and pedantic lints
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.
RIIR update lints: Generate deprecated lints
Replace big if/else expression with match
````
2018-11-03 23:02:04 +00:00
Nikita Popov
4c40ff6a24 Implement rotate using funnel shift on LLVM >= 7
Implement the rotate_left and rotate_right operations using
llvm.fshl and llvm.fshr if they are available (LLVM >= 7).

Originally I wanted to expose the funnel_shift_left and
funnel_shift_right intrinsics and implement rotate_left and
rotate_right on top of them. However, emulation of funnel
shifts requires emitting a conditional to check for zero shift
amount, which is not necessary for rotates. I was uncomfortable
doing that here, as I don't want to rely on LLVM to optimize
away that conditional (and for variable rotates, I'm not sure it
can). We should revisit that question when we raise our minimum
version requirement to LLVM 7 and don't need emulation code
anymore.
2018-11-03 23:50:55 +01:00
bors
04fdb44f5c Auto merge of #55661 - kennytm:fix-exclude, r=alexcrichton
Fixed the bug in bootstrap where --exclude was ignored for run-pass test

This should fix the 3 hour timeout on AppVeyor which happened a lot recently.

Additionally, further rebalanced the AppVeyor subsets by moving "ui" and "linkchecker" into Set 2.
2018-11-03 20:13:47 +00:00
Matthias Krüger
8a0be2c5c0 submodules: update clippy from a20599ab to 71ec4ff6
Should fix clippy toolstat.

Changes:

````
rustup https://github.com/rust-lang/rust/pull/55330/
Update stderr
Rename test files
Also lint cfg_attr(.., rustfmt::skip)
Add tests from rustfmt::skip test file
Run update_lints.py script
Add test for non-crate-level inner attributes
Differ between inner and outer attributes
Add tests
Add cfg_attr(rustfmt) lint
Addressed comments.
Fix dogfood error.
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.
Allow single_match_else
Update stderr
Add copyright statement©
Fix typos
Fix dogfood error
Fix typo and indentation
run update_lints script
Add tests for unknwon_clippy_lints lint
Add new lint: unknwon_clippy_lintsg
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Fix a false-positive of needless_borrow
UI test cleanup: Extract match_overlapping_arm tests
UI test cleanup: Extract expect_fun_call tests
Add missing code of conduct file
Use slice patterns instead of padding
Fix dogfood and pedantic lints
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.
RIIR update lints: Generate deprecated lints
Replace big if/else expression with match
````
2018-11-03 20:13:53 +01:00
kennytm
2bde4e7c05
Move a few more tests into the appveyor-subset-2.
This should allow the timings be more balanced.
2018-11-04 02:33:38 +08:00
kennytm
a257332159
Ensure --exclude is checked against PathSet::Suite
Fix the recent spurious 3 hour timeouts.
2018-11-04 02:32:53 +08:00
bors
a3f0f5107e Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakis
Implement trait aliases (RFC 1733)

Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733.

CC @durka @nikomatsakis
2018-11-03 17:30:37 +00:00
Alex Crichton
f3428a7dc4 rustc: Delete grouping logic from the musl target
This commit deletes the injection of `-(` and `-)` options to the linker
for the musl targets. This actually causes problems today on nightly if
you execute:

    $ echo 'fn main() {}' >> foo.rs
    $ rustc --target x86_64-unknown-linux-musl -C panic=abort

you get a linker error about "cannot nest groups". This comes about
because rustc injects its own `--start-group` and `--end-group`
variables which clash with the outer `-(` and `-)` variables. It's not
entirely clear to me why this doesn't affect the musl target by default
(in `-C panic=unwind` mode).

The compiler's own injection of `--start-group` and `--end-group` should
solve the issues mentioned in the comment for injecting `-(` and `-)` as
well.
2018-11-03 10:23:51 -07:00
David Wood
a4e0945621
Unions reinitialized after assignment into field.
This commit makes two changes:

First, it updates the dataflow builder to add an init for the place
containing a union if there is an assignment into the field of
that union.

Second, it stops a "use of uninitialized" error occuring when there is an
assignment into the field of an uninitialized union that was previously
initialized. Making this assignment would re-initialize the union, as
tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`.
The check for previous initialization ensures that we do not start
supporting partial initialization yet (cc #21232, #54499, #54986).
2018-11-03 18:14:21 +01:00
bors
3d28ee3e34 Auto merge of #55646 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #54162 (Hide default impls items)
 - #55555 (Make `-Z ls` list the actual filename of external dependencies)
 - #55567 (add test for deriving Debug on uninhabited enum)
 - #55568 (test that rustdoc doesn't overflow on a big enum)
 - #55598 (publish-toolstate: ping maintainers when a tool builds again)

Failed merges:

r? @ghost
2018-11-03 14:51:05 +00:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
9e479c2818
Update src/librustc_mir/monomorphize/partitioning.rs
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
2018-11-03 14:45:50 +01:00
bjorn3
c8599191e8 Remove rustc_metadata_utils, which contains only one function 2018-11-03 14:31:09 +01:00
bjorn3
d46246b14a Move collect_and_partition_mono_items to rustc_mir 2018-11-03 14:31:09 +01:00
Guillaume Gomez
723edf7793
Rollup merge of #55598 - nrc:tool-bot, r=kennytm
publish-toolstate: ping maintainers when a tool builds again

And add @Xanewok as an RLS maintainer

r? @kennytm

Motivation is that I see when the RLS gets broken, but have to poll the website to see when it is fixed, I'd prefer to get pinged.
2018-11-03 13:40:39 +01:00
Guillaume Gomez
c674335ba3
Rollup merge of #55568 - durka:rustdoc-big-enum, r=nikomatsakis
test that rustdoc doesn't overflow on a big enum

Adds a test to close #25295. The test case depended on `enum_primitive` so I just basically pulled its source into an auxiliary file, is that the right way to do it?
2018-11-03 13:40:37 +01:00
Guillaume Gomez
c5c6e4239f
Rollup merge of #55567 - durka:derive-debug-uninhabited, r=nikomatsakis
add test for deriving Debug on uninhabited enum

Adds a test to close #38885.
2018-11-03 13:40:35 +01:00
Guillaume Gomez
8ab8f5342d
Rollup merge of #55555 - aidanhs:aphs-better-z-ls, r=alexcrichton
Make `-Z ls` list the actual filename of external dependencies

The hash is pointless for external consumers - extra_filename is the thing that actually gets used, per https://github.com/rust-lang/rust/blob/ca2639e/src/librustc_metadata/locator.rs#L312-L313
2018-11-03 13:40:34 +01:00
Guillaume Gomez
336b02347f
Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, r=QuietMisdreavus
Hide default impls items

Follow up of #51885.
Fixes #54025.

cc @Mark-Simulacrum

r? @QuietMisdreavus

And screenshots of course:

<img width="1440" alt="screen shot 2018-09-12 at 23 30 35" src="https://user-images.githubusercontent.com/3050060/45454424-1ff8d500-b6e4-11e8-9257-030322495d58.png">

<img width="1440" alt="screen shot 2018-09-12 at 23 30 42" src="https://user-images.githubusercontent.com/3050060/45454431-2424f280-b6e4-11e8-8d65-db0d85ac18f0.png">
2018-11-03 13:40:32 +01:00
bjorn3
942864a000 Move cg_llvm:🔙:linker to cg_utils 2018-11-03 13:35:09 +01:00
bors
2ad8c7b350 Auto merge of #55330 - scalexm:bound-ty, r=nikomatsakis
Add support for bound types

This PR may have some slight performance impacts, I don't know how hot is the code I touched.

Also, this breaks clippy and miri.

r? @nikomatsakis
2018-11-03 12:11:23 +00:00
scalexm
c5ed72fbfe Substitute binders directly 2018-11-03 11:41:55 +01:00
scalexm
0751997530 Rename as_bound_var to assert_bound_var 2018-11-03 11:41:55 +01:00
scalexm
af8196b9d3 Fix doc comment 2018-11-03 11:41:55 +01:00
scalexm
142359c220 Extend ty::fold::RegionReplacer to ty::fold::BoundVarReplacer
Use the new `BoundVarReplacer` to perform canonical substitutions.
2018-11-03 11:41:55 +01:00
scalexm
d99195ad8f Rename Binder::no_late_bound_regions to Binder::no_bound_vars 2018-11-03 11:41:55 +01:00
scalexm
45be1ac0fc Remove ReCanonical in favor of ReLateBound 2018-11-03 11:41:55 +01:00