]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavus
bors [Fri, 12 Oct 2018 09:23:10 +0000 (09:23 +0000)]
Auto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavus

Improve error display for codeblocks in rustdoc

Part of #53919.

r? @QuietMisdreavus

5 years agoAuto merge of #54534 - nagisa:align-offset-simplification, r=alexcrichton
bors [Fri, 12 Oct 2018 06:38:11 +0000 (06:38 +0000)]
Auto merge of #54534 - nagisa:align-offset-simplification, r=alexcrichton

Simplify implementation of align_offset slightly

5 years agoAuto merge of #54924 - RalfJung:use-maybe-uninit2, r=cramertj
bors [Fri, 12 Oct 2018 02:14:47 +0000 (02:14 +0000)]
Auto merge of #54924 - RalfJung:use-maybe-uninit2, r=cramertj

Use MaybeUninit in liballoc

All code by @japaric. This is a re-submission of a part of https://github.com/rust-lang/rust/pull/53508 that hopefully does not regress performance.

5 years agoAuto merge of #54592 - GabrielMajeri:no-plt, r=nagisa
bors [Thu, 11 Oct 2018 19:38:15 +0000 (19:38 +0000)]
Auto merge of #54592 - GabrielMajeri:no-plt, r=nagisa

Support for disabling PLT for better function call performance

This PR gives `rustc` the ability to skip the PLT when generating function calls into shared libraries. This can improve performance by reducing branch indirection.

AFAIK, the only advantage of using the PLT is to allow for ELF lazy binding. However, since Rust already [enables full relro for security](https://github.com/rust-lang/rust/pull/43170), lazy binding was disabled anyway.

This is a little known feature which is supported by [GCC](https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html) and [Clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fplt) as `-fno-plt` (some Linux distros [enable it by default](https://git.archlinux.org/svntogit/packages.git/tree/trunk/makepkg.conf?h=packages/pacman#n40) for all builds).

Implementation inspired by [this patch](https://reviews.llvm.org/D39079#change-YvkpNDlMs_LT) which adds `-fno-plt` support to Clang.

## Performance

I didn't run a lot of benchmarks, but these are the results on my machine for a `clap` [benchmark](https://github.com/clap-rs/clap/blob/master/benches/05_ripgrep.rs):

```
 name              control ns/iter  no-plt ns/iter  diff ns/iter  diff %  speedup
 build_app_long    11,097           10,733                  -364  -3.28%   x 1.03
 build_app_short   11,089           10,742                  -347  -3.13%   x 1.03
 build_help_long   186,835          182,713               -4,122  -2.21%   x 1.02
 build_help_short  80,949           78,455                -2,494  -3.08%   x 1.03
 parse_clean       12,385           12,044                  -341  -2.75%   x 1.03
 parse_complex     19,438           19,017                  -421  -2.17%   x 1.02
 parse_lots        431,493          421,421              -10,072  -2.33%   x 1.02
```

A small performance improvement across the board, with no downsides. It's likely binaries which make a lot of function calls into dynamic libraries could see even more improvements. [This comment](https://patchwork.ozlabs.org/patch/468993/#1028255) suggests that, in some cases, `-fno-plt` could improve PIC/PIE code performance by 10%.

## Security benefits

**Bonus**: some of the speculative execution attacks rely on the PLT, by disabling it we reduce a big attack surface and reduce the need for [`retpoline`](https://reviews.llvm.org/D41723).

## Remaining PLT calls

The compiled binaries still have plenty of PLT calls, coming from C/C++ libraries. Building dependencies with `CFLAGS=-fno-plt CXXFLAGS=-fno-plt` removes them.

5 years agoSupport for disabling the PLT on ELF targets
Gabriel Majeri [Wed, 26 Sep 2018 16:19:55 +0000 (19:19 +0300)]
Support for disabling the PLT on ELF targets

Disable the PLT where possible to improve performance
for indirect calls into shared libraries.

This optimization is enabled by default where possible.

- Add the `NonLazyBind` attribute to `rustllvm`:
  This attribute informs LLVM to skip PLT calls in codegen.

- Disable PLT unconditionally:
  Apply the `NonLazyBind` attribute on every function.

- Only enable no-plt when full relro is enabled:
  Ensures we only enable it when we have linker support.

- Add `-Z plt` as a compiler option

5 years agoAuto merge of #54911 - ljedrz:cleanup_codegen_llvm_top, r=michaelwoerister
bors [Thu, 11 Oct 2018 11:57:06 +0000 (11:57 +0000)]
Auto merge of #54911 - ljedrz:cleanup_codegen_llvm_top, r=michaelwoerister

Cleanup top-level codegen_llvm

- improve allocations
- improve common patterns
- remove explicit returns
- fix spelling & grammatical errors
- whitespace & formatting improvements

5 years agoAuto merge of #54850 - mcr431:fix-54707-trait-function-from-macro, r=nikomatsakis
bors [Thu, 11 Oct 2018 09:19:23 +0000 (09:19 +0000)]
Auto merge of #54850 - mcr431:fix-54707-trait-function-from-macro, r=nikomatsakis

Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls

Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls

Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.

5 years agoAuto merge of #54969 - Manishearth:rollup, r=Manishearth
bors [Thu, 11 Oct 2018 06:26:03 +0000 (06:26 +0000)]
Auto merge of #54969 - Manishearth:rollup, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost

5 years agoAuto merge of #54848 - davidtwco:issue-52663-trait-object, r=nikomatsakis
bors [Thu, 11 Oct 2018 03:32:12 +0000 (03:32 +0000)]
Auto merge of #54848 - davidtwco:issue-52663-trait-object, r=nikomatsakis

Better Diagnostic for Trait Object Capture

Part of #52663.

This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix

5 years agoRollup merge of #54909 - scalexm:finish-rules, r=nikomatsakis
Manish Goregaokar [Wed, 10 Oct 2018 22:59:25 +0000 (15:59 -0700)]
Rollup merge of #54909 - scalexm:finish-rules, r=nikomatsakis

Fixes #47311.
r? @nrc

5 years agoRollup merge of #54904 - Kerollmops:stabilize-option-replace, r=Centril
Manish Goregaokar [Wed, 10 Oct 2018 22:59:23 +0000 (15:59 -0700)]
Rollup merge of #54904 - Kerollmops:stabilize-option-replace, r=Centril

Fixes #47311.
r? @nrc

5 years agoRollup merge of #54893 - dsciarra:issue-54379, r=pnkfelix
Manish Goregaokar [Wed, 10 Oct 2018 22:59:21 +0000 (15:59 -0700)]
Rollup merge of #54893 - dsciarra:issue-54379, r=pnkfelix

Fixes #47311.
r? @nrc

5 years agoRollup merge of #54870 - flip1995:stabilize_tool_lints, r=Manishearth
Manish Goregaokar [Wed, 10 Oct 2018 22:59:20 +0000 (15:59 -0700)]
Rollup merge of #54870 - flip1995:stabilize_tool_lints, r=Manishearth

Fixes #47311.
r? @nrc

5 years agoRollup merge of #54862 - Havvy:cfg_attr_multi, r=petrochenkov
Manish Goregaokar [Wed, 10 Oct 2018 22:58:40 +0000 (15:58 -0700)]
Rollup merge of #54862 - Havvy:cfg_attr_multi, r=petrochenkov

Fixes #47311.
r? @nrc

5 years agoRollup merge of #54848 - davidtwco:issue-52663-trait-object, r=nikomatsakis
Manish Goregaokar [Wed, 10 Oct 2018 22:58:38 +0000 (15:58 -0700)]
Rollup merge of #54848 - davidtwco:issue-52663-trait-object, r=nikomatsakis

Fixes #47311.
r? @nrc

5 years agoAuto merge of #54747 - levex:inline-asm-bad-operands, r=nagisa
bors [Wed, 10 Oct 2018 22:24:48 +0000 (22:24 +0000)]
Auto merge of #54747 - levex:inline-asm-bad-operands, r=nagisa

codegen_llvm: verify that inline assembly operands are scalars

Another set of inline assembly fixes. This time let's emit an error message when the operand value cannot be coerced into the operand constraint.

Two questions:

1) Should I reuse `E0668` which was introduced in #54568 or just use `E0669` as it stands because they do mean different things, but maybe that's not too user-friendly. Just a thought.
2) The `try_fold` returns the operand which failed to be converted into a scalar value, any suggestions on how to use that in the error message?

Thanks!

5 years agoAuto merge of #54732 - cramertj:waker, r=aturon
bors [Wed, 10 Oct 2018 18:28:30 +0000 (18:28 +0000)]
Auto merge of #54732 - cramertj:waker, r=aturon

LocalWaker and Waker cleanups

r? @aturon

5 years agoAuto merge of #54802 - davidtwco:issue-53040, r=pnkfelix
bors [Wed, 10 Oct 2018 14:51:01 +0000 (14:51 +0000)]
Auto merge of #54802 - davidtwco:issue-53040, r=pnkfelix

[nll] better error message when returning refs to upvars

Fixes #53040.

r? @nikomatsakis

5 years agoAuto merge of #54461 - RalfJung:pointer-provenance, r=oli-obk
bors [Wed, 10 Oct 2018 12:13:03 +0000 (12:13 +0000)]
Auto merge of #54461 - RalfJung:pointer-provenance, r=oli-obk

miri engine: basic support for pointer provenance tracking

This enriches pointers with a new member, `tag`, that can be used to do provenance tracking. This is a new type parameter that propagates up through everything. It defaults to `()` (no tag), which is also the value used by CTFE -- but miri will use another type.

The only actually interesting piece here, I think, is what I had to do in the memory's `get`. The problem is that `tcx` (storing the allocations for statics) uses `()` for provenance information. But the machine might need another tag. The machine has a function to do the conversion, but if a conversion actually happened, we need to store the result of this *somewhere* -- we cannot return a pointer into `tcx` as we usually would.
So I introduced `MonoHashMap` which uses `RefCell` to be able to insert new entries even when we just have a shared ref. However, it is important that we can also return shared refs into the map without holding the `RefCell` opan. This is achieved by boxing the values stored in the map, so their addresses remain stable even when the map's table gets reallocated. This is all implemented in `mono_hash_map.rs`.

NOTE: This PR also contains the commits from https://github.com/rust-lang/rust/pull/54380#issuecomment-423130753. Only the [last two commits](https://github.com/rust-lang/rust/pull/54461/files/8e74ee0998a5b11f28d61600dbb881c7168a4a40..HEAD) are new.

5 years agotidy up
Ralf Jung [Wed, 10 Oct 2018 09:31:31 +0000 (11:31 +0200)]
tidy up

5 years agovtables are not leaks
Ralf Jung [Fri, 5 Oct 2018 16:08:36 +0000 (18:08 +0200)]
vtables are not leaks

5 years agomore comments for these sublte games we are playing with allocations in the miri...
Ralf Jung [Fri, 5 Oct 2018 14:49:51 +0000 (16:49 +0200)]
more comments for these sublte games we are playing with allocations in the miri engine

5 years agoabstract mono_hash_map through a trait, only miri actually needs the fancy one
Ralf Jung [Fri, 5 Oct 2018 13:13:59 +0000 (15:13 +0200)]
abstract mono_hash_map through a trait, only miri actually needs the fancy one

5 years agotypos and spaces
Ralf Jung [Fri, 5 Oct 2018 08:28:33 +0000 (10:28 +0200)]
typos and spaces

5 years agoclarify alloc_map description
Ralf Jung [Fri, 5 Oct 2018 08:23:39 +0000 (10:23 +0200)]
clarify alloc_map description

5 years agofix typos
Ralf Jung [Thu, 4 Oct 2018 16:53:16 +0000 (18:53 +0200)]
fix typos

5 years agoexpand safety comment in memory.rs
Ralf Jung [Tue, 2 Oct 2018 12:45:41 +0000 (14:45 +0200)]
expand safety comment in memory.rs

5 years agorename extra -> meta in place
Ralf Jung [Sat, 29 Sep 2018 19:35:20 +0000 (21:35 +0200)]
rename extra -> meta in place

5 years agoexpand comment
Ralf Jung [Sat, 29 Sep 2018 07:51:38 +0000 (09:51 +0200)]
expand comment

5 years agotidy, oh tidy
Ralf Jung [Sat, 22 Sep 2018 11:36:46 +0000 (13:36 +0200)]
tidy, oh tidy

5 years agomiri engine: basic support for pointer provenance tracking
Ralf Jung [Fri, 21 Sep 2018 21:32:59 +0000 (23:32 +0200)]
miri engine: basic support for pointer provenance tracking

5 years agoremove a now outdated comment
Ralf Jung [Wed, 10 Oct 2018 07:16:05 +0000 (09:16 +0200)]
remove a now outdated comment

5 years agoAuto merge of #54831 - davidtwco:issue-52663-struct-field-suggestion, r=nikomatsakis
bors [Wed, 10 Oct 2018 06:36:11 +0000 (06:36 +0000)]
Auto merge of #54831 - davidtwco:issue-52663-struct-field-suggestion, r=nikomatsakis

NLL is missing struct field suggestion

Part of #52663.

This commit adds suggestions to change the definitions of fields in
struct definitions from immutable references to mutable references.

r? @nikomatsakis
cc @pnkfelix

5 years agoAuto merge of #54764 - tromey:test-rust-lldb, r=alexcrichton
bors [Wed, 10 Oct 2018 02:08:23 +0000 (02:08 +0000)]
Auto merge of #54764 - tromey:test-rust-lldb, r=alexcrichton

Run debuginfo tests against rust-enabled lldb, when possible

If the rust-enabled lldb was built, then use it when running the
debuginfo tests.  Updating the lldb submodule was necessary as this
needed a way to differentiate the rust-enabled lldb, so I added a line
to the --version output.

This adds compiletest commands to differentiate between the
rust-enabled and non-rust-enabled lldb, as is already done for gdb.  A
new "rust-lldb" header directive is also added, but not used in this
patch; I plan to use it in #54004.

This updates all the tests.

5 years agoRemove nightly check for tool_lints warning
flip1995 [Tue, 2 Oct 2018 16:15:13 +0000 (18:15 +0200)]
Remove nightly check for tool_lints warning

5 years agoRemove unstable-book documentation
flip1995 [Tue, 2 Oct 2018 09:19:38 +0000 (11:19 +0200)]
Remove unstable-book documentation

5 years agoRemove feature-gate code
flip1995 [Tue, 2 Oct 2018 08:59:41 +0000 (10:59 +0200)]
Remove feature-gate code

5 years agoRemove feature-gate tests
flip1995 [Tue, 2 Oct 2018 08:51:12 +0000 (10:51 +0200)]
Remove feature-gate tests

5 years agoRemove `feature(tool_lints)` from tests
flip1995 [Tue, 2 Oct 2018 08:44:49 +0000 (10:44 +0200)]
Remove `feature(tool_lints)` from tests

5 years agoUpdate feature-gate listing
flip1995 [Tue, 2 Oct 2018 08:37:56 +0000 (10:37 +0200)]
Update feature-gate listing

5 years agoAuto merge of #54734 - pawroman:fix_range_borrowing_suggestion, r=varkor
bors [Tue, 9 Oct 2018 22:36:14 +0000 (22:36 +0000)]
Auto merge of #54734 - pawroman:fix_range_borrowing_suggestion, r=varkor

Fix range literals borrowing suggestions

Fixes #54505. The compiler issued incorrect range borrowing suggestions (missing `()` around borrows of range literals). This was not correct syntax (see the issue for an example).

With changes in this PR, this is fixed for all types of `Range` literals.

Thanks again to @varkor and @estebank for their invaluable help and guidance.

r? @varkor

5 years agoAuto merge of #54613 - matthiaskrgr:string_from_inline_53681, r=nagisa
bors [Tue, 9 Oct 2018 19:57:55 +0000 (19:57 +0000)]
Auto merge of #54613 - matthiaskrgr:string_from_inline_53681, r=nagisa

liballoc: mark str.to_owned() and String::from(&str) as #[inline].

Fixes #53681

5 years agoAuto merge of #54762 - RalfJung:miri-validate, r=oli-obk
bors [Tue, 9 Oct 2018 17:19:56 +0000 (17:19 +0000)]
Auto merge of #54762 - RalfJung:miri-validate, r=oli-obk

Prepare miri engine for enforcing validity invariant during execution

In particular, make recursive checking of references optional, and add a `const_mode` parameter that says whether `usize` is allowed to contain a pointer. Also refactor validation a bit to be type-driven at the "leafs" (primitive types), and separately validate scalar layout to catch `NonNull` violations (which it did not properly validate before).

Fixes https://github.com/rust-lang/rust/issues/53826
Also fixes https://github.com/rust-lang/rust/issues/54751

r? @oli-obk

5 years agovalidity: check dynamic size, not static
Ralf Jung [Mon, 8 Oct 2018 12:34:27 +0000 (14:34 +0200)]
validity: check dynamic size, not static

also less verbose logging

5 years agodont fail when validating non-local closures
Ralf Jung [Mon, 8 Oct 2018 12:21:41 +0000 (14:21 +0200)]
dont fail when validating non-local closures

5 years agobox is also a primitive type
Ralf Jung [Mon, 8 Oct 2018 11:41:16 +0000 (13:41 +0200)]
box is also a primitive type

5 years agoupdate miri
Ralf Jung [Mon, 8 Oct 2018 12:45:46 +0000 (14:45 +0200)]
update miri

5 years agoadd fixme for potential perf optimization
Ralf Jung [Thu, 4 Oct 2018 18:04:16 +0000 (20:04 +0200)]
add fixme for potential perf optimization

5 years agofix nits and handling of extern static
Ralf Jung [Wed, 3 Oct 2018 10:34:10 +0000 (12:34 +0200)]
fix nits and handling of extern static

5 years agounify handling of thin and fat pointers by moving primitive type handling out of...
Ralf Jung [Wed, 3 Oct 2018 09:38:16 +0000 (11:38 +0200)]
unify handling of thin and fat pointers by moving primitive type handling out of aggregate handling

Also, make enum variant handling a bit nicer

5 years agoadd some tests with constants that better be valid
Ralf Jung [Wed, 3 Oct 2018 07:06:35 +0000 (09:06 +0200)]
add some tests with constants that better be valid

5 years agoFor now, accept all data for integer types when not in const mode
Ralf Jung [Wed, 3 Oct 2018 06:59:27 +0000 (08:59 +0200)]
For now, accept all data for integer types when not in const mode

We'll try ruling out undef later

5 years agotidy up
Ralf Jung [Wed, 3 Oct 2018 06:45:16 +0000 (08:45 +0200)]
tidy up

5 years agodo not look at refs to external statics at all
Ralf Jung [Tue, 2 Oct 2018 20:13:33 +0000 (22:13 +0200)]
do not look at refs to external statics at all

5 years agomiri engine: also check return type before calling function
Ralf Jung [Tue, 2 Oct 2018 19:16:35 +0000 (21:16 +0200)]
miri engine: also check return type before calling function

5 years agoadd machine option to validate things on every copy
Ralf Jung [Tue, 2 Oct 2018 18:20:14 +0000 (20:20 +0200)]
add machine option to validate things on every copy

5 years agomove a test to a better place
Ralf Jung [Tue, 2 Oct 2018 18:07:56 +0000 (20:07 +0200)]
move a test to a better place

5 years agoalso validate everything that has a Scalar layout, to catch NonNull
Ralf Jung [Tue, 2 Oct 2018 18:05:12 +0000 (20:05 +0200)]
also validate everything that has a Scalar layout, to catch NonNull

5 years agofix validating arrays of ZSTs
Ralf Jung [Tue, 2 Oct 2018 17:17:30 +0000 (19:17 +0200)]
fix validating arrays of ZSTs

Fixes #54751

5 years agoswitch validation of scalars to be type-driven
Ralf Jung [Tue, 2 Oct 2018 16:07:40 +0000 (18:07 +0200)]
switch validation of scalars to be type-driven

This does not actually regress anything.  It would regress NonNull, but we
didn't handle that correctly previously either.

5 years agocheck that entire ref is in-bounds before recursing; add macro for validation msgs...
Ralf Jung [Tue, 2 Oct 2018 15:02:58 +0000 (17:02 +0200)]
check that entire ref is in-bounds before recursing; add macro for validation msgs on error

5 years agomiri validity: make recursive ref checking optional
Ralf Jung [Tue, 2 Oct 2018 14:06:50 +0000 (16:06 +0200)]
miri validity: make recursive ref checking optional

5 years agoImprove message for closure returning a closure.
David Wood [Thu, 4 Oct 2018 19:48:50 +0000 (21:48 +0200)]
Improve message for closure returning a closure.

Now when a `FnMut` closure is returning a closure that contains a
reference to a captured variable, we provide an error that makes it more
clear what is happening.

5 years agoImprove errors for `FnMut` closures.
David Wood [Wed, 3 Oct 2018 23:50:23 +0000 (01:50 +0200)]
Improve errors for `FnMut` closures.

This commit improves the errors for `FnMut` closures where a reference
to a captured variable is escaping.

5 years agoAuto merge of #54757 - nikomatsakis:nll-issue-54573-user-annot, r=pnkfelix
bors [Tue, 9 Oct 2018 10:15:44 +0000 (10:15 +0000)]
Auto merge of #54757 - nikomatsakis:nll-issue-54573-user-annot, r=pnkfelix

user annotations in patterns

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

r? @pnkfelix

5 years agoAuto merge of #54798 - matthewjasper:free-region-closure-errors, r=nikomatsakis
bors [Tue, 9 Oct 2018 07:22:14 +0000 (07:22 +0000)]
Auto merge of #54798 - matthewjasper:free-region-closure-errors, r=nikomatsakis

[NLL]  Improve closure region bound errors

Previously, we would report free region errors that originate from closure with the span of the closure and a "closure body requires ..." message. This is now updated to use a reason and span from inside the closure.

5 years agofix tidy
Jorge Aparicio [Sat, 1 Sep 2018 19:44:35 +0000 (21:44 +0200)]
fix tidy

5 years agogdb_rust_pretty_printing: adapt to the changes in the layout of btree::LeafNode
Jorge Aparicio [Sat, 1 Sep 2018 17:58:04 +0000 (19:58 +0200)]
gdb_rust_pretty_printing: adapt to the changes in the layout of btree::LeafNode

5 years agoaddress RalfJung's comment
Jorge Aparicio [Thu, 23 Aug 2018 14:52:05 +0000 (16:52 +0200)]
address RalfJung's comment

5 years agoalloc: fix deprecated warnings
Jorge Aparicio [Sun, 19 Aug 2018 19:56:49 +0000 (21:56 +0200)]
alloc: fix deprecated warnings

5 years agoFix test for windows os
Paweł Romanowski [Tue, 9 Oct 2018 06:24:29 +0000 (08:24 +0200)]
Fix test for windows os

5 years agoparse_trait_item_ now handles interpolated blocks as function body decls
Matthew Russo [Fri, 5 Oct 2018 15:32:57 +0000 (11:32 -0400)]
parse_trait_item_ now handles interpolated blocks as function body decls

5 years agoadd some `debug!` to type checking
Niko Matsakis [Tue, 2 Oct 2018 18:05:39 +0000 (14:05 -0400)]
add some `debug!` to type checking

5 years agodocument `create_substs_for_generic_args`
Niko Matsakis [Tue, 2 Oct 2018 18:05:23 +0000 (14:05 -0400)]
document `create_substs_for_generic_args`

5 years agoadd pattern type ascriptions for tuple/brace structs/enums
Niko Matsakis [Mon, 8 Oct 2018 23:03:24 +0000 (19:03 -0400)]
add pattern type ascriptions for tuple/brace structs/enums

5 years agodo not skip renumbering the place in place-type-ascriptions
Niko Matsakis [Mon, 8 Oct 2018 22:03:43 +0000 (18:03 -0400)]
do not skip renumbering the place in place-type-ascriptions

5 years agoextract more helper fns around user substs
Niko Matsakis [Fri, 5 Oct 2018 14:40:35 +0000 (10:40 -0400)]
extract more helper fns around user substs

5 years agomove `user_annotated_ty_for_adt` into a helper trait
Niko Matsakis [Tue, 2 Oct 2018 15:00:57 +0000 (11:00 -0400)]
move `user_annotated_ty_for_adt` into a helper trait

5 years agoAuto merge of #54686 - zackmdavis:zero_life, r=nikomatsakis
bors [Mon, 8 Oct 2018 22:06:52 +0000 (22:06 +0000)]
Auto merge of #54686 - zackmdavis:zero_life, r=nikomatsakis

structured suggestions for unused-lifetimes lint

Regretfully, resolve_lifetime.rs is suffering from a bit of rightward-drift, but

![zero_life](https://user-images.githubusercontent.com/1076988/46253407-010e7880-c430-11e8-8faf-b9afc1405415.png)

r? @nikomatsakis

5 years agocodegen_llvm: remove explicit returns
ljedrz [Mon, 8 Oct 2018 15:00:30 +0000 (17:00 +0200)]
codegen_llvm: remove explicit returns

5 years agocodegen_llvm: fix spelling & grammatical errors
ljedrz [Mon, 8 Oct 2018 14:59:24 +0000 (16:59 +0200)]
codegen_llvm: fix spelling & grammatical errors

5 years agocodegen_llvm: improve common patterns
ljedrz [Mon, 8 Oct 2018 14:58:26 +0000 (16:58 +0200)]
codegen_llvm: improve common patterns

5 years agoRun debuginfo tests against rust-enabled lldb, when possible
Tom Tromey [Tue, 2 Oct 2018 16:13:30 +0000 (10:13 -0600)]
Run debuginfo tests against rust-enabled lldb, when possible

If the rust-enabled lldb was built, then use it when running the
debuginfo tests.  Updating the lldb submodule was necessary as this
needed a way to differentiate the rust-enabled lldb, so I added a line
to the --version output.

This adds compiletest commands to differentiate between the
rust-enabled and non-rust-enabled lldb, as is already done for gdb.  A
new "rust-lldb" header directive is also added, but not used in this
patch; I plan to use it in #54004.

This updates all the tests.

5 years agoAttempt to fix #54505 tests for wasm
Paweł Romanowski [Mon, 8 Oct 2018 16:39:09 +0000 (18:39 +0200)]
Attempt to fix #54505 tests for wasm

5 years agocodegen_llvm: improve allocations
ljedrz [Mon, 8 Oct 2018 14:55:04 +0000 (16:55 +0200)]
codegen_llvm: improve allocations

5 years agocodegen_llvm: whitespace & formatting improvements
ljedrz [Mon, 8 Oct 2018 14:52:34 +0000 (16:52 +0200)]
codegen_llvm: whitespace & formatting improvements

5 years agoCompute flags for `ty::UnnormalizedProjection`
scalexm [Mon, 8 Oct 2018 13:20:16 +0000 (15:20 +0200)]
Compute flags for `ty::UnnormalizedProjection`

5 years agoAdd chalk rules related to associated type defs
scalexm [Mon, 8 Oct 2018 10:54:56 +0000 (12:54 +0200)]
Add chalk rules related to associated type defs
* Rule ProjectionEq-Skolemize
* Rule WellFormed-AssocTy
* Rule Implied-Trait-From-AssocTy

5 years agoAuto merge of #54871 - u32i64:master, r=frewsxcv
bors [Mon, 8 Oct 2018 12:17:36 +0000 (12:17 +0000)]
Auto merge of #54871 - u32i64:master, r=frewsxcv

Remove unnecessary comma in `libstd/thread/mod.rs` doc comment

Fix typo in `libstd/thread/mod.rs` doc comment: remove unnecessary comma.

5 years agoPass around interned refs to goals and not goals
scalexm [Sat, 6 Oct 2018 11:51:02 +0000 (13:51 +0200)]
Pass around interned refs to goals and not goals

5 years agoChange from label to suggestion.
David Wood [Fri, 5 Oct 2018 12:30:45 +0000 (14:30 +0200)]
Change from label to suggestion.

This commit changes the label to a maybe incorrect suggestion for better
integration with RLS.

5 years agoAdd struct field suggestions.
David Wood [Thu, 4 Oct 2018 23:17:43 +0000 (01:17 +0200)]
Add struct field suggestions.

This commit adds suggestions to change the definitions of fields in
struct definitions from immutable references to mutable references.

5 years agoAuto merge of #54865 - pietroalbini:1.29.2-notes, r=pietroalbini
bors [Mon, 8 Oct 2018 09:29:59 +0000 (09:29 +0000)]
Auto merge of #54865 - pietroalbini:1.29.2-notes, r=pietroalbini

Backport 1.29.2 release notes to master

r? @ghost

5 years agoBump the `Option::replace` stabilize version to 1.31.0
Clément Renault [Mon, 8 Oct 2018 08:18:43 +0000 (10:18 +0200)]
Bump the `Option::replace` stabilize version to 1.31.0

5 years agoStabilize the `Option::replace` method
Clément Renault [Mon, 8 Oct 2018 08:06:45 +0000 (10:06 +0200)]
Stabilize the `Option::replace` method

5 years agoAuto merge of #54847 - ljedrz:kill_graphviz_intocow, r=pnkfelix
bors [Mon, 8 Oct 2018 06:50:25 +0000 (06:50 +0000)]
Auto merge of #54847 - ljedrz:kill_graphviz_intocow, r=pnkfelix

Cleanup: remove graphviz::IntoCow

It's just `Into<Cow<...>>` and the applicable methods already exist for `Vec`/`[T]` and `String`/`str`.

5 years agocfg-attr-multi: Change issue number to actual tracking issue
Havvy (Ryan Scheel) [Mon, 8 Oct 2018 04:48:28 +0000 (21:48 -0700)]
cfg-attr-multi: Change issue number to actual tracking issue

5 years agoAuto merge of #54700 - frewsxcv:frewsxcv-binary-search, r=GuillaumeGomez
bors [Mon, 8 Oct 2018 03:04:50 +0000 (03:04 +0000)]
Auto merge of #54700 - frewsxcv:frewsxcv-binary-search, r=GuillaumeGomez

Clarify docs for when binary_search has many matches.

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

5 years agoin which rightward drift is opposed
Zack M. Davis [Mon, 8 Oct 2018 02:28:37 +0000 (19:28 -0700)]
in which rightward drift is opposed

Thanks to reviewers Tyler Mandry (for pointing out that this is
ridiculous and we need a helper function), Niko Matsakis (for pointing
out that the span-calculation code only has a couple free variables),
and Esteban Küber (for pointing out `get_generics`).

5 years agostructured suggestions for unused-lifetimes lint
Zack M. Davis [Sun, 30 Sep 2018 04:25:41 +0000 (21:25 -0700)]
structured suggestions for unused-lifetimes lint