Commit graph

72663 commits

Author SHA1 Message Date
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
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
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
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
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
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
Niko Matsakis
1816ede386 be specific about what kind of normalization we mean 2017-12-19 04:28:45 -05:00
Niko Matsakis
3d826e5681 remove dead is_foo_free_region helpers
Only `is_local_free_region` is used.
2017-12-19 04:26:56 -05:00
Niko Matsakis
3c56c3610e fix comment on check_type_tests 2017-12-19 04:21:57 -05:00
Niko Matsakis
03bfb0f316 tweak comment on TypeTest to be more accurate 2017-12-19 04:18:15 -05:00
bors
a9f047c048 Auto merge of #46664 - mikeyhew:raw_pointer_self, r=arielb1
arbitrary_self_types: add support for raw pointer `self` types

This adds support for raw pointer `self` types, under the `arbitrary_self_types` feature flag. Types like `self: *const Self`, `self: *const Rc<Self>`, `self: Rc<*const Self` are all supported. Object safety checks are updated to allow`self: *const Self` and `self: *mut Self`.

This PR does not add support for `*const self` and `*mut self` syntax. That can be added in a later PR once this code is reviewed and merged.

#44874

r? @arielb1
2017-12-19 07:05:05 +00:00
bors
c8b94c6aa1 Auto merge of #46829 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests

- Successful merges: #46700, #46786, #46790, #46800, #46801, #46802, #46804, #46805, #46812, #46824, #46825
- Failed merges:
2017-12-19 04:21:05 +00:00
Diggory Blake
3e98f18280 Always print floats with a decimal point with the Debug formatter 2017-12-19 01:35:35 +00:00
bors
b76f224af8 Auto merge of #45525 - MaikKlein:collector, r=eddyb
Move collector to librustc_mir::monomorphize

cc https://github.com/rust-lang/rust/issues/44334 and https://github.com/rust-lang/rust/issues/45276

* I moved the collector to rustc_mir

*  I renamed `TransItem` to `MonoItem`. _(I still need to fix up comments and variable names)_

* I got rid of `common.rs` and `monomorphize.rs` from `librustc_trans_utils`. I moved most of the functionality into `TyCtxt`. I realized that the `librustc_trans_utils::common.rs` was just copy pasted from `librustc_trans::common.rs`.

Should I also get rid of the `librustc_trans::common.rs` in this PR? Most of the functionality seems a bit useless, I decided to put some of it into `TyCtxt` but maybe that is not the correct action here.

Should I also get rid of `librustc_trans_utils` completely here? Or should I do it in a separate PR?
2017-12-19 01:34:50 +00:00
varkor
b3c6102be3 Add a test for --sort-modules-by-appearance 2017-12-19 01:05:06 +00:00
Guillaume Gomez
b5f6884aeb Rollup merge of #46825 - GuillaumeGomez:mobile-search, r=QuietMisdreavus
Improve search display on mobile

r? @QuietMisdreavus
2017-12-18 23:08:41 +01:00
Guillaume Gomez
25e5af8a27 Rollup merge of #46824 - GuillaumeGomez:doc-sidebar, r=QuietMisdreavus
Fix dynamic crates listing in doc sidebar

Fixes #46687.

r? @QuietMisdreavus
2017-12-18 23:08:40 +01:00
Guillaume Gomez
c68c4b510c Rollup merge of #46812 - kennytm:fix-align-offset-sign, r=petrochenkov
Fix the wrong subtraction in align_offset intrinsic.

Given how the stage0 implementation in #43903 is written, as well as that in the RFC, I suppose the current implementation has a typo.

cc #44488, cc @oli-obk.
2017-12-18 23:08:39 +01:00
Guillaume Gomez
325d9fb8f6 Rollup merge of #46805 - estebank:unnecessary-unsafe-spans, r=arielb1
Tweak "unecessary unsafe block" error spans
2017-12-18 23:08:38 +01:00
Guillaume Gomez
3a2becbd84 Rollup merge of #46804 - estebank:conflicting-impl-def-span, r=arielb1
Use def span for conflicting impls and recursive fn
2017-12-18 23:08:37 +01:00
Guillaume Gomez
015502c4c5 Rollup merge of #46802 - estebank:redefined-def-span, r=michaelwoerister
Point at def span on redefined name diagnostic
2017-12-18 23:08:35 +01:00
Guillaume Gomez
12cd45286e Rollup merge of #46801 - estebank:impl-extra-req-def-span, r=arielb1
Point at def span in "impl has stricter requirements" diagnostic
2017-12-18 23:08:34 +01:00
Guillaume Gomez
6cc58b3fe8 Rollup merge of #46800 - estebank:expected-closure-def-span, r=arielb1
Rework expected closure error

* point at def span
* add label to primary span
* use `span_label`s instead of `span_note`s
2017-12-18 23:08:33 +01:00
Guillaume Gomez
c0a547a51e Rollup merge of #46790 - frewsxcv:frewsxcv-swap-bytes, r=QuietMisdreavus
Display binary notation for numeric swap_bytes methods.

This better illustrates what's happening to the bits behind the scenes.
2017-12-18 23:08:32 +01:00
Guillaume Gomez
723190752b Rollup merge of #46786 - GuillaumeGomez:fix-sized-rendering, r=QuietMisdreavus
Fix ?Sized where bound not being displayed at the correct place

Fixes #46726.

r? @QuietMisdreavus
2017-12-18 23:08:31 +01:00
Guillaume Gomez
9ab2227db1 Rollup merge of #46700 - GuillaumeGomez:more-relevant-doc-search, r=QuietMisdreavus
make doc search more relevant

Fixes #46595.

r? @QuietMisdreavus

If possible, I'd appreciate a strong check on this PR. :3
2017-12-18 23:08:30 +01:00
Guillaume Gomez
03530ee1a7 Add tests for hidden types 2017-12-18 23:07:19 +01:00
Vitaly _Vi Shukela
1d5ead453d
Add Hash impl for SystemTime and Instant
Closes #46670.
2017-12-19 00:35:43 +03:00
Guillaume Gomez
3d4c505078 Improve search display on mobile 2017-12-18 22:30:53 +01:00
bors
e7db42fb5b Auto merge of #46808 - eddyb:issue-46769-quick, r=arielb1
rustc: ensure optimized enums have a properly aligned size.

Fixes #46769 by padding the optimized enums wrapping packed data as necessary.

Note that this is not the only way to solve this - on nightly, #46436 makes it easier to fix without adding new padding because of the replacement of `packed` flags with a non-redundant scheme.
But because it can't be backported, the optimal fix will be in a separate nightly-only PR (#46809).
2017-12-18 20:44:18 +00:00
Guillaume Gomez
cf18b1f22a Fix dynamic crates listing in doc sidebar 2017-12-18 21:15:46 +01:00
varkor
c0ff8144c4 Fix tidy issue 2017-12-18 19:52:45 +00:00
Eduard-Mihai Burtescu
087f1c23a7 rustc: ensure optimized enums have a properly aligned size. 2017-12-18 21:31:52 +02:00
Esteban Küber
e1dc7ac33c Tweak "unecessary unsafe block" error spans 2017-12-18 11:11:35 -08:00
Maik Klein
6e78b66578 Add rustc_data_structures for trans_utils/lib.rs 2017-12-18 19:10:06 +02:00
Maik Klein
c847cf3f5e Fix incorrect rebase in collector::find_vtable_types 2017-12-18 19:10:01 +02:00
Esteban Küber
0555d256dd Rework expected closure error
* point at def span
* add label to primary span
* use `span_label`s instead of `span_note`s
2017-12-18 08:55:52 -08:00
Esteban Küber
c08dab841d Point at def span in "impl has stricter requirements" diagnostic 2017-12-18 08:54:20 -08:00