]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoMir: fixup nits in previous commit (f536143)
David Henningsson [Thu, 21 Dec 2017 18:32:26 +0000 (19:32 +0100)]
Mir: fixup nits in previous commit (f536143)

As suggested by arielb1.

Closes rust-lang/rust#18510

Signed-off-by: David Henningsson <diwic@ubuntu.com>
6 years agoMir: Abort on nounwind ABIs
David Henningsson [Tue, 19 Dec 2017 00:59:29 +0000 (01:59 +0100)]
Mir: Abort on nounwind ABIs

Generate Abort instead of Resume terminators on nounwind ABIs.

https://github.com/rust-lang/rust/issues/18510

Signed-off-by: David Henningsson <diwic@ubuntu.com>
6 years agoMir: Add Terminatorkind::Abort
David Henningsson [Tue, 19 Dec 2017 00:17:16 +0000 (01:17 +0100)]
Mir: Add Terminatorkind::Abort

The Abort Terminatorkind will cause an llvm.trap function call to be
emitted.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
6 years agoAuto merge of #46862 - nikomatsakis:nll-master, r=arielb1
bors [Wed, 20 Dec 2017 23:26:20 +0000 (23:26 +0000)]
Auto merge of #46862 - nikomatsakis:nll-master, r=arielb1

NLL feature complete (adds `feature(nll)`)!

This is the final PR for the nll-master branch; it brings over all remaining content.

The contents of the branch include:

- track causal information and use it to report extended errors
- handle `impl Trait` in NLL code
- improve printing of outlives errors
- add `#![feature(nll)]` and some more sample tests

The commits should for the most part build independently.

r? @pnkfelix (and/or @arielb1)

6 years agofix truncated comment
Niko Matsakis [Wed, 20 Dec 2017 21:51:33 +0000 (16:51 -0500)]
fix truncated comment

6 years agoimprove comment about instantiating anon types
Niko Matsakis [Wed, 20 Dec 2017 21:48:41 +0000 (16:48 -0500)]
improve comment about instantiating anon types

6 years agoconvert region-liveness-drop{-,-no-}may-dangle.rs into ui tests
Niko Matsakis [Wed, 20 Dec 2017 16:20:07 +0000 (11:20 -0500)]
convert region-liveness-drop{-,-no-}may-dangle.rs into ui tests

The "match exact bits of CFG" approach was fragile and uninformative.

6 years agoadd some run-pass tests for NLL showing that things work as expected
Niko Matsakis [Thu, 7 Dec 2017 22:38:15 +0000 (17:38 -0500)]
add some run-pass tests for NLL showing that things work as expected

6 years agowhen using feature(nll), don't warn about AST-based region errors
Niko Matsakis [Wed, 20 Dec 2017 09:54:35 +0000 (04:54 -0500)]
when using feature(nll), don't warn about AST-based region errors

Also, keep reporting AST-based region errors that are not occuring in
a fn body.

6 years agodocument and tweak the nll, use_mir, etc helpers
Niko Matsakis [Wed, 20 Dec 2017 09:26:54 +0000 (04:26 -0500)]
document and tweak the nll, use_mir, etc helpers

In particular, -Znll might as well imply -Zborrowck=mir by default,
just like `#![feature(nll)]` does.

Also, if NLL is in use, no reason to emit end regions. The NLL pass
just strips them out anyway.

6 years agofeature nll implies borrowck=mir
Santiago Pastorino [Tue, 19 Dec 2017 18:47:59 +0000 (15:47 -0300)]
feature nll implies borrowck=mir

6 years agofeature nll implies two-phase-borrows
Santiago Pastorino [Tue, 19 Dec 2017 18:28:13 +0000 (15:28 -0300)]
feature nll implies two-phase-borrows

6 years agoAdd nll feature and make nll imply nll_dump_cause
Santiago Pastorino [Tue, 19 Dec 2017 18:10:07 +0000 (15:10 -0300)]
Add nll feature and make nll imply nll_dump_cause

6 years agoAdd nll_dump_cause helper to Session
Santiago Pastorino [Tue, 19 Dec 2017 18:08:40 +0000 (15:08 -0300)]
Add nll_dump_cause helper to Session

6 years agouse `report_generic_bound_failure` when we can in the compiler
Niko Matsakis [Tue, 19 Dec 2017 16:12:56 +0000 (11:12 -0500)]
use `report_generic_bound_failure` when we can in the compiler

6 years agorefactor `report_generic_bound_failure` to be usable by NLL code
Niko Matsakis [Tue, 19 Dec 2017 16:10:53 +0000 (11:10 -0500)]
refactor `report_generic_bound_failure` to be usable by NLL code

6 years agoconnect NLL machinery to the `NiceRegionError` code
Niko Matsakis [Tue, 12 Dec 2017 14:06:35 +0000 (09:06 -0500)]
connect NLL machinery to the `NiceRegionError` code

6 years agogive precedence to `try_report_named_anon_conflict` method
Niko Matsakis [Tue, 12 Dec 2017 14:05:54 +0000 (09:05 -0500)]
give precedence to `try_report_named_anon_conflict` method

6 years agouse `Option<ErrorReported>` instead of `bool`
Niko Matsakis [Tue, 12 Dec 2017 13:39:20 +0000 (08:39 -0500)]
use `Option<ErrorReported>` instead of `bool`

Also allows us to replace `or_false` with `?`.

No functional change

6 years agointroduce a `NiceRegionError` type and define methods on that
Niko Matsakis [Tue, 12 Dec 2017 13:31:38 +0000 (08:31 -0500)]
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.

6 years agonice_region_error: rustfmt
Niko Matsakis [Tue, 12 Dec 2017 13:04:29 +0000 (08:04 -0500)]
nice_region_error: rustfmt

6 years agoextract `find_anon_type` into its own module
Niko Matsakis [Tue, 12 Dec 2017 12:57:23 +0000 (07:57 -0500)]
extract `find_anon_type` into its own module

6 years agomake `util` fns private to nice_region_error
Niko Matsakis [Tue, 12 Dec 2017 12:54:45 +0000 (07:54 -0500)]
make `util` fns private to nice_region_error

6 years agomove nice-region-error reporting into its own module
Niko Matsakis [Tue, 12 Dec 2017 12:52:25 +0000 (07:52 -0500)]
move nice-region-error reporting into its own module

6 years agoonly dump causes if we have nothing better
Niko Matsakis [Thu, 14 Dec 2017 20:01:05 +0000 (15:01 -0500)]
only dump causes if we have nothing better

6 years agoAdd three point error handling to borrowck
Santiago Pastorino [Tue, 12 Dec 2017 20:29:37 +0000 (17:29 -0300)]
Add three point error handling to borrowck

Closes #45988

6 years agoMove categorize logic out of visit_local function
Niko Matsakis [Wed, 20 Dec 2017 19:36:56 +0000 (14:36 -0500)]
Move categorize logic out of visit_local function

6 years agoMove MirVisitable to visit.rs
Santiago Pastorino [Tue, 12 Dec 2017 14:59:09 +0000 (11:59 -0300)]
Move MirVisitable to visit.rs

6 years agoconnect NLL type checker to the impl trait code
Niko Matsakis [Sun, 10 Dec 2017 15:23:45 +0000 (10:23 -0500)]
connect NLL type checker to the impl trait code

We now add the suitable `impl Trait` constraints.

6 years agoextract `input_output` code into its own module
Niko Matsakis [Sun, 10 Dec 2017 14:56:13 +0000 (09:56 -0500)]
extract `input_output` code into its own module

No functional change.

6 years agopass `UniversalRegions` to MIR type-checker instead of fields
Niko Matsakis [Sun, 10 Dec 2017 14:55:43 +0000 (09:55 -0500)]
pass `UniversalRegions` to MIR type-checker instead of fields

No functional change.

6 years agoextract the writeback code for anon types into InferCtxt
Niko Matsakis [Sat, 9 Dec 2017 15:56:20 +0000 (10:56 -0500)]
extract the writeback code for anon types into InferCtxt

No functional change.

6 years agoextract `constrain_anon_types` to the `InferCtxt`
Niko Matsakis [Sat, 9 Dec 2017 11:36:10 +0000 (06:36 -0500)]
extract `constrain_anon_types` to the `InferCtxt`

No funtional change.

6 years agoextract `instantiate_anon_types` to the `InferCtxt`
Niko Matsakis [Sat, 9 Dec 2017 10:49:14 +0000 (05:49 -0500)]
extract `instantiate_anon_types` to the `InferCtxt`

No functional change.

6 years agopropagate `region_bound_pairs` into MIR type-check
Niko Matsakis [Fri, 8 Dec 2017 20:47:36 +0000 (15:47 -0500)]
propagate `region_bound_pairs` into MIR type-check

6 years agoget the `DefiningTy` from the `body_owner_kind` not type
Niko Matsakis [Fri, 8 Dec 2017 18:07:23 +0000 (13:07 -0500)]
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.

6 years agointegrate -Znll-dump-cause into borrowck
Niko Matsakis [Thu, 7 Dec 2017 16:21:29 +0000 (11:21 -0500)]
integrate -Znll-dump-cause into borrowck

6 years agouse Rc to store nonlexical_regioncx in Borrows
Niko Matsakis [Thu, 7 Dec 2017 09:30:39 +0000 (04:30 -0500)]
use Rc to store nonlexical_regioncx in Borrows

6 years agodump out causal information for "free region" errors
Niko Matsakis [Thu, 7 Dec 2017 09:30:15 +0000 (04:30 -0500)]
dump out causal information for "free region" errors

The result is not especially illuminating, but that's ok.

6 years agorustfmt: borrow_check/mod.rs
Niko Matsakis [Thu, 14 Dec 2017 12:33:29 +0000 (07:33 -0500)]
rustfmt: borrow_check/mod.rs

6 years agoAdd tracking of causes for nll
Paul Daniel Faria [Tue, 21 Nov 2017 23:03:47 +0000 (18:03 -0500)]
Add tracking of causes for nll

6 years agoregion_infer/values.rs: rustfmt
Niko Matsakis [Wed, 6 Dec 2017 22:13:39 +0000 (17:13 -0500)]
region_infer/values.rs: rustfmt

6 years agosimplify `AnonTypeDecl` in the impl trait code
Niko Matsakis [Wed, 6 Dec 2017 22:11:41 +0000 (17:11 -0500)]
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.

6 years agoAuto merge of #46583 - scottmcm:fix-static-i128-lower, r=eddyb
bors [Wed, 20 Dec 2017 17:34:17 +0000 (17:34 +0000)]
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

6 years agoAuto merge of #46874 - kennytm:rollup, r=kennytm
bors [Wed, 20 Dec 2017 14:47:21 +0000 (14:47 +0000)]
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:

6 years agoRollup merge of #46870 - ffflorian:fix/slice/typo, r=rkruppe
kennytm [Wed, 20 Dec 2017 13:22:05 +0000 (21:22 +0800)]
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`.

6 years agoRollup merge of #46856 - estebank:missing-in-impl-def-span, r=arielb1
kennytm [Wed, 20 Dec 2017 13:22:04 +0000 (21:22 +0800)]
Rollup merge of #46856 - estebank:missing-in-impl-def-span, r=arielb1

Point at def span in "missing in impl" error

6 years agoRollup merge of #46852 - scottmcm:asm-placecontext, r=arielb1
kennytm [Wed, 20 Dec 2017 13:22:03 +0000 (21:22 +0800)]
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)

6 years agoRollup merge of #46851 - petrochenkov:tospace, r=estebank
kennytm [Wed, 20 Dec 2017 13:22:02 +0000 (21:22 +0800)]
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

6 years agoRollup merge of #46835 - topecongiro:bad-span-for-macro-invocation-in-type, r=petroch...
kennytm [Wed, 20 Dec 2017 13:22:00 +0000 (21:22 +0800)]
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.

6 years agoRollup merge of #46831 - Diggsey:float-debug-fmt, r=dtolnay
kennytm [Wed, 20 Dec 2017 13:21:59 +0000 (21:21 +0800)]
Rollup merge of #46831 - Diggsey:float-debug-fmt, r=dtolnay

Always `Debug` floats with a decimal point

Fixes #30967

r? @dtolnay

6 years agoRollup merge of #46828 - vi:hash_for_systemtime_instant, r=dtolnay
kennytm [Wed, 20 Dec 2017 13:21:58 +0000 (21:21 +0800)]
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

6 years agoRollup merge of #46794 - Sh4rK:distribute-intrinsic-natvis, r=estebank
kennytm [Wed, 20 Dec 2017 13:21:57 +0000 (21:21 +0800)]
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.

6 years agoRollup merge of #46787 - varkor:contrib-6, r=QuietMisdreavus
kennytm [Wed, 20 Dec 2017 13:21:56 +0000 (21:21 +0800)]
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.

6 years agoRollup merge of #46760 - semarie:openbsd-arm64, r=alexcrichton
kennytm [Wed, 20 Dec 2017 13:21:55 +0000 (21:21 +0800)]
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.

6 years agoRollup merge of #46751 - michaelwoerister:c-incremental, r=alexcrichton
kennytm [Wed, 20 Dec 2017 13:21:54 +0000 (21:21 +0800)]
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

6 years agoRollup merge of #46671 - varkor:contrib-2, r=KodrAus
kennytm [Wed, 20 Dec 2017 13:21:53 +0000 (21:21 +0800)]
Rollup merge of #46671 - varkor:contrib-2, r=KodrAus

Reject superfluous `::` in IPv6 addresses

Fixes #46263.

6 years agoRollup merge of #46517 - notriddle:patch-2, r=BurntSushi
kennytm [Wed, 20 Dec 2017 13:21:51 +0000 (21:21 +0800)]
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

6 years agoRollup merge of #46359 - GuillaumeGomez:remove-dead-linkage, r=QuietMisdreavus
kennytm [Wed, 20 Dec 2017 13:21:50 +0000 (21:21 +0800)]
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.)

6 years agoAuto merge of #46457 - m4b:no_mangle_static, r=michaelwoerister
bors [Wed, 20 Dec 2017 12:03:25 +0000 (12:03 +0000)]
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")
```

6 years agodocs(slice): Clarify half-open interval
Florian Keller [Wed, 20 Dec 2017 10:43:49 +0000 (11:43 +0100)]
docs(slice): Clarify half-open interval

6 years agoAuto merge of #46508 - clarcharr:duration_extras, r=sfackler
bors [Wed, 20 Dec 2017 09:13:56 +0000 (09:13 +0000)]
Auto merge of #46508 - clarcharr:duration_extras, r=sfackler

Add more Duration methods for consistency.

Follow-up to #46507.

6 years agoAuto merge of #46233 - SimonSapin:fmt-debuglist-flags, r=sfackler
bors [Wed, 20 Dec 2017 06:38:15 +0000 (06:38 +0000)]
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)]`.

6 years agodwarf: do not set linkage_name for no mangle statics, and do not have a scope. ref...
m4b [Wed, 20 Dec 2017 05:18:24 +0000 (21:18 -0800)]
dwarf: do not set linkage_name for no mangle statics, and do not have a scope. ref #33172

6 years agoAuto merge of #46733 - nikomatsakis:nll-master-to-rust-master-5, r=arielb1
bors [Wed, 20 Dec 2017 03:58:15 +0000 (03:58 +0000)]
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

6 years agoAuto merge of #46441 - gaurikholkar:single_lifetimes, r=nikomatsakis
bors [Wed, 20 Dec 2017 01:18:17 +0000 (01:18 +0000)]
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

6 years agoPoint at def span in "missing in impl" error
Esteban Küber [Tue, 19 Dec 2017 22:41:03 +0000 (14:41 -0800)]
Point at def span in "missing in impl" error

6 years agoSplit PlaceContext::Store into Store & AsmOutput
Scott McMurray [Tue, 19 Dec 2017 22:05:14 +0000 (17:05 -0500)]
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.

6 years agoFix whitespacing issues in pretty-printing of bounds
Vadim Petrochenkov [Tue, 19 Dec 2017 20:40:17 +0000 (23:40 +0300)]
Fix whitespacing issues in pretty-printing of bounds

6 years agoFix -Z lower_128bit_ops handling of statics
Scott McMurray [Fri, 8 Dec 2017 11:00:05 +0000 (03:00 -0800)]
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])`

6 years agoadding lint for single use lifetime names
Niko Matsakis [Thu, 23 Nov 2017 13:05:58 +0000 (08:05 -0500)]
adding lint for single use lifetime names

6 years agoFix up an ui test
Seiichi Uchida [Tue, 19 Dec 2017 16:21:40 +0000 (01:21 +0900)]
Fix up an ui test

6 years agoRemove a token after closing delimiter from the span of macro in type position
topecongiro [Tue, 19 Dec 2017 08:54:39 +0000 (17:54 +0900)]
Remove a token after closing delimiter from the span of macro in type position

6 years agoAuto merge of #46749 - SimonSapin:exorcism, r=nikomatsakis
bors [Tue, 19 Dec 2017 10:50:15 +0000 (10:50 +0000)]
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.

6 years agobe specific about what kind of normalization we mean
Niko Matsakis [Tue, 19 Dec 2017 09:28:45 +0000 (04:28 -0500)]
be specific about what kind of normalization we mean

6 years agoremove dead `is_foo_free_region` helpers
Niko Matsakis [Tue, 19 Dec 2017 09:26:56 +0000 (04:26 -0500)]
remove dead `is_foo_free_region` helpers

Only `is_local_free_region` is used.

6 years agofix comment on `check_type_tests`
Niko Matsakis [Tue, 19 Dec 2017 09:21:57 +0000 (04:21 -0500)]
fix comment on `check_type_tests`

6 years agotweak comment on `TypeTest` to be more accurate
Niko Matsakis [Tue, 19 Dec 2017 09:18:15 +0000 (04:18 -0500)]
tweak comment on `TypeTest` to be more accurate

6 years agoAuto merge of #46664 - mikeyhew:raw_pointer_self, r=arielb1
bors [Tue, 19 Dec 2017 07:05:05 +0000 (07:05 +0000)]
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

6 years agoAuto merge of #46829 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 19 Dec 2017 04:21:05 +0000 (04:21 +0000)]
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:

6 years agoAlways print floats with a decimal point with the Debug formatter
Diggory Blake [Mon, 18 Dec 2017 23:16:00 +0000 (23:16 +0000)]
Always print floats with a decimal point with the Debug formatter

6 years agoAuto merge of #45525 - MaikKlein:collector, r=eddyb
bors [Tue, 19 Dec 2017 01:34:50 +0000 (01:34 +0000)]
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?

6 years agoAdd a test for `--sort-modules-by-appearance`
varkor [Tue, 19 Dec 2017 01:05:06 +0000 (01:05 +0000)]
Add a test for `--sort-modules-by-appearance`

6 years agoRollup merge of #46825 - GuillaumeGomez:mobile-search, r=QuietMisdreavus
Guillaume Gomez [Mon, 18 Dec 2017 22:08:41 +0000 (23:08 +0100)]
Rollup merge of #46825 - GuillaumeGomez:mobile-search, r=QuietMisdreavus

Improve search display on mobile

r? @QuietMisdreavus

6 years agoRollup merge of #46824 - GuillaumeGomez:doc-sidebar, r=QuietMisdreavus
Guillaume Gomez [Mon, 18 Dec 2017 22:08:40 +0000 (23:08 +0100)]
Rollup merge of #46824 - GuillaumeGomez:doc-sidebar, r=QuietMisdreavus

Fix dynamic crates listing in doc sidebar

Fixes #46687.

r? @QuietMisdreavus

6 years agoRollup merge of #46812 - kennytm:fix-align-offset-sign, r=petrochenkov
Guillaume Gomez [Mon, 18 Dec 2017 22:08:39 +0000 (23:08 +0100)]
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.

6 years agoRollup merge of #46805 - estebank:unnecessary-unsafe-spans, r=arielb1
Guillaume Gomez [Mon, 18 Dec 2017 22:08:38 +0000 (23:08 +0100)]
Rollup merge of #46805 - estebank:unnecessary-unsafe-spans, r=arielb1

Tweak "unecessary unsafe block" error spans

6 years agoRollup merge of #46804 - estebank:conflicting-impl-def-span, r=arielb1
Guillaume Gomez [Mon, 18 Dec 2017 22:08:37 +0000 (23:08 +0100)]
Rollup merge of #46804 - estebank:conflicting-impl-def-span, r=arielb1

Use def span for conflicting impls and recursive fn

6 years agoRollup merge of #46802 - estebank:redefined-def-span, r=michaelwoerister
Guillaume Gomez [Mon, 18 Dec 2017 22:08:35 +0000 (23:08 +0100)]
Rollup merge of #46802 - estebank:redefined-def-span, r=michaelwoerister

Point at def span on redefined name diagnostic

6 years agoRollup merge of #46801 - estebank:impl-extra-req-def-span, r=arielb1
Guillaume Gomez [Mon, 18 Dec 2017 22:08:34 +0000 (23:08 +0100)]
Rollup merge of #46801 - estebank:impl-extra-req-def-span, r=arielb1

Point at def span in "impl has stricter requirements" diagnostic

6 years agoRollup merge of #46800 - estebank:expected-closure-def-span, r=arielb1
Guillaume Gomez [Mon, 18 Dec 2017 22:08:33 +0000 (23:08 +0100)]
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

6 years agoRollup merge of #46790 - frewsxcv:frewsxcv-swap-bytes, r=QuietMisdreavus
Guillaume Gomez [Mon, 18 Dec 2017 22:08:32 +0000 (23:08 +0100)]
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.

6 years agoRollup merge of #46786 - GuillaumeGomez:fix-sized-rendering, r=QuietMisdreavus
Guillaume Gomez [Mon, 18 Dec 2017 22:08:31 +0000 (23:08 +0100)]
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

6 years agoRollup merge of #46700 - GuillaumeGomez:more-relevant-doc-search, r=QuietMisdreavus
Guillaume Gomez [Mon, 18 Dec 2017 22:08:30 +0000 (23:08 +0100)]
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

6 years agoAdd tests for hidden types
Guillaume Gomez [Sun, 26 Nov 2017 22:24:49 +0000 (23:24 +0100)]
Add tests for hidden types

6 years agoAdd Hash impl for SystemTime and Instant
Vitaly _Vi Shukela [Mon, 18 Dec 2017 21:35:43 +0000 (00:35 +0300)]
Add Hash impl for SystemTime and Instant

Closes #46670.

6 years agoImprove search display on mobile
Guillaume Gomez [Mon, 18 Dec 2017 20:27:19 +0000 (21:27 +0100)]
Improve search display on mobile

6 years agoAuto merge of #46808 - eddyb:issue-46769-quick, r=arielb1
bors [Mon, 18 Dec 2017 20:44:18 +0000 (20:44 +0000)]
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).

6 years agoFix dynamic crates listing in doc sidebar
Guillaume Gomez [Mon, 18 Dec 2017 20:15:46 +0000 (21:15 +0100)]
Fix dynamic crates listing in doc sidebar

6 years agoFix tidy issue
varkor [Mon, 18 Dec 2017 19:52:45 +0000 (19:52 +0000)]
Fix tidy issue