311 Commits

Author SHA1 Message Date
Niko Matsakis
865320f6a4 remove the ins set altogether 2018-07-01 10:13:05 -04:00
Niko Matsakis
be0e77837a use WorkQueue to track dirty bits in liveness 2018-07-01 05:24:16 -04:00
Nicholas Nethercote
08683f003c Rename IdxSet::clone_from.
The current situation is something of a mess.

- `IdxSetBuf` derefs to `IdxSet`.
- `IdxSetBuf` implements `Clone`, and therefore has a provided `clone_from`
  method, which does allocation and so is expensive.
- `IdxSet` has a `clone_from` method that is non-allocating and therefore
  cheap, but this method is not from the `Clone` trait.

As a result, if you have an `IdxSetBuf` called `b`, if you call
`b.clone_from(b2)` you'll get the expensive `IdxSetBuf` method, but if you call
`(*b).clone_from(b2)` you'll get the cheap `IdxSetBuf` method.
`liveness_of_locals()` does the former, presumably unintentionally, and
therefore does lots of unnecessary allocations.

Having a `clone_from` method that isn't from the `Clone` trait is a bad idea in
general, so this patch renames it as `overwrite`. This avoids the unnecessary
allocations in `liveness_of_locals()`, speeding up most NLL benchmarks, the
best by 1.5%. It also means that calls of the form `(*b).clone_from(b2)` can be
rewritten as `b.overwrite(b2)`.
2018-06-29 09:57:19 +10:00
Santiago Pastorino
1dae309ca1
Run rustfmt 2018-06-22 18:24:02 -03:00
Santiago Pastorino
ad612d660c
Fix erroneous error note when using field after move 2018-06-22 18:23:33 -03:00
Rémy Rakic
63a4e721b3 Share code between gather_used_muts and find_assignments 2018-06-21 14:12:26 +02:00
Felix S. Klock II
fbe7d5bce8 When NLL has illegal move due to borrowed content, provide feedback about why the move wasn't a copy.
This should address #51190.
2018-06-06 22:42:27 +02:00
Eduard-Mihai Burtescu
06d88cda08 rustc: rename mir::LocalDecl's syntactic_source_info to source_info. 2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
3da186b67f rustc: use syntactic (instead of visibility) source info where appropriate. 2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
0895590c53 rustc: rename mir::LocalDecl's source_info to visibility_source_info. 2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
85d44c4276 rustc: rename mir::VisibilityScope to mir::SourceScope. 2018-05-30 20:30:09 +03:00
Eduard-Mihai Burtescu
e3df729c25 rustc: make mk_substs_trait take &[Kind] instead of &[Ty]. 2018-05-21 12:13:17 +03:00
Mark Simulacrum
9e3432447a Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
John Kåre Alsaker
fdd9787777 Introduce ConstValue and use it instead of miri's Value for constant values 2018-05-11 13:01:44 +02:00
John Kåre Alsaker
710b4ad2a5 Store the GeneratorInterior in the new GeneratorSubsts 2018-05-08 16:21:58 +02:00
John Kåre Alsaker
0edc8f4270 Store generator movability outside GeneratorInterior 2018-05-08 16:21:58 +02:00
Eduard-Mihai Burtescu
f0f26b875a rustc: return impl Iterator from Terminator(Kind)::successors(_mut). 2018-05-01 13:12:23 +03:00
bors
71d3dac4a8 Auto merge of #50097 - glandium:box_free, r=nikomatsakis
Partial future-proofing for Box<T, A>

In some ways, this is similar to @eddyb's PR #47043 that went stale, but doesn't cover everything. Notably, this still leaves Box internalized as a pointer in places, so practically speaking, only ZSTs can be practically added to the Box type with the changes here (the compiler ICEs otherwise).

The Box type is not changed here, that's left for the future because I want to test that further first, but this puts things in place in a way that hopefully will make things easier.
2018-04-27 12:24:17 +00:00
Niko Matsakis
0361e5938c use reveal_all during drop elaboration
This used to happen by default as part of the normalization routine
that was being used.
2018-04-26 13:31:52 -04:00
Mike Hommey
bd8c177d49 Switch box_free to take the destructured contents of Box
As of now, Box only contains a Unique pointer, so this is the sole
argument to box_free. Consequently, we remove the code supporting
the previous box_free signature. We however keep the old definition
for bootstrapping purpose.
2018-04-25 11:39:07 +09:00
Mike Hommey
6614fa0981 Support an alternative form for box_free
box_free currently takes a pointer. With the prospect of the Box type
definition changing in the future to include an allocator, box_free will
also need to be aware of this. In order to prepare for that future, we
allow box_free to take a form where its argument are the fields of the
Box.

e.g. if Box is defined as `Box(A, B, C)`, then box_free signature
becomes `box_free(a: A, b: B, c: C)`.

We however still allow the current form (taking a pointer), so that the
same compiler can handle both forms, which helps with bootstrap.
2018-04-20 09:43:52 +09:00
Mike Hommey
43b24c6c83 Pass the right type to box_free() in MIR
Currently, MIR just passes the raw Box to box_free(), which happens to
work because practically, it's the same thing. But that might not be
true in the future, with Box<T, A: Alloc>.

The MIR inline pass actually fixes up the argument while inlining
box_free, but this is not enabled by default and doesn't necessarily
happen (the inline threshold needs to be passed).

This change effectively moves what the MIR inline pass does to the
elaborate_drops pass, so that box_free() is passed the raw pointer
instead of the Box.
2018-04-20 09:31:45 +09:00
Scott McMurray
c4b6521327 Add ok-wrapping to catch blocks, per RFC 2018-04-10 20:03:40 -07:00
gaurikholkar
e5a96a4b95 modify the error message- CR Comments 2018-04-07 13:17:16 +05:30
gaurikholkar
1fb25fbbe3 reduce nested loops in the code 2018-04-06 20:00:21 +05:30
Gauri Kholkar
c1192065ea
Update borrowck_errors.rs 2018-04-05 22:04:20 +05:30
gaurikholkar
1b06fe1ef5 Merge branch 'master' of https://github.com/rust-lang/rust into e0389 2018-04-05 21:52:40 +05:30
gaurikholkar
6c649fbed4 address code review comments 2018-04-05 21:48:06 +05:30
kennytm
8d3f3f0cac
Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebank
address some FIXME whose associated issues were marked as closed

part of #44366
2018-03-22 22:43:37 +08:00
csmoe
55116243e7 remove unneeded where clause 2018-03-18 20:18:21 +08:00
Niv Kaminer
7278e37d38 update FIXME(#6393) to point to issue 43234 (tracking issue for non-lexical lifetimes) 2018-03-17 20:24:27 +02:00
csmoe
c62d9eb729 fix formatting 2018-03-16 14:52:16 +08:00
csmoe
0b111e677c change &self to self and fix lifetime annotations 2018-03-16 14:52:15 +08:00
Andrew Cann
9b15ddb29e remove defaulting to unit
Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple
2018-03-14 12:44:51 +08:00
Niko Matsakis
e4728e494e transition various normalization functions to the new methods
In particular:

- `fully_normalize_monormophic_ty` => `normalize_erasing_regions`
- `normalize_associated_type_in_env` => `normalize_erasing_regions`
- `fully_normalize_associated_types_in` => `normalize_erasing_regions`
- `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`
2018-03-13 11:22:07 -04:00
gaurikholkar
fdb2f7f97c tidy fixes 2018-03-10 21:13:15 +05:30
gaurikholkar
0c7fc046d3 code refactor, modify compile-fail tests 2018-03-10 20:55:02 +05:30
gaurikholkar
7a266a6902 minor changes 2018-03-10 20:52:22 +05:30
gaurikholkar
bfc9b76159 add collect_writes.rs 2018-03-10 20:52:22 +05:30
gaurikholkar
3f0ce0858e minor refactorings to fix trait import issue 2018-03-10 20:52:22 +05:30
Oliver Schneider
9857eaa4df
Nuke ConstInt and Const*size 2018-03-08 08:34:10 +01:00
Oliver Schneider
3b8d2e0016
Rename ConstVal::to_u128 to to_raw_bits 2018-03-08 08:34:10 +01:00
Oliver Schneider
28572d2c1f
Nuke the entire ctfe from orbit, it's the only way to be sure 2018-03-08 08:08:14 +01:00
Oliver Schneider
918b6d7633
Produce instead of pointers 2018-03-08 08:08:14 +01:00
Michael Woerister
542bc75dea Turn features() into a query. 2018-03-05 11:05:01 +01:00
Manish Goregaokar
8d730ed527 Run Rustfix on librustc_mir 2018-03-02 21:02:37 -08:00
bors
b85bd51c94 Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
add transform for uniform array move out

reworked second step for fix #34708
previous try #46686
r? @nikomatsakis
2018-02-17 08:44:41 +00:00
Mikhail Modin
31253d5557 add transform for uniform array move out 2018-02-08 14:27:55 +03:00
Felix S. Klock II
c00266b7ac Encode (in MIR) whether borrows are explicit in source or arise due to autoref.
This is foundation for issue 46747 (limit two-phase borrows to method-call autorefs).
2018-02-08 12:16:25 +01:00
Eduard-Mihai Burtescu
46a9bdda78 rustc: replace "lvalue" terminology with "place" in the code. 2018-01-29 01:49:29 +02:00