Commit Graph

85768 Commits

Author SHA1 Message Date
Felix S. Klock II
e940801592 Make ui/binop-move-semantics.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
62a2bb1294 Remove println!'s from ui/issues/issue-52126-assign-op-invariance.rs
This is not strictly necessary to make this test "more robust with
respect to NLL"; its just an attempt to narrow the scope of the test
and focus on its core.
2018-11-05 15:26:02 +01:00
Felix S. Klock II
41a1ee923e Make ui/unop-move-semantics.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
9843a38632 Make ui/borrowck/borrowck-unboxed-closures.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
6c7d82e1ca Make ui/borrowck/borrowck-reborrow-from-mut.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
9f9bf94b8d Make ui/borrowck/borrowck-overloaded-index-move-index.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
affddf68c6 Make ui/issues/issue-17263.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
cd52b3c2dc Make ui/span/borrowck-borrow-overloaded-auto-deref-mut.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00
Felix S. Klock II
5f524ed5c4 Switch to using revisions in borrowck-lend-flow-loop.rs
Most of the time we want to robustify tests, but in this case this
test is deliberately encoding artifacts of AST-borrowck.  So instead
of adding artificial uses that would obscure the aspects of
AST-borrowck that are being tests, we instead use revisions and then
mark the cases that apply to NLL as well as AST-borrowck.
2018-11-05 15:26:02 +01:00
Ralf Jung
7b7c6ceb75 add method to obtain the ptr offset of a Scalar 2018-11-05 15:11:28 +01:00
jsirs
87c22f2b14
add test for i32, fix incorrect location 2018-11-05 15:57:07 +02:00
jsirs
9fb2e0618e
update test to include concrete type (i32) 2018-11-05 15:54:10 +02:00
Ralf Jung
a0074cafb1 walk_value: more tracing 2018-11-05 14:36:27 +01:00
jsirs
4a08333c4d
self.associated_item can return none
self.associated_item can return none, replace unwrap with '?' and bubble up None value instead of panicking
2018-11-05 14:37:36 +02:00
jsirs
2a1dc1eff6
Add test
Add test for incompleately implemented add trait, see issue #31076
2018-11-05 14:33:43 +02:00
Matthias Krüger
84775edcc2 -C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n" 2018-11-05 12:11:05 +01:00
bors
6cfc603395 Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomez
rustdoc: refactor: centralize all command-line argument parsing

This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation.

One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time.

One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.
2018-11-05 09:48:46 +00:00
Ralf Jung
0529dc818f proide ptr_wrapping_offset on Scalars 2018-11-05 10:30:56 +01:00
Ralf Jung
873041009d make ValueVisitor mut-polymorphic 2018-11-05 10:15:25 +01:00
Ralf Jung
7565b5ac67 machine hooks for ptr (de)ref also need layout, and then they do not need the size 2018-11-05 09:59:06 +01:00
Ralf Jung
0d596f29d9 FIXME 2018-11-05 09:59:05 +01:00
Ralf Jung
91cad39614 visit_aggregate with an iterator; fix some comment typos 2018-11-05 09:59:05 +01:00
Ralf Jung
996a42557e the visitor can already load the value for visit_primitive 2018-11-05 09:40:05 +01:00
Ralf Jung
c2677211f6 all values can convert to operators 2018-11-05 09:37:14 +01:00
Ralf Jung
b096f0846e finally this actually looks like a visitor 2018-11-05 09:37:13 +01:00
Ralf Jung
98295e9eb2 use more traditional walk_array/visit_array instead of the handle_array hook 2018-11-05 09:29:39 +01:00
Ralf Jung
aea61e398c converting a VisitorValue to a MemPlace must not mutate anything 2018-11-05 09:17:48 +01:00
Ralf Jung
77c283465c Also test for undef in enum discriminant
The error message is sub-par, but fixing that requries moving ScalarMaybeUndef
to librustc which would conflict badly with another PR that is in flight.
2018-11-05 09:17:48 +01:00
Ralf Jung
fa01e04fbb fix validation error on non-integer enum discriminants 2018-11-05 09:17:48 +01:00
Ralf Jung
6d24b37a70 let the Value handle enum projections, so the visitor does not have to care 2018-11-05 09:17:48 +01:00
Ralf Jung
b0f1b1a73e provide some default implementations 2018-11-05 09:17:48 +01:00
Ralf Jung
33770abbe2 add visit() hook to the trait 2018-11-05 09:17:48 +01:00
Ralf Jung
fdc3a3ed0c fix for pre-NLL rustc 2018-11-05 09:17:48 +01:00
Ralf Jung
c8e471fac3 also allow visiting places and mplaces 2018-11-05 09:17:48 +01:00
Ralf Jung
7d7bd9b6c2 reduce the amount of traversal/projection code that the visitor has to implement itself 2018-11-05 09:17:48 +01:00
Ralf Jung
5b5e076b47 generalize the traversal part of validation to a ValueVisitor 2018-11-05 09:15:46 +01:00
Ralf Jung
c905497766 miri: binary_op_val -> binary_op_imm 2018-11-05 09:10:48 +01:00
bors
56ac2c4fc3 Auto merge of #55681 - matthiaskrgr:clippy, r=oli-obk
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-05 06:58:10 +00:00
bors
0117b42f66 Auto merge of #55593 - nikic:remove-llvm-4-checks, r=rkruppe
Remove checks for LLVM < 4.0

While we still have to support LLVM 4.0 for Emscripten, we can drop checks for LLVM >= 4.0 and < 4.0.
2018-11-05 01:41:55 +00:00
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
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
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