Commit Graph

72943 Commits

Author SHA1 Message Date
Niko Matsakis
cba4732b65 introduce a NiceRegionError type and define methods on that
This is more convenient, and allows us to be more independent from
infcx, particularly with respect to `in_progress_tables` field.

No functional change.
2017-12-20 14:38:11 -05:00
Niko Matsakis
a28ab84025 nice_region_error: rustfmt 2017-12-20 14:38:11 -05:00
Niko Matsakis
3720242c75 extract find_anon_type into its own module 2017-12-20 14:38:11 -05:00
Niko Matsakis
93498e0c22 make util fns private to nice_region_error 2017-12-20 14:38:11 -05:00
Niko Matsakis
4089d140e0 move nice-region-error reporting into its own module 2017-12-20 14:38:11 -05:00
Niko Matsakis
e28d03f38b only dump causes if we have nothing better 2017-12-20 14:38:11 -05:00
Santiago Pastorino
3a185a510d Add three point error handling to borrowck
Closes #45988
2017-12-20 14:38:10 -05:00
Niko Matsakis
6d2987ca03 Move categorize logic out of visit_local function 2017-12-20 14:38:10 -05:00
Santiago Pastorino
58b0506d65 Move MirVisitable to visit.rs 2017-12-20 14:38:10 -05:00
Niko Matsakis
93afb1affc connect NLL type checker to the impl trait code
We now add the suitable `impl Trait` constraints.
2017-12-20 14:04:52 -05:00
Niko Matsakis
da63aaa7ab extract input_output code into its own module
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
a66c6512aa pass UniversalRegions to MIR type-checker instead of fields
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
7f50e7ca85 extract the writeback code for anon types into InferCtxt
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
8e64ba83be extract constrain_anon_types to the InferCtxt
No funtional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
e96f4be03d extract instantiate_anon_types to the InferCtxt
No functional change.
2017-12-20 14:04:51 -05:00
Niko Matsakis
4a967c9df7 propagate region_bound_pairs into MIR type-check 2017-12-20 14:04:51 -05:00
Niko Matsakis
fe89f4ba86 get the DefiningTy from the body_owner_kind not type
The type isn't a good idea because we want to treat constants
uniformly, regardless of what type of value they produce.
2017-12-20 14:04:51 -05:00
Niko Matsakis
0e64a756f8 integrate -Znll-dump-cause into borrowck 2017-12-20 14:04:51 -05:00
Niko Matsakis
741ef41e41 use Rc to store nonlexical_regioncx in Borrows 2017-12-20 14:04:51 -05:00
Niko Matsakis
594c386549 dump out causal information for "free region" errors
The result is not especially illuminating, but that's ok.
2017-12-20 14:04:51 -05:00
Niko Matsakis
39b0e49ebd rustfmt: borrow_check/mod.rs 2017-12-20 14:04:51 -05:00
Paul Daniel Faria
e447b54bc3 Add tracking of causes for nll 2017-12-20 14:04:50 -05:00
Niko Matsakis
f6741d0a7a region_infer/values.rs: rustfmt 2017-12-20 14:04:50 -05:00
Niko Matsakis
f3335c6169 simplify AnonTypeDecl in the impl trait code
We don't need to know the vector of region bounds; we only care if
there were any region bounds at all.
2017-12-20 14:04:50 -05:00
Esteban Küber
eed98d55fb Various tweaks 2017-12-20 11:03:26 -08:00
bors
7eb64b86ce Auto merge of #46583 - scottmcm:fix-static-i128-lower, r=eddyb
Fix -Z lower_128bit_ops handling of statics

Avoids ICEs such as the following:
>  error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131:
>  get_optimized_mir: missing MIR for `DefId(8/0:40 ~
>  compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])`

r? @nagisa

cc #45676 @est31
2017-12-20 17:34:17 +00:00
Felix S. Klock II
a0e1d509ab Ensure separate activations only occur for assignments to locals, not projections.
Fix #46746.
2017-12-20 18:15:33 +01:00
Guillaume Gomez
8835289434 Fix some rustdoc warnings 2017-12-20 17:50:02 +01:00
Manish Goregaokar
52c28fffa9 Clarify vec docs on deallocation (fixes #46879) 2017-12-20 08:29:32 -08:00
Michael Woerister
44a0522b18 incr.comp.: Use ensure() for some coherence-related queries. 2017-12-20 16:45:23 +01:00
Michael Woerister
dba52ced4c incr.comp.: Cache check_match query. 2017-12-20 16:38:27 +01:00
Michael Woerister
8ac65af81f Implement Encodable and Decodable for Result. 2017-12-20 16:37:29 +01:00
bors
81622c6b02 Auto merge of #46874 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #46359, #46517, #46671, #46751, #46760, #46787, #46794, #46828, #46831, #46835, #46851, #46852, #46856, #46870
- Failed merges:
2017-12-20 14:47:21 +00:00
Marco A L Barbosa
1470e77426 Update compiler_builtins
Fixes https://github.com/rust-lang/rust/issues/46822
(https://github.com/rust-lang-nursery/compiler-builtins/pull/218)
2017-12-20 11:46:15 -02:00
Matti Niemenmaa
8dfc47a4c9 MIR: terminate unreachable blocks in construct_const
Fixes #46843.

#45821 added unreachable blocks in matches, which were terminated in
construct_fn but not in construct_const, causing a panic due to "no
terminator on block" when constants involved matching on enums.

The "unimplemented expression type" error may go away in the future, the
key is that we see the E0015 about using a non-const function and then
don't ICE.
2017-12-20 15:37:17 +02:00
kennytm
66e5c79068 Rollup merge of #46870 - ffflorian:fix/slice/typo, r=rkruppe
docs(slice): Clarification in binary_search_by

This PR ~fixes a small comment typo~ adds some clarification to a half-open interval in the `binary_search_by` function in `slice`.
2017-12-20 21:22:05 +08:00
kennytm
94b864ccd0 Rollup merge of #46856 - estebank:missing-in-impl-def-span, r=arielb1
Point at def span in "missing in impl" error
2017-12-20 21:22:04 +08:00
kennytm
5efa045bbe Rollup merge of #46852 - scottmcm:asm-placecontext, r=arielb1
Split PlaceContext::Store into Store & AsmOutput

Outputs in InlineAsm can be read-write, so splitting it out is useful for things like Store-Store folding, as that's unsound for a Store-AsmOutput.

This PR is intended to make no changes, just be the mechanical split of the enum.  Future changes can use the split, like a MIR pass I'm working on and perhaps two-phase borrows (see this FIXME: https://github.com/rust-lang/rust/pull/46852/files#diff-74dcd7740ab2104cd2b9a3b68dd4f208R543)
2017-12-20 21:22:03 +08:00
kennytm
0c29c7b1e4 Rollup merge of #46851 - petrochenkov:tospace, r=estebank
Fix whitespacing issues in pretty-printing of bounds

cc https://github.com/rust-lang/rust/pull/46827#discussion_r157603277
2017-12-20 21:22:02 +08:00
kennytm
99fdca077c Rollup merge of #46835 - topecongiro:bad-span-for-macro-invocation-in-type, r=petrochenkov
Remove a token after closing delimiter from the span of macro in type position

e.g.
```rust
let x = y: foo!();
```
The span for `foo!()` includes `;`.

cc https://github.com/rust-lang-nursery/rustfmt/issues/2290.
2017-12-20 21:22:00 +08:00
kennytm
16095b3601 Rollup merge of #46831 - Diggsey:float-debug-fmt, r=dtolnay
Always `Debug` floats with a decimal point

Fixes #30967

r? @dtolnay
2017-12-20 21:21:59 +08:00
kennytm
5e98112af4 Rollup merge of #46828 - vi:hash_for_systemtime_instant, r=dtolnay
Add Hash impl for SystemTime and Instant

Closes #46670.

Not sure how to actually test non-Linux platforms.
`rustc --target=i686-pc-windows-gnu --crate-name std --crate-type rlib src/libstd/lib.rs -o q.rlib` works a bit, but for Redox I'm not sure what to do.

r? @dtolnay
2017-12-20 21:21:58 +08:00
kennytm
f35bb15fc6 Rollup merge of #46794 - Sh4rK:distribute-intrinsic-natvis, r=estebank
Distribute intrinsic.natvis with the compiler for windows-msvc.

This adds `intrinsic.natvis` to the `windows-msvc` distributions of Rust, enabling the visualization of `str` and slices in the VS debugger. Two other natvis files are already included, this was probably just an oversight.

I also updated `rust-windbg.cmd` to load this file as well.
2017-12-20 21:21:57 +08:00
kennytm
cc3f4357d3 Rollup merge of #46787 - varkor:contrib-6, r=QuietMisdreavus
Add an option to allow rustdoc to list modules by appearance

The `--sort-modules-by-appearance` option will list modules in the
order that they appear in the source, rather than sorting them
alphabetically (as is the default). This resolves #8552.
2017-12-20 21:21:56 +08:00
kennytm
1d57459fc9 Rollup merge of #46760 - semarie:openbsd-arm64, r=alexcrichton
add aarch64-unknown-openbsd support

- make liblibc to point to libc with aarch64-unknown-openbsd
- make c_char (in std::os::raw) to point to right value

r? @alexcrichton

currently, I have only tested in crosscompilation environement (openbsd x64_64 -> openbsd aarch64). it produces valid binaries.
2017-12-20 21:21:55 +08:00
kennytm
4d9ed87437 Rollup merge of #46751 - michaelwoerister:c-incremental, r=alexcrichton
incr.comp.: Add `-C incremental` in addition to `-Z incremental`

This PR adds a stable commandline option for invoking incremental compilation.

r? @alexcrichton
2017-12-20 21:21:54 +08:00
kennytm
76e2cc56e2 Rollup merge of #46671 - varkor:contrib-2, r=KodrAus
Reject superfluous `::` in IPv6 addresses

Fixes #46263.
2017-12-20 21:21:53 +08:00
kennytm
c3241b504f Rollup merge of #46517 - notriddle:patch-2, r=BurntSushi
Stablize RefCell::{replace, swap}

RefCell::replace_with is not stablized in this PR, since it wasn't part of the RFC.

CC #43570
2017-12-20 21:21:51 +08:00
kennytm
8de81966cd Rollup merge of #46359 - GuillaumeGomez:remove-dead-linkage, r=QuietMisdreavus
Do not display hidden types, fixes issue 23912

Fixes #23912.

r? @QuietMisdreavus

(It's the one I was talking about a few days ago, just close it if it's useless.)
2017-12-20 21:21:50 +08:00
Michael Woerister
b2f72394ce incr.comp.: Replace Fingerprint::zero() with a constant. 2017-12-20 14:06:11 +01:00