Commit Graph

82588 Commits

Author SHA1 Message Date
varkor
35ddd46a2d Refactor confirm.rs 2018-08-19 20:02:32 +01:00
varkor
84edc0a089 Move lifetime calculation outside loop 2018-08-19 20:02:32 +01:00
varkor
b6eef180cd Supress consecutive errors 2018-08-19 20:02:32 +01:00
varkor
d8ba103334 Fix param_idx calculation 2018-08-19 20:02:32 +01:00
varkor
d5e24dc121 Fix integer overflow 2018-08-19 20:02:32 +01:00
varkor
734ce4ae1a Fix tidy check 2018-08-19 20:02:32 +01:00
varkor
335770267a Replace generics_require_inlining with generics.requires_monomorphization 2018-08-19 20:02:32 +01:00
varkor
88d5b2f4b4 Refactor mod/check (part vi) 2018-08-19 20:02:32 +01:00
varkor
c9941a8a85 Refactor mod/check (part v) 2018-08-19 20:02:32 +01:00
varkor
e812b55d8f Refactor mod/check (part iv) 2018-08-19 20:02:32 +01:00
varkor
96379e1659 Refactor mod/check (part iii) 2018-08-19 20:02:32 +01:00
varkor
5fe9aeb402 Refactor mod/check (part ii) 2018-08-19 20:02:32 +01:00
varkor
d1a82af235 Refactor mod/check (part i) 2018-08-19 20:02:32 +01:00
varkor
2317abdd01 Fix quadratic loop in confirm.rs 2018-08-19 20:02:32 +01:00
varkor
651215e283 Replace for_each with for 2018-08-19 20:02:32 +01:00
varkor
11adc1300c Address minor comments 2018-08-19 20:02:32 +01:00
bors
3ac79c7184 Auto merge of #53258 - nikomatsakis:issue-53189-optimize-reassignment-immutable-state, r=pnkfelix
optimize reassignment immutable state

This is the "simple fix" when it comes to checking for reassignment. We just shoot for compatibility with the AST-based checker. Makes no attempt to solve #21232.

I opted for this simpler fix because I didn't want to think about complications [like the ones described here](https://github.com/rust-lang/rust/issues/21232#issuecomment-412219247).

Let's do some profiling measurements.

Fixes #53189

r? @pnkfelix
2018-08-19 17:44:43 +00:00
Mazdak Farrokhzad
f84ec02bf7 remove feature(convert_id) from lib{core,std}/lib.rs 2018-08-19 19:25:35 +02:00
Mazdak Farrokhzad
71187b7e18
Make core::convert::identity a const fn. 2018-08-19 18:49:31 +02:00
Mazdak Farrokhzad
c2217b7fb7
Get rid of unnecessary #![feature(core_float)]. 2018-08-19 18:37:00 +02:00
Mazdak Farrokhzad
8208c77782
Drop identity from prelude. 2018-08-19 18:36:18 +02:00
Mazdak Farrokhzad
08b1d83a46
Merge branch 'master' into feature/core_convert_id 2018-08-19 18:34:46 +02:00
Jakub Kozlowski
00920c0024 Stabilize macro_vis_matcher 2018-08-19 17:08:00 +01:00
Matthias Krüger
71120ef1e5 Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
bors
bfc3b20663 Auto merge of #53248 - nikomatsakis:nll-trivial-sized-predicate, r=eddyb
skip trivial `Sized` predicates

This came to about a 2% win for me in cargo. Small, but hey.

r? @eddyb
2018-08-19 15:22:18 +00:00
Niko Matsakis
58e4b54bd4 move tests to borrowck directory, remove feature(nll)
now compare-mode can show us the differences
2018-08-19 08:15:13 -07:00
Niko Matsakis
4e50c5b6e4 add tests for assigning fields without initializing var
We did not seem to have any!
2018-08-19 07:35:07 -07:00
Niko Matsakis
78e987ab8f just check whether a variable is initialized
Don't iterate over all things that are initialized.
2018-08-19 07:34:44 -07:00
Niko Matsakis
a8a982bb61 treat local variables specially 2018-08-19 07:34:43 -07:00
Dmytro Shynkevych
85b92c1df1 Added test 2018-08-19 09:14:06 -04:00
bors
b355906919 Auto merge of #51131 - qnighy:unsized-locals, r=eddyb
Implement Unsized Rvalues

This PR is the first step to implement RFC1909: unsized rvalues (#48055).

## Implemented

- `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`)
- Unsized locations are allowed in MIR
- Unsized places and operands are correctly translated at codegen

## Not implemented in this PR

- Additional `Sized` checks:
  - tuple struct constructor (accidentally compiles now)
  - closure arguments at closure generation (accidentally compiles now)
  - upvars (ICEs now)
- Generating vtable for `fn method(self)` (ICEs now)
- VLAs: `[e; n]` where `n` isn't const
- Reduce unnecessary allocations

## Current status

- [x] Fix `__rust_probestack` (rust-lang-nursery/compiler-builtins#244)
  - [x] Get the fix merged
- [x] `#![feature(unsized_locals)]`
  - [x] Give it a tracking issue number
- [x] Lift sized checks in typeck and MIR-borrowck
  - [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR
- [x] Minimum working codegen
- [x] Add more examples and fill in unimplemented codegen paths
- [ ] <del>Loosen object-safety rules (will be another PR)</del>
- [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del>
- [ ] <del>Reduce temporaries (will be another PR)</del>
2018-08-19 12:21:56 +00:00
Dan Callaghan
99bba340f7 update lld submodule to include RISCV patch
This pulls in one new commit, to add support for linking static RISCV
binaries, suitable for the new riscv32imac-unknown-none-elf target.
See: https://github.com/rust-lang/lld/pull/1
2018-08-19 21:26:05 +10:00
Jorge Aparicio
98e4cd50f9 fix: use detected MSVC's link.exe 2018-08-19 12:35:58 +02:00
bors
8928de7439 Auto merge of #52972 - RalfJung:from_raw_parts_align, r=alexcrichton
debug_assert to ensure that from_raw_parts is only used properly aligned

This does not help nearly as much as I would hope because everybody uses the distributed libstd which is compiled without debug assertions. For this reason, I am not sure if this is even worth it. OTOH, this would have caught the misalignment fixed by https://github.com/rust-lang/rust/issues/42789 *if* there had been any tests actually using ZSTs with alignment >1 (we have a CI runner which has debug assertions in libstd enabled), and it seems to currently [fail in the rg testsuite](https://ci.appveyor.com/project/rust-lang/rust/build/1.0.8403/job/v7dfdcgn8ay5j6sb). So maybe it is worth it, after all.

I have seen the attribute `#[rustc_inherit_overflow_checks]` in some places, does that make it so that the *caller's* debug status is relevant? Is there a similar attribute for `debug_assert!`? That could even subsume `rustc_inherit_overflow_checks`: Something like `rustc_inherit_debug_flag` could affect *all* places that change the generated code depending on whether we are in debug or release mode. In fact, given that we have to keep around the MIR for generic functions anyway, is there ever a reason *not* to handle the debug flag that way? I guess currently we apply debug flags like `cfg` so this is dropped early during the MIR pipeline?

EDIT: I learned from @eddyb that because of how `debug_assert!` works, this is not realistic. Well, we could still have it for the rustc CI runs and then maybe, eventually, when libstd gets compiled client-side and there is both a debug and a release build... then this will also benefit users.^^
2018-08-19 09:40:36 +00:00
Jorge Aparicio
c8ef8b6602 LinkerFlavor::Gcc defaults to cc, not gcc 2018-08-19 09:39:19 +02:00
Masaki Hara
c488d59add Integrate OperandValue::UnsizedRef into OperandValue::Ref. 2018-08-19 08:07:33 +09:00
Masaki Hara
6e15e7c126 Integrate PassMode::UnsizedIndirect into PassMode::Indirect. 2018-08-19 08:07:33 +09:00
Masaki Hara
a0c422a752 Remove a now-unnecessary paragraph.
The paragraph described a case where we can't optimize away repetitive
dynamic stack allocation. However, as arielb1 pointed out, it can
actually optimizable by dynamically delaying the stack unwinding.
2018-08-19 08:07:33 +09:00
Masaki Hara
438edc3d5e Update the unstable book regarding [e; dyn n]. 2018-08-19 08:07:33 +09:00
Masaki Hara
c72e87e30a Add an unstable-book article about unsized_locals. 2018-08-19 08:07:33 +09:00
Masaki Hara
800f2c13a3 Implement simple codegen for unsized rvalues. 2018-08-19 08:07:33 +09:00
Masaki Hara
e2b95cb70e Lift some Sized checks. 2018-08-19 08:07:33 +09:00
Masaki Hara
7f05304068 Add #![feature(unsized_locals)]. 2018-08-19 08:07:33 +09:00
Masaki Hara
cd0476a390 Add Builder::array_alloca. 2018-08-19 08:06:42 +09:00
Masaki Hara
9f0168a9f3 Add notes on unsized argument errors. 2018-08-19 08:06:42 +09:00
ftilde
d6426e8a25 Exec gdb and lldb in rust-* wrappers
This way the process we get by calling rust-{gdb,lldb} is an actual
{gdb,lldb} instance and not (perhaps surprisingly) a script waiting for
the debugger process to finish. Thus, sending a SIGINT to the spawned
process stops execution of the child, for example.
2018-08-19 00:00:00 +02:00
ftilde
73b5c7eda2 Avoid creation of command temp file in rust-lldb
Arguments are passed on the command line via --one-line-before-file
(instead of in a file via --source-before-file) to lldb.
2018-08-19 00:00:00 +02:00
bors
a9fe312b98 Auto merge of #52592 - eddyb:or-default, r=Mark-Simulacrum
Use the new Entry::or_default method where possible.
2018-08-18 21:58:37 +00:00
bors
33b923fd44 Auto merge of #53324 - alexreg:self_in_typedefs, r=eddyb
`Self` in type definitions (self_in_typedefs)

This implements the [`self_in_typedefs` feature](https://github.com/rust-lang/rfcs/blob/master/text/2300-self-in-typedefs.md) ([tracking issue 49303](https://github.com/rust-lang/rust/issues/49303)).

r? @eddyb

CC @Centril
2018-08-18 19:34:24 +00:00
Jorge Aparicio
4bbedd7dd2 fully implement lld-flavor 2018-08-18 20:16:04 +02:00