Commit Graph

72857 Commits

Author SHA1 Message Date
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
bors
df8dfdeff6 Auto merge of #46457 - m4b:no_mangle_static, r=michaelwoerister
Don't set the linkage_name for static variables

For `no_mangle` statics:

1. Linkage_name no longer set
2. The static variable also no longer has a dwarf namespace scope

This matches C++ output, which does not set the linkage_name and is not scoped:

e.g. c++:

```
0x000000b6:   DW_TAG_base_type [8]
                DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000077] = "long int")
                DW_AT_encoding [DW_FORM_data1]  (DW_ATE_signed)
                DW_AT_byte_size [DW_FORM_data1] (0x08)

0x000000bd:   DW_TAG_variable [9]
                DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000053] = "TEST")
                DW_AT_type [DW_FORM_ref4]       (cu + 0x0048 => {0x00000048})
                DW_AT_external [DW_FORM_flag_present]   (true)
                DW_AT_decl_file [DW_FORM_data1] ("/home/m4b/tmp/bad_debug/test.cpp")
                DW_AT_decl_line [DW_FORM_data1] (14)
                DW_AT_location [DW_FORM_exprloc]        (<0x9> 03 40 10 20 00 00 00 00 00 )

0x000000d2:   DW_TAG_namespace [2] *
                DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000009d] = "std")

```

and (now) Rust:

```
0x0000002a:   DW_TAG_variable [2]
                DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000046] = "TEST")
                DW_AT_type [DW_FORM_ref4]       (cu + 0x0045 => {0x00000045})
                DW_AT_external [DW_FORM_flag_present]   (true)
                DW_AT_decl_file [DW_FORM_data1] ("/tmp/test.rs")
                DW_AT_decl_line [DW_FORM_data1] (8)
                DW_AT_alignment [DW_FORM_udata] (1)
                DW_AT_location [DW_FORM_exprloc]        (<0x9> 03 c0 4d 06 00 00 00 00 00 )

0x00000040:   DW_TAG_namespace [3] *
                DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000004b] = "test")
```
2017-12-20 12:03:25 +00:00
Florian Keller
f6ab79d1aa
docs(slice): Clarify half-open interval 2017-12-20 11:43:49 +01:00
Michael Woerister
e6e5589db4 incr.comp.: Use an IndexVec instead of a hashmap for storing result hashes. 2017-12-20 11:14:31 +01:00
bors
16212b9367 Auto merge of #46508 - clarcharr:duration_extras, r=sfackler
Add more Duration methods for consistency.

Follow-up to #46507.
2017-12-20 09:13:56 +00:00
bors
6dbf0ba691 Auto merge of #46233 - SimonSapin:fmt-debuglist-flags, r=sfackler
Make fmt::DebugList and friends forward formatting parameters

For example, formatting slice of integers with `{:04?}` should zero-pad each integer.

This also affects every use of `#[derive(Debug)]`.
2017-12-20 06:38:15 +00:00
m4b
500dc14b21 dwarf: do not set linkage_name for no mangle statics, and do not have a scope. ref #33172 2017-12-19 21:18:24 -08:00
bors
588f7db8ef Auto merge of #46733 - nikomatsakis:nll-master-to-rust-master-5, r=arielb1
nll part 5

Next round of changes from the nll-master branch.

Extensions:

- we now propagate ty-region-outlives constraints out of closures and into their creator when necessary
- we fix a few ICEs that can occur by doing liveness analysis (and the resulting normalization) during type-checking
- we handle the implicit region bound that assumes that each type `T` outlives the fn body
- we handle normalization of inputs/outputs in fn signatures

Not included in this PR (will come next):

- handling `impl Trait`
- tracking causal information
- extended errors

r? @arielb1
2017-12-20 03:58:15 +00:00
Esteban Küber
8749250327 Use a label for catch-all pattern instead of note 2017-12-19 19:11:02 -08:00
Esteban Küber
3480f6f068 Closure type error ui tweak
Do not point at the same span on all notes/help messages, and instead
show them without a span.
2017-12-19 19:04:09 -08:00
Eduard-Mihai Burtescu
5c3dcfaf85 rustc: do not raise the alignment of optimized enums to the niche's alignment. 2017-12-20 03:45:40 +02:00
bors
edbd7d232e Auto merge of #46441 - gaurikholkar:single_lifetimes, r=nikomatsakis
Lint against single-use lifetime names

This is a fix for #44752

TO-DO

- [x] change lint message
- [x] add ui tests

r? @nikomatsakis
2017-12-20 01:18:17 +00:00
Guillaume Gomez
7f5c2f9249 Fix sidebar on ios 2017-12-20 01:53:18 +01:00
Esteban Küber
e9f4fc8d40 Point at while true span instead of entire block 2017-12-19 15:48:46 -08:00
Esteban Küber
e70d888103 Use def span for associated function suggestions 2017-12-19 15:36:04 -08:00
Taylor Cramer
1d5977b899 Ignore pretty printing tests for non_modrs_mods 2017-12-19 15:24:51 -08:00
Jonathan S
c1fe4a22b9 Only mark unions as uninhabited if all of their fields are uninhabited. Fixes #46845. 2017-12-19 17:24:38 -06:00
Taylor Cramer
e3c229802f Break rls 2017-12-19 14:59:14 -08:00
Taylor Cramer
b82e2e9db1 Break rustfmt 2017-12-19 14:59:13 -08:00
Taylor Cramer
07f51fb868 Implement non-mod.rs mod statements 2017-12-19 14:58:51 -08:00
QuietMisdreavus
cbbb73b56f add compile-fail error for external_doc errors 2017-12-19 16:50:53 -06:00
QuietMisdreavus
f873c55709 test for missing_doc in the external_doc test 2017-12-19 16:43:46 -06:00
QuietMisdreavus
95b87d18c0 add files loaded through doc(include) into dep-info 2017-12-19 16:43:32 -06:00
Esteban Küber
3441ffb15e Point at def span in "missing in impl" error 2017-12-19 14:41:03 -08:00
Scott McMurray
fb245e0540 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 it cannot be done 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.
2017-12-19 17:05:14 -05:00
QuietMisdreavus
8fc0d47581 make the missing_docs lint check for doc(include) 2017-12-19 15:25:06 -06:00
Vadim Petrochenkov
7a95e716c7 Fix whitespacing issues in pretty-printing of bounds 2017-12-20 00:23:18 +03:00
QuietMisdreavus
06fbd599cf turn errors with external docs into actual errors 2017-12-19 15:04:03 -06:00
Scott McMurray
4b95ca8db2 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])`
2017-12-19 15:08:17 -05:00
Niko Matsakis
e741dad629 adding lint for single use lifetime names 2017-12-20 00:07:10 +05:30
Seiichi Uchida
e0e62fccd2 Fix up an ui test 2017-12-20 01:21:40 +09:00
varkor
3a29f2878f Fix a compile_input test 2017-12-19 15:03:37 +00:00
Michael Woerister
0258c6daca incr.comp.: Precompute small hash for filenames to save some work. 2017-12-19 15:27:50 +01:00
Felix S. Klock II
aa030dd3de Followup for #46112.
Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR #46708 (which was my original fix to #46112).
2017-12-19 15:04:02 +01:00
topecongiro
7374fdcf54 Remove a token after closing delimiter from the span of macro in type position 2017-12-19 21:18:30 +09:00
bors
b39c4bc123 Auto merge of #46749 - SimonSapin:exorcism, r=nikomatsakis
Move PhantomData<T> from Shared<T> to users of both Shared and #[may_dangle]

After discussing https://github.com/rust-lang/rust/issues/27730#issuecomment-316432083 today with @pnkfelix and @Gankro, we concluded that it’s ok for drop checking not to be much smarter than the current `#[may_dangle]` design which requires an explicit unsafe opt-in.
2017-12-19 10:50:15 +00:00