]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAdd specific message for tuple struct invoked with suffixed numeric field name
Esteban Küber [Tue, 26 Mar 2019 19:32:32 +0000 (12:32 -0700)]
Add specific message for tuple struct invoked with suffixed numeric field name

5 years agoReword invalid suffixe errors
Esteban Küber [Tue, 26 Mar 2019 19:09:13 +0000 (12:09 -0700)]
Reword invalid suffixe errors

5 years agoAuto merge of #59433 - Centril:rollup, r=Centril
bors [Tue, 26 Mar 2019 17:25:16 +0000 (17:25 +0000)]
Auto merge of #59433 - Centril:rollup, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #59150 (Expand suggestions for type ascription parse errors)
 - #59232 (Merge `Promoted` and `Static` in `mir::Place`)
 - #59267 (Provide suggestion when using field access instead of path)
 - #59315 (Add no_hash to query macro and move some queries over)
 - #59334 (Update build instructions in README.md)
 - #59362 (Demo `FromIterator` short-circuiting)
 - #59374 (Simplify checked_duration_since)
 - #59389 (replace redundant note in deprecation warning)
 - #59410 (Clarify `{Ord,f32,f64}::clamp` docs a little)
 - #59419 (Utilize `?` instead of `return None`.)

Failed merges:

r? @ghost

5 years agoUse `expect_no_suffix` for error
Esteban Küber [Tue, 26 Mar 2019 17:18:18 +0000 (10:18 -0700)]
Use `expect_no_suffix` for error

5 years agoExclude UnusedBrokenConst from module lints
John Kåre Alsaker [Tue, 26 Mar 2019 16:04:00 +0000 (17:04 +0100)]
Exclude UnusedBrokenConst from module lints

5 years agoRemove the block on natvis for lld-link.
TheGoddessInari [Tue, 26 Mar 2019 15:46:41 +0000 (08:46 -0700)]
Remove the block on natvis for lld-link.

5 years agoLife's too short not to use cfg_if
gnzlbg [Tue, 26 Mar 2019 15:14:32 +0000 (16:14 +0100)]
Life's too short not to use cfg_if

5 years agoAuto merge of #59434 - Centril:bootstrap-to-2019-03-20, r=Mark-Simulacrum
bors [Tue, 26 Mar 2019 13:58:30 +0000 (13:58 +0000)]
Auto merge of #59434 - Centril:bootstrap-to-2019-03-20, r=Mark-Simulacrum

Bump bootstrap compiler to 2019-03-20

Includes https://github.com/rust-lang/rust/pull/59295 and by extension https://github.com/rust-lang/rust/pull/59047, which unblocks https://github.com/rust-lang/rust/pull/58253, https://github.com/rust-lang/rust/pull/58837, and possibly https://github.com/rust-lang/rust/pull/59336, and so therefore:

@bors p=50

r? @Mark-Simulacrum

cc @pietroalbini

5 years agoDocument why the volatile read is used
gnzlbg [Tue, 26 Mar 2019 12:43:57 +0000 (13:43 +0100)]
Document why the volatile read is used

5 years agoAdd exception for libcore/hint.rs to pal lint of tidy script
gnzlbg [Tue, 26 Mar 2019 11:15:06 +0000 (12:15 +0100)]
Add exception for libcore/hint.rs to pal lint of tidy script

5 years agoUse fallback on emscripten targets
gnzlbg [Tue, 26 Mar 2019 08:12:06 +0000 (09:12 +0100)]
Use fallback on emscripten targets

5 years agobump bootstrap; adjust stage0 uses in libsyntax_pos
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:57:42 +0000 (09:57 +0100)]
bump bootstrap; adjust stage0 uses in libsyntax_pos

5 years agobump bootstrap; adjust stage0 uses in core::ptr.
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:57:25 +0000 (09:57 +0100)]
bump bootstrap; adjust stage0 uses in core::ptr.

5 years agobump bootstrap => 2019-03-20
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:53:47 +0000 (09:53 +0100)]
bump bootstrap => 2019-03-20

5 years agofix some uses I missed
Ralf Jung [Tue, 19 Mar 2019 08:46:11 +0000 (09:46 +0100)]
fix some uses I missed

5 years agoadjust MaybeUninit API to discussions
Ralf Jung [Mon, 18 Mar 2019 21:45:02 +0000 (22:45 +0100)]
adjust MaybeUninit API to discussions

uninitialized -> uninit
into_initialized -> assume_init
read_initialized -> read
set -> write

5 years agoRollup merge of #59419 - frewsxcv:frewsxcv-qu, r=varkor
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:53 +0000 (09:05 +0100)]
Rollup merge of #59419 - frewsxcv:frewsxcv-qu, r=varkor

Utilize `?` instead of `return None`.

None

5 years agoRollup merge of #59410 - tbu-:pr_doc_clarifyclamp, r=joshtriplett
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:52 +0000 (09:05 +0100)]
Rollup merge of #59410 - tbu-:pr_doc_clarifyclamp, r=joshtriplett

Clarify `{Ord,f32,f64}::clamp` docs a little

Explicitly call out when it returns NaN, adhere to the panic doc
guidelines.

5 years agoRollup merge of #59389 - euclio:deprecated-suggestion, r=varkor
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:51 +0000 (09:05 +0100)]
Rollup merge of #59389 - euclio:deprecated-suggestion, r=varkor

replace redundant note in deprecation warning

5 years agoRollup merge of #59374 - faern:simplify-checked-duration-since, r=shepmaster
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:48 +0000 (09:05 +0100)]
Rollup merge of #59374 - faern:simplify-checked-duration-since, r=shepmaster

Simplify checked_duration_since

This follows the same design as we updated to in #56490. Internally, all the system specific time implementations are checked, no panics. Then the panicking publicly exported API can just call the checked version of itself and make do with a single panic (`expect`) at the top.

Since the internal sys implementations are now checked, this gets rid of the extra `if self >= &earlier` check in `checked_duration_since`. Except likely making the generated machine code simpler, it also reduces the algorithm from "Check panic condition -> call possibly panicking method" to just "call non panicking method".

Added two test cases:
* Edge case: Make sure `checked_duration_since` on two equal `Instant`s produce a zero duration, not a `None`.
* Most common/intended usage: Make sure `later.checked_duration_since(earlier)`, returns an expected value.

5 years agoRollup merge of #59362 - pnkfelix:demo-from-iterator-short-circuiting, r=Centril
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:47 +0000 (09:05 +0100)]
Rollup merge of #59362 - pnkfelix:demo-from-iterator-short-circuiting, r=Centril

Demo `FromIterator` short-circuiting

while looking at a FIXME in `FromIterator for Option` and `FromIterator for Result`, I realized that the current documentation does not have example code showing exactly what is meant by "no further elements are taken."

The code snippets provided here are meant to correct that.

5 years agoRollup merge of #59334 - ewk:readme, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:46 +0000 (09:05 +0100)]
Rollup merge of #59334 - ewk:readme, r=Mark-Simulacrum

Update build instructions in README.md

Add additional instructions when `sudo ./x.py install` fails to
complete the build.

This resolves issues #40108 and #49269.

r? @steveklabnik

5 years agoRollup merge of #59315 - Zoxc:move-query, r=oli-obk
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:44 +0000 (09:05 +0100)]
Rollup merge of #59315 - Zoxc:move-query, r=oli-obk

Add no_hash to query macro and move some queries over

r? @oli-obk

5 years agoRollup merge of #59267 - estebank:assoc-const-as-field, r=davidtwco
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:43 +0000 (09:05 +0100)]
Rollup merge of #59267 - estebank:assoc-const-as-field, r=davidtwco

Provide suggestion when using field access instead of path

When trying to access an associated constant as if it were a field of
an instance, provide a suggestion for the correct syntax.

Fix #57316.

5 years agoRollup merge of #59232 - saleemjaffer:mir_place_refactor, r=oli-obk
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:40 +0000 (09:05 +0100)]
Rollup merge of #59232 - saleemjaffer:mir_place_refactor, r=oli-obk

Merge `Promoted` and `Static` in `mir::Place`

fixes #53848

5 years agoRollup merge of #59150 - estebank:type-ascription, r=varkor
Mazdak Farrokhzad [Tue, 26 Mar 2019 08:05:39 +0000 (09:05 +0100)]
Rollup merge of #59150 - estebank:type-ascription, r=varkor

Expand suggestions for type ascription parse errors

Fix #51222. CC #48016, #47666, #54516, #34255.

5 years agoImprove some compiletest documentation
Philipp Hansch [Tue, 26 Mar 2019 06:47:38 +0000 (07:47 +0100)]
Improve some compiletest documentation

This adds some missing documentation for rustfix related things and adds
a test for the `is_test` function.

5 years agoreview comments
Esteban Küber [Tue, 26 Mar 2019 04:38:23 +0000 (21:38 -0700)]
review comments

5 years agorenames EvalContext to InterpretCx.
kenta7777 [Tue, 26 Mar 2019 04:06:15 +0000 (13:06 +0900)]
renames EvalContext to InterpretCx.

5 years agoWhen moving out of a for loop head, suggest borrowing it in nll mode
Esteban Küber [Tue, 26 Mar 2019 02:11:41 +0000 (19:11 -0700)]
When moving out of a for loop head, suggest borrowing it in nll mode

5 years agoAuto merge of #59136 - jethrogb:jb/sgx-std-test, r=sanxiyn
bors [Tue, 26 Mar 2019 01:48:34 +0000 (01:48 +0000)]
Auto merge of #59136 - jethrogb:jb/sgx-std-test, r=sanxiyn

SGX target: fix std unit tests

This fixes some tests and some code in the SGX sys implementation to make the `std` unit test suite pass.

#59009 must be merged first.

5 years agoFix code block display in portability element in dark theme
Guillaume Gomez [Mon, 25 Mar 2019 23:30:33 +0000 (00:30 +0100)]
Fix code block display in portability element in dark theme

5 years agoReject integer suffix when tuple indexing
Esteban Küber [Mon, 25 Mar 2019 23:11:21 +0000 (16:11 -0700)]
Reject integer suffix when tuple indexing

5 years agoUtilize `?` instead of `return None`.
Corey Farwell [Mon, 25 Mar 2019 22:16:40 +0000 (23:16 +0100)]
Utilize `?` instead of `return None`.

5 years ago[CI] record docker image info for reuse
Josh Stone [Mon, 25 Mar 2019 22:27:49 +0000 (15:27 -0700)]
[CI] record docker image info for reuse

This writes an extra `dist/image-$image.txt` which contains the S3 URL
of the cached image and the `sha256` digest of the docker entry point.
This will be uploaded with the rest of the deployed artifacts in the
Travis `after_success` script.

5 years agoLink to PhantomData in NonNull documentation
Chris Gregory [Mon, 25 Mar 2019 22:04:42 +0000 (18:04 -0400)]
Link to PhantomData in NonNull documentation

5 years agoUpdate tests
John Kåre Alsaker [Wed, 13 Mar 2019 01:55:37 +0000 (02:55 +0100)]
Update tests

5 years agoMake more lints incremental
John Kåre Alsaker [Sun, 3 Mar 2019 17:47:54 +0000 (18:47 +0100)]
Make more lints incremental

5 years agoMake some lints incremental
John Kåre Alsaker [Mon, 11 Jun 2018 06:48:15 +0000 (08:48 +0200)]
Make some lints incremental

5 years agoSave coverage file in build_base path, not /tmp
Philipp Hansch [Mon, 25 Mar 2019 21:48:35 +0000 (22:48 +0100)]
Save coverage file in build_base path, not /tmp

5 years agoFormatting changes, including better wrapping and creating short summary lines.
Christian [Mon, 25 Mar 2019 21:21:05 +0000 (22:21 +0100)]
Formatting changes, including better wrapping and creating short summary lines.

5 years agoRework documentation into examples
Chris Gregory [Mon, 25 Mar 2019 21:19:47 +0000 (17:19 -0400)]
Rework documentation into examples

5 years agoRework documentation to be about fat pointers
Chris Gregory [Mon, 25 Mar 2019 20:38:12 +0000 (16:38 -0400)]
Rework documentation to be about fat pointers

5 years agoAllocate HIR id counters on demand
John Kåre Alsaker [Mon, 25 Mar 2019 18:43:04 +0000 (19:43 +0100)]
Allocate HIR id counters on demand

5 years agoSGX target: fix std unit tests
Jethro Beekman [Tue, 12 Mar 2019 17:58:30 +0000 (10:58 -0700)]
SGX target: fix std unit tests

5 years agoblack_box should use inline assembly on wasm32
gnzlbg [Mon, 25 Mar 2019 17:11:42 +0000 (18:11 +0100)]
black_box should use inline assembly on wasm32

5 years agoRefactor tuple comparison tests
Chris Gregory [Sun, 24 Mar 2019 03:02:16 +0000 (23:02 -0400)]
Refactor tuple comparison tests

5 years agoAuto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obk
bors [Mon, 25 Mar 2019 16:34:15 +0000 (16:34 +0000)]
Auto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obk

filter suggestions from extern prelude

Fixes #59027.

Modifies the candidate gathering code to call `filter_fn` on extern crates, which causes them to be filtered out when looking for a type.

5 years agoAllocate HIR id counters for use trees in MiscCollector
John Kåre Alsaker [Sat, 16 Mar 2019 06:16:25 +0000 (07:16 +0100)]
Allocate HIR id counters for use trees in MiscCollector

5 years agoAuto merge of #59256 - petrochenkov:derval2, r=Zoxc
bors [Mon, 25 Mar 2019 12:21:46 +0000 (12:21 +0000)]
Auto merge of #59256 - petrochenkov:derval2, r=Zoxc

Make meta-item API compatible with `LocalInternedString::get` soundness fix

r? @Zoxc

5 years agohir: replace NodeId with HirId in ItemId
ljedrz [Mon, 11 Mar 2019 08:44:19 +0000 (09:44 +0100)]
hir: replace NodeId with HirId in ItemId

5 years agoClarify `{Ord,f32,f64}::clamp` docs a little
Tobias Bucher [Mon, 25 Mar 2019 11:52:42 +0000 (12:52 +0100)]
Clarify `{Ord,f32,f64}::clamp` docs a little

Explicitly call out when it returns NaN, adhere to the panic doc
guidelines.

5 years agoadd missing braces
Felix S Klock II [Mon, 25 Mar 2019 10:50:11 +0000 (11:50 +0100)]
add missing braces

add missing braces analogous to those suggested by killercup

5 years agoblack_box should inhibit optimizations on platforms without inline assembly
gnzlbg [Mon, 25 Mar 2019 10:49:08 +0000 (11:49 +0100)]
black_box should inhibit optimizations on platforms without inline assembly

5 years agoUpdate src/libcore/option.rs
Pascal Hertleif [Mon, 25 Mar 2019 10:48:08 +0000 (11:48 +0100)]
Update src/libcore/option.rs

Co-Authored-By: pnkfelix <pnkfelix@pnkfx.org>
5 years agoRemove dupplicated config
gnzlbg [Mon, 25 Mar 2019 10:42:21 +0000 (11:42 +0100)]
Remove dupplicated config

5 years agoMoves test::black_box to core::hint
gnzlbg [Thu, 21 Mar 2019 08:15:52 +0000 (09:15 +0100)]
Moves test::black_box to core::hint

This changes removes a cyclic dependency between the "test" and "libtest"
crates, where "libtest" depends on "test" for "black_box", but "test" depends on
"libtest" for everything else.

I've chosen the "hint" module because there seems to be enough consensus in the
discussion of RFC2360 that this module is where such an intrinsic would belong,
but this PR does not implement that RFC! (note: if that RFC ever gets merged,
the API, docs, etc. of this API will need to change).

For backwards compatibility reasons I've chosen to also keep the "test" feature
gate for these instead of adding a new feature gate. If we change the feature
gate, we'll potentially all benchmarks, and while that's something that we could
do, it seems unnecessary to do that now - if RFC2360 gets merged, we'll need to
do that anyways.

5 years agoAuto merge of #59242 - euclio:asm-ice, r=nagisa
bors [Mon, 25 Mar 2019 09:05:00 +0000 (09:05 +0000)]
Auto merge of #59242 - euclio:asm-ice, r=nagisa

make asm diagnostic instruction optional

`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so
the instruction shouldn't be blindly unwrapped.

Reopening from #55193. I was unable to trigger the assertion on Windows after rebasing.

Fixes #23458.
Fixes #55216.

5 years agos/lints/diagnostics
Philipp Hansch [Mon, 25 Mar 2019 05:58:30 +0000 (06:58 +0100)]
s/lints/diagnostics

Not all suggestions come from lints

5 years agoFix two bootstrap tests
Philipp Hansch [Mon, 25 Mar 2019 05:57:32 +0000 (06:57 +0100)]
Fix two bootstrap tests

5 years agoAuto merge of #59240 - euclio:struct-field-span, r=oli-obk
bors [Mon, 25 Mar 2019 05:40:12 +0000 (05:40 +0000)]
Auto merge of #59240 - euclio:struct-field-span, r=oli-obk

use the identifier span for missing struct field

5 years agocompiletest: make path normalization smarter
Andy Russell [Wed, 13 Mar 2019 04:47:36 +0000 (00:47 -0400)]
compiletest: make path normalization smarter

5 years agoDeduplicate code for path suggestion
Esteban Küber [Wed, 20 Mar 2019 23:03:29 +0000 (16:03 -0700)]
Deduplicate code for path suggestion

5 years agoProvide suggestion when using field access instead of path
Esteban Küber [Mon, 18 Mar 2019 04:18:06 +0000 (21:18 -0700)]
Provide suggestion when using field access instead of path

When trying to access an associated constant as if it were a field of
an instance, provide a suggestion for the correct syntax.

5 years agoAuto merge of #59195 - estebank:for-loop-move, r=petrochenkov
bors [Mon, 25 Mar 2019 00:38:15 +0000 (00:38 +0000)]
Auto merge of #59195 - estebank:for-loop-move, r=petrochenkov

When moving out of a for loop head, suggest borrowing it

When encountering code like the following, suggest borrowing the for loop
head to avoid moving it into the for loop pattern:

```
fn main() {
    let a = vec![1, 2, 3];
    for i in &a {
        for j in a {
            println!("{} * {} = {}", i, j, i * j);
        }
    }
}
```

Fix #25534.

5 years agoAuto merge of #59382 - davidtwco:rfc-2008-refactoring, r=petrochenkov
bors [Sun, 24 Mar 2019 21:26:57 +0000 (21:26 +0000)]
Auto merge of #59382 - davidtwco:rfc-2008-refactoring, r=petrochenkov

Separate `DefId`s for variants and their constructors

Part of #44109. Split off from #59376. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion.

r? @petrochenkov

5 years agoAdd nll test
Esteban Küber [Sun, 24 Mar 2019 19:58:30 +0000 (12:58 -0700)]
Add nll test

5 years agoWhen moving out of a for loop head, suggest borrowing it
Esteban Küber [Thu, 14 Mar 2019 23:09:47 +0000 (16:09 -0700)]
When moving out of a for loop head, suggest borrowing it

When encountering code like the following, suggest borrowing the for loop
head to avoid moving it into the for loop pattern:

```
fn main() {
    let a = vec![1, 2, 3];
    for i in &a {
        for j in a {
            println!("{} * {} = {}", i, j, i * j);
        }
    }
}
```

5 years agoRe-order fields in `Def::Ctor`.
David Wood [Sun, 24 Mar 2019 18:16:44 +0000 (19:16 +0100)]
Re-order fields in `Def::Ctor`.

This commit moves the `DefId` field of `Def::Ctor` to be the first
field.

5 years agoMove `CtorOf` into `hir::def`.
David Wood [Sun, 24 Mar 2019 17:54:56 +0000 (18:54 +0100)]
Move `CtorOf` into `hir::def`.

This commit moves the definition of `CtorOf` from `rustc::hir` to
`rustc::hir::def` and adds imports wherever it is used.

5 years agoAuto merge of #59397 - kennytm:rollup, r=kennytm
bors [Sun, 24 Mar 2019 17:53:45 +0000 (17:53 +0000)]
Auto merge of #59397 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #59213 (Track changes to robots.txt)
 - #59239 (Remove inline assembly from hint::spin_loop)
 - #59251 (Use a valid name for graphviz graphs)
 - #59296 (Do not encode gensymed imports in metadata)
 - #59328 (Implement specialized nth_back() for Box and Windows.)
 - #59355 (Fix ICE with const generic param in struct)
 - #59377 (Correct minimum system LLVM version in tests)

5 years agoRemove `CtorOf` from `Node::Ctor`.
David Wood [Sun, 24 Mar 2019 17:21:59 +0000 (18:21 +0100)]
Remove `CtorOf` from `Node::Ctor`.

This commit removes `CtorOf` from `Node::Ctor` as the parent of the
constructor can be determined by looking at the node's parent in the few
places where knowing this is necessary.

5 years agomake asm diagnostic instruction optional
Andy Russell [Fri, 19 Oct 2018 00:34:01 +0000 (20:34 -0400)]
make asm diagnostic instruction optional

`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so
the instruction shouldn't be blindly unwrapped.

5 years agoAdd a way to track Rustfix UI test coverage
Philipp Hansch [Sun, 24 Mar 2019 13:06:47 +0000 (14:06 +0100)]
Add a way to track Rustfix UI test coverage

This came out of the first Rustfix WG meeting.

One of the goals is to enable Rustfix tests for all UI tests that
trigger lints with `MachineApplicable` suggestions. In order to do that
we first want to create a tracking issue that lists all files with
missing `// run-rustfix` headers.

This PR adds a `--rustfix-coverage` flag to `./x.py` and compiletest to
list the files with the missing headers in `/tmp/rustfix_missing_coverage.txt`.

From that file we can create the tracking issue and at some point also
enforce the `// run-rustfix` flag on UI tests with `MachineApplicable`
lints.

5 years agoRevert changes to creation of fictive constructors for struct variants
Vadim Petrochenkov [Sun, 24 Mar 2019 15:41:09 +0000 (18:41 +0300)]
Revert changes to creation of fictive constructors for struct variants

5 years agoreplace redundant note in deprecation warning
Andy Russell [Sun, 24 Mar 2019 01:13:57 +0000 (21:13 -0400)]
replace redundant note in deprecation warning

5 years agoMerge `DefPathData::VariantCtor` and `DefPathData::StructCtor`
Vadim Petrochenkov [Sun, 24 Mar 2019 14:49:58 +0000 (17:49 +0300)]
Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`

5 years agoRollup merge of #59377 - smaeul:patch/system-llvm, r=nikic
kennytm [Sun, 24 Mar 2019 07:32:57 +0000 (15:32 +0800)]
Rollup merge of #59377 - smaeul:patch/system-llvm, r=nikic

Correct minimum system LLVM version in tests

Since commit 9452a8dfa3ba, the new debug info format is only generated
for LLVM 8 and newer versions. However, the tests still assume that LLVM
7 will use the new debug info format. Fix the tests (and a comment in
the code) to match the actual version check.

5 years agoSlightly more uniform treatment of struct and variant constructors
Vadim Petrochenkov [Sun, 24 Mar 2019 12:29:57 +0000 (15:29 +0300)]
Slightly more uniform treatment of struct and variant constructors

5 years agoAuto merge of #58305 - scalexm:chalk-continued, r=nikomatsakis
bors [Sun, 24 Mar 2019 14:26:11 +0000 (14:26 +0000)]
Auto merge of #58305 - scalexm:chalk-continued, r=nikomatsakis

(WIP) Small fixes in chalkification

Small fixes around region constraints and builtin impls. There are still some type inference errors, for example the following code errors out:
```rust
fn main() {
    let mut x: Vec<i32> = Vec::new();
    //                    ^^^^^^^^ cannot infer type for `std::vec::Vec<_>`
}
```
but explicitly specifying `Vec::<i32>::new` works.

With these few fixes, the following code now passes type-checking:
```rust
fn main() {
    let mut x: Vec<i32> = Vec::<i32>::new();
    x.push(5);
    println!("{:?}", x);
}
```

I also fixed the implied bounds bug as discussed on Zulip and in https://github.com/rust-lang-nursery/chalk/pull/206

cc @tmandry
r? @nikomatsakis

5 years agoRemove `VariantDef::parent_did`
Vadim Petrochenkov [Sun, 24 Mar 2019 09:09:44 +0000 (12:09 +0300)]
Remove `VariantDef::parent_did`

5 years agoRollup merge of #59355 - varkor:const-param-struct-ice, r=petrochenkov
kennytm [Sun, 24 Mar 2019 07:32:54 +0000 (15:32 +0800)]
Rollup merge of #59355 - varkor:const-param-struct-ice, r=petrochenkov

Fix ICE with const generic param in struct

Fixes https://github.com/rust-lang/rust/issues/59340.

r? @petrochenkov

5 years agoRollup merge of #59328 - koalatux:iter-nth-back, r=scottmcm
kennytm [Sun, 24 Mar 2019 07:32:52 +0000 (15:32 +0800)]
Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcm

Implement specialized nth_back() for Box and Windows.

Hi there, this is my first pull request to rust :-)

I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995.

I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.

5 years agoRollup merge of #59296 - petrochenkov:stdup, r=estebank
kennytm [Sun, 24 Mar 2019 07:32:49 +0000 (15:32 +0800)]
Rollup merge of #59296 - petrochenkov:stdup, r=estebank

Do not encode gensymed imports in metadata

(Unless they are underscore `_` imports which are re-gensymed on crate loading, see https://github.com/rust-lang/rust/pull/56392.)

We cannot encode gensymed imports properly in metadata and if we encode them improperly, we can get erroneous name conflicts downstream.
Gensymed imports are produced by the compiler, so we control their set, and can be sure that none of them needs being encoded for use from other crates.

A workaround that fixes https://github.com/rust-lang/rust/issues/59243.

5 years agoRollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkov
kennytm [Sun, 24 Mar 2019 07:32:48 +0000 (15:32 +0800)]
Rollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkov

Use a valid name for graphviz graphs

Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.

5 years agoRemove methods is_struct/is_tuple/is_unit from VariantData
Vadim Petrochenkov [Sat, 23 Mar 2019 21:06:58 +0000 (00:06 +0300)]
Remove methods is_struct/is_tuple/is_unit from VariantData

5 years agoSeparate variant id and variant constructor id.
David Wood [Thu, 21 Mar 2019 22:38:50 +0000 (23:38 +0100)]
Separate variant id and variant constructor id.

This commit makes two changes - separating the `NodeId` that identifies
an enum variant from the `NodeId` that identifies the variant's
constructor; and no longer creating a `NodeId` for `Struct`-style enum
variants and structs.

Separation of the variant id and variant constructor id will allow the
rest of RFC 2008 to be implemented by lowering the visibility of the
variant's constructor without lowering the visbility of the variant
itself.

No longer creating a `NodeId` for `Struct`-style enum variants and
structs mostly simplifies logic as previously this `NodeId` wasn't used.
There were various cases where the `NodeId` wouldn't be used unless
there was an unit or tuple struct or enum variant but not all uses of
this `NodeId` had that condition, by removing this `NodeId`, this must
be explicitly dealt with. This change mostly applied cleanly, but there
were one or two cases in name resolution and one case in type check
where the existing logic required a id for `Struct`-style enum variants
and structs.

5 years agoRollup merge of #59239 - gnzlbg:fix_spin_loop, r=nagisa
kennytm [Sun, 24 Mar 2019 07:32:45 +0000 (15:32 +0800)]
Rollup merge of #59239 - gnzlbg:fix_spin_loop, r=nagisa

Remove inline assembly from hint::spin_loop

This PR removes the inline assembly which was not required since these
instructions are available in core::arch, and extends support of
the spin_loop hint to arm targets with the v6 feature which also
support the yield instruction.

5 years agoRollup merge of #59213 - kornelski:robots, r=Mark-Simulacrum
kennytm [Sun, 24 Mar 2019 07:32:42 +0000 (15:32 +0800)]
Rollup merge of #59213 - kornelski:robots, r=Mark-Simulacrum

Track changes to robots.txt

Currently `robots.txt` of doc.rust-lang.org is not part of any repo, so there's [no way to contribute any changes to it](https://internals.rust-lang.org/t/deadlock-about-fixing-outdated-documentation-links-in-search-engines/9374), such as needed for #44894 and countless dupes of this issue.

I propose adding it to this repo. I'm not in control of the infrastructure, so I can't help to automate deployment of it, but even just having the file under source control is IMHO a step forward.

5 years agoAuto merge of #59199 - estebank:untrack-errors, r=eddyb
bors [Sun, 24 Mar 2019 05:38:10 +0000 (05:38 +0000)]
Auto merge of #59199 - estebank:untrack-errors, r=eddyb

Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins`

In the spirit of continuing through errors in type checking (#39275), remove `track_errors` from a couple of locations in the codebase.

5 years agocode review fixes
Saleem Jaffer [Sun, 24 Mar 2019 03:29:11 +0000 (08:59 +0530)]
code review fixes

5 years agoMake `ptr::eq` documentation mention smart-pointer behavior
Chris Gregory [Sat, 23 Mar 2019 23:43:32 +0000 (19:43 -0400)]
Make `ptr::eq` documentation mention smart-pointer behavior

Resolves #59214

5 years agoAuto merge of #59084 - estebank:diagnostic-spans, r=davidtwco
bors [Sat, 23 Mar 2019 22:26:11 +0000 (22:26 +0000)]
Auto merge of #59084 - estebank:diagnostic-spans, r=davidtwco

Tweak some diagnostic spans

5 years agoFix span after rebase
Esteban Küber [Sat, 23 Mar 2019 21:10:29 +0000 (14:10 -0700)]
Fix span after rebase

5 years agoFixes #59361
Peter Hall [Fri, 22 Mar 2019 11:51:37 +0000 (11:51 +0000)]
Fixes #59361

5 years agoFix rebase
Esteban Küber [Sun, 17 Mar 2019 01:36:47 +0000 (18:36 -0700)]
Fix rebase

5 years agoMark duplicate import removal suggestion tool only
Esteban Küber [Mon, 11 Mar 2019 16:50:50 +0000 (09:50 -0700)]
Mark duplicate import removal suggestion tool only

5 years agoDeduplicate const eval error spans for better output
Esteban Küber [Mon, 11 Mar 2019 16:43:05 +0000 (09:43 -0700)]
Deduplicate const eval error spans for better output

5 years agoHide obvious suggestion from cli output
Esteban Küber [Mon, 11 Mar 2019 05:25:23 +0000 (22:25 -0700)]
Hide obvious suggestion from cli output

5 years agoTweak unnecessary import suggestion
Esteban Küber [Mon, 11 Mar 2019 03:05:01 +0000 (20:05 -0700)]
Tweak unnecessary import suggestion