]> git.lizzy.rs Git - rust.git/log
rust.git
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 agoRefactor macro comment and add resize with zeros example
mandeep [Tue, 9 Oct 2018 05:51:22 +0000 (01:51 -0400)]
Refactor macro comment and add resize with zeros example

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 agoFix handling of #[must_use] on unit and uninhabited types
varkor [Mon, 8 Oct 2018 20:08:01 +0000 (21:08 +0100)]
Fix handling of #[must_use] on unit and uninhabited types

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 agoit's auto traits that make for automatic implementations
Ralf Jung [Mon, 8 Oct 2018 15:44:33 +0000 (17:44 +0200)]
it's auto traits that make for automatic implementations

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 agoAdded text explaining the (new) relative roles of `optimize`+`debug`
Felix S. Klock II [Mon, 8 Oct 2018 13:43:53 +0000 (15:43 +0200)]
Added text explaining the (new) relative roles of `optimize`+`debug`
and to briefly touch on the theory of debugging rustc versus the
practice of such.

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 agoMove errors specify "dereference of raw pointer".
David Wood [Thu, 4 Oct 2018 20:40:17 +0000 (22:40 +0200)]
Move errors specify "dereference of raw pointer".

Previously, move errors involving the dereference of a raw pointer would
say "borrowed content". This commit changes it to say "dereference of
raw pointer".

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

5 years agoAuto merge of #54609 - kzys:404-search, r=GuillaumeGomez
bors [Mon, 8 Oct 2018 00:33:19 +0000 (00:33 +0000)]
Auto merge of #54609 - kzys:404-search, r=GuillaumeGomez

Add the library search box on the 404 page

It actually has a link to search already, but it would be better to
have the search "box" as like index.md to be consistent.

<style> can be shared with index.md, but these pages currently
use https://doc.rust-lang.org/rust.css directly.

Fixes #14572.

5 years agoAuto merge of #53517 - phungleson:fix-impl-from-for-error, r=frewsxcv
bors [Sun, 7 Oct 2018 22:00:04 +0000 (22:00 +0000)]
Auto merge of #53517 - phungleson:fix-impl-from-for-error, r=frewsxcv

Add doc for impl From for Error

As part of issue #51430 (cc @skade).

The impl is very simple, let me know if we need to go into any details.

5 years agoAuto merge of #54810 - 1aim:unused-impl-trait, r=oli-obk
bors [Sun, 7 Oct 2018 19:30:24 +0000 (19:30 +0000)]
Auto merge of #54810 - 1aim:unused-impl-trait, r=oli-obk

Fix dead code lint for functions using impl Trait

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

This is a minimal fix that doesn't add any new queries or touches unnecessary code. Please nominate for beta backport if wanted.

5 years agoUpdate logic to search for casts.
David Wood [Fri, 5 Oct 2018 21:31:33 +0000 (23:31 +0200)]
Update logic to search for casts.

This commit updates the captured trait object search logic to look for
unsized casts to boxed types rather than for functions that returned
trait objects.

5 years agoIdentify borrows captured by trait objects.
David Wood [Fri, 5 Oct 2018 15:05:33 +0000 (17:05 +0200)]
Identify borrows captured by trait objects.

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.

5 years agoAuto merge of #54835 - oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_s...
bors [Sun, 7 Oct 2018 13:37:07 +0000 (13:37 +0000)]
Auto merge of #54835 - oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril

Stabilize `min_const_fn`

tracking issue: #53555

r? @Centril

5 years agoClarify docs for when binary_search has many matches.
Corey Farwell [Sun, 30 Sep 2018 16:28:34 +0000 (12:28 -0400)]
Clarify docs for when binary_search has many matches.

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

5 years agoFix internal compiler error on malformed match arm pattern.
Donato Sciarra [Sat, 6 Oct 2018 22:05:42 +0000 (00:05 +0200)]
Fix internal compiler error on malformed match arm pattern.
Issue: 54379

5 years agoAuto merge of #54813 - petrochenkov:uilocale, r=alexcrichton
bors [Sun, 7 Oct 2018 11:10:39 +0000 (11:10 +0000)]
Auto merge of #54813 - petrochenkov:uilocale, r=alexcrichton

Fix two UI tests with locale-dependent output

Closes https://github.com/rust-lang/rust/issues/54719

5 years agoFix tracking issue for Once::is_completed
Simon Sapin [Sun, 7 Oct 2018 10:00:41 +0000 (12:00 +0200)]
Fix tracking issue for Once::is_completed

5 years agocfg_attr_multi: Feature gate
Havvy (Ryan Scheel) [Thu, 4 Oct 2018 11:55:47 +0000 (04:55 -0700)]
cfg_attr_multi: Feature gate

5 years agoAuto merge of #54823 - euclio:needs-test, r=alexcrichton
bors [Sun, 7 Oct 2018 08:32:19 +0000 (08:32 +0000)]
Auto merge of #54823 - euclio:needs-test, r=alexcrichton

Add tests for some E-needstest issues

Fixes #28134.
Fixes #24338.
Fixes #29743.

5 years agoAuto merge of #54451 - alexcrichton:no-mangle-extern-linkage, r=michaelwoerister
bors [Sun, 7 Oct 2018 03:07:16 +0000 (03:07 +0000)]
Auto merge of #54451 - alexcrichton:no-mangle-extern-linkage, r=michaelwoerister

rustc: Allow `#[no_mangle]` anywhere in a crate

This commit updates the compiler to allow the `#[no_mangle]` (and
`#[export_name]` attributes) to be located anywhere within a crate.
These attributes are unconditionally processed, causing the compiler to
always generate an exported symbol with the appropriate name.

After some discussion on #54135 it was found that not a great reason
this hasn't been allowed already, and it seems to match the behavior
that many expect! Previously the compiler would only export a
`#[no_mangle]` symbol if it were *publicly reachable*, meaning that it
itself is `pub` and it's otherwise publicly reachable from the root of
the crate. This new definition is that `#[no_mangle]` *is always
reachable*, no matter where it is in a crate or whether it has `pub` or
not.

This should make it much easier to declare an exported symbol with a
known and unique name, even when it's an internal implementation detail
of the crate itself. Note that these symbols will persist beyond LTO as
well, always making their way to the linker.

Along the way this commit removes the `private_no_mangle_functions` lint
(also for statics) as there's no longer any need to lint these
situations. Furthermore a good number of tests were updated now that
symbol visibility has been changed.

Closes #54135

5 years agoAuto merge of #54782 - pnkfelix:issue-54556-semi-on-tail-diagnostic, r=nikomatsakis
bors [Sun, 7 Oct 2018 00:28:26 +0000 (00:28 +0000)]
Auto merge of #54782 - pnkfelix:issue-54556-semi-on-tail-diagnostic, r=nikomatsakis

NLL: temps in block tail expression diagnostic

This change adds a diagnostic that explains when temporaries in a block tail expression live longer than block local variables that they borrow, and attempts to suggest turning the tail expresion into a statement (either by adding a semicolon at the end, when its result value is clearly unused, or by introducing a `let`-binding for the result value and then returning that).

Fix #54556

5 years agorustc: Allow `#[no_mangle]` anywhere in a crate
Alex Crichton [Fri, 21 Sep 2018 22:58:11 +0000 (15:58 -0700)]
rustc: Allow `#[no_mangle]` anywhere in a crate

This commit updates the compiler to allow the `#[no_mangle]` (and
`#[export_name]` attributes) to be located anywhere within a crate.
These attributes are unconditionally processed, causing the compiler to
always generate an exported symbol with the appropriate name.

After some discussion on #54135 it was found that not a great reason
this hasn't been allowed already, and it seems to match the behavior
that many expect! Previously the compiler would only export a
`#[no_mangle]` symbol if it were *publicly reachable*, meaning that it
itself is `pub` and it's otherwise publicly reachable from the root of
the crate. This new definition is that `#[no_mangle]` *is always
reachable*, no matter where it is in a crate or whether it has `pub` or
not.

This should make it much easier to declare an exported symbol with a
known and unique name, even when it's an internal implementation detail
of the crate itself. Note that these symbols will persist beyond LTO as
well, always making their way to the linker.

Along the way this commit removes the `private_no_mangle_functions` lint
(also for statics) as there's no longer any need to lint these
situations. Furthermore a good number of tests were updated now that
symbol visibility has been changed.

Closes #54135

5 years agoAuto merge of #54756 - ljedrz:cleanup_middle, r=michaelwoerister
bors [Sat, 6 Oct 2018 20:04:18 +0000 (20:04 +0000)]
Auto merge of #54756 - ljedrz:cleanup_middle, r=michaelwoerister

Cleanup rustc/middle

- improve allocations
- use `Cow<'static, str>` where applicable
- improve some patterns
- whitespace & formatting fixes

5 years agoFix typo in libstd/thread/mod.rs: remove unnecessary comma
Artem Varaksa [Sat, 6 Oct 2018 17:09:54 +0000 (20:09 +0300)]
Fix typo in libstd/thread/mod.rs: remove unnecessary comma

5 years agoAuto merge of #54854 - matthiaskrgr:clippy_update, r=Manishearth
bors [Sat, 6 Oct 2018 15:40:13 +0000 (15:40 +0000)]
Auto merge of #54854 - matthiaskrgr:clippy_update, r=Manishearth

 submodules: update clippy to 22d37b53af5b to fix tests.

Should fix clippy toolstate.

5 years ago'a' → 'an' in front of vowel sounds.
Corey Farwell [Sat, 6 Oct 2018 15:21:53 +0000 (11:21 -0400)]
'a' → 'an' in front of vowel sounds.

5 years agocodegen_llvm: verify that inline assembly operands are scalars
Levente Kurusa [Mon, 1 Oct 2018 13:13:42 +0000 (15:13 +0200)]
codegen_llvm: verify that inline assembly operands are scalars

Otherwise, LLVM translation will fail with a panic.

Signed-off-by: Levente Kurusa <lkurusa@acm.org>
5 years agoAuto merge of #54766 - alexcrichton:wasm-all-symbols, r=michaelwoerister
bors [Sat, 6 Oct 2018 10:44:11 +0000 (10:44 +0000)]
Auto merge of #54766 - alexcrichton:wasm-all-symbols, r=michaelwoerister

wasm: Explicitly export all symbols with LLD

This commit fixes an oddity on the wasm target where LTO can produce
working executables but plain old optimizations doesn't. The compiler
already knows what set of symbols it would like to export, but LLD only
discovers this list transitively through symbol visibilities. LLD may
not, however, always find all the symbols that we'd like to export.

For example if you depend on an rlib with a `#[no_mangle]` symbol, then
if you don't actually use anything from the rlib then the symbol won't
appear in the final artifact! It will appear, however, with LTO. This
commit attempts to rectify this situation by ensuring that all symbols
rustc would otherwise preserve through LTO are also preserved through
the linking process with LLD by default.

5 years agoUpdate release notes for 1.29.2
Pietro Albini [Thu, 4 Oct 2018 09:49:29 +0000 (11:49 +0200)]
Update release notes for 1.29.2

5 years agoImprove closure region bound errors
Matthew Jasper [Wed, 3 Oct 2018 20:56:11 +0000 (21:56 +0100)]
Improve closure region bound errors

Now use the category and span that are associated to the most
interesting bound that led to the closure bound.

5 years agoMove ConstraintCategory to rustc::mir
Matthew Jasper [Wed, 3 Oct 2018 20:33:22 +0000 (21:33 +0100)]
Move ConstraintCategory to rustc::mir

Allows us to use the category of outlive requirements inside a closure
when reporting free region errors caused by its closure bounds.

5 years agorustc/middle: whitespace & formatting fixes
ljedrz [Tue, 2 Oct 2018 16:29:48 +0000 (18:29 +0200)]
rustc/middle: whitespace & formatting fixes

5 years agorustc/middle: improve allocations
ljedrz [Tue, 2 Oct 2018 16:21:39 +0000 (18:21 +0200)]
rustc/middle: improve allocations

5 years agorustc/middle: use Cow<'static, str> where applicable
ljedrz [Tue, 2 Oct 2018 16:16:01 +0000 (18:16 +0200)]
rustc/middle: use Cow<'static, str> where applicable

5 years agorustc/middle: improve some patterns
ljedrz [Tue, 2 Oct 2018 16:05:06 +0000 (18:05 +0200)]
rustc/middle: improve some patterns

5 years agosubmodules: update clippy to 32b1d1fc157f71ed2f10b60fe28abe087a743618 to fix tests.
Matthias Krüger [Fri, 5 Oct 2018 16:46:40 +0000 (18:46 +0200)]
submodules: update clippy to 32b1d1fc157f71ed2f10b60fe28abe087a743618 to fix tests.

5 years agoAuto merge of #54859 - pietroalbini:rollup, r=pietroalbini
bors [Sat, 6 Oct 2018 00:44:11 +0000 (00:44 +0000)]
Auto merge of #54859 - pietroalbini:rollup, r=pietroalbini

Rollup of 11 pull requests

Successful merges:

 - #54078 (Expand the documentation for the `std::sync` module)
 - #54717 (Cleanup rustc/ty part 1)
 - #54781 (Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs)
 - #54787 (Only warn about unused `mut` in user-written code)
 - #54804 (add suggestion for inverted function parameters)
 - #54812 (Regression test for #32382.)
 - #54833 (make `Parser::parse_foreign_item()` return a foreign item or error)
 - #54834 (rustdoc: overflow:auto doesn't work nicely on small screens)
 - #54838 (Fix typo in src/libsyntax/parse/parser.rs)
 - #54851 (Fix a regression in 1.30 by reverting #53564)
 - #54853 (Remove unneccessary error from test, revealing NLL error.)

Failed merges:

r? @ghost

5 years agocfg_attr_multi: Basic implementation
Havvy (Ryan Scheel) [Mon, 10 Sep 2018 22:06:49 +0000 (15:06 -0700)]
cfg_attr_multi: Basic implementation

Does not implement the warning or a feature flag.

5 years agoAdd doc comments about safest way to initialize a vector of zeros
mandeep [Fri, 5 Oct 2018 22:22:19 +0000 (18:22 -0400)]
Add doc comments about safest way to initialize a vector of zeros

5 years agoRollup merge of #54853 - davidtwco:issue-52663-missing-lifetime-suggestion-test,...
Pietro Albini [Fri, 5 Oct 2018 20:33:22 +0000 (22:33 +0200)]
Rollup merge of #54853 - davidtwco:issue-52663-missing-lifetime-suggestion-test, r=nikomatsakis

Remove unneccessary error from test, revealing NLL error.

Part of #52663.

Removes unnecessary type mismatch error from test that was hiding
borrow check error from NLL stderr.

r? @nikomatsakis

5 years agoRollup merge of #54851 - alexcrichton:revert-optimize, r=sfackler
Pietro Albini [Fri, 5 Oct 2018 20:33:21 +0000 (22:33 +0200)]
Rollup merge of #54851 - alexcrichton:revert-optimize, r=sfackler

Fix a regression in 1.30 by reverting #53564

Investigation on #54477 revealed https://github.com/rust-lang/rust/pull/53564 as the culprit in the regression for that crate. I've reproduced the regression with the [detailed test cases provided](https://github.com/rust-lang/rust/issues/54477#issuecomment-427398456). While we figure out how to fix the regression this commit reverts the current culprit.

5 years agoRollup merge of #54838 - 11Takanori:fix-typo, r=petrochenkov
Pietro Albini [Fri, 5 Oct 2018 20:33:19 +0000 (22:33 +0200)]
Rollup merge of #54838 - 11Takanori:fix-typo, r=petrochenkov

Fix typo in src/libsyntax/parse/parser.rs

contast -> contrast

5 years agoRollup merge of #54834 - kzys:fix-small-screen, r=GuillaumeGomez
Pietro Albini [Fri, 5 Oct 2018 20:33:18 +0000 (22:33 +0200)]
Rollup merge of #54834 - kzys:fix-small-screen, r=GuillaumeGomez

rustdoc: overflow:auto doesn't work nicely on small screens

This property was introduced by 3f92ff34b5, but looks it doesn't
overwrap even without the property.

Fixes #54672.

5 years agoRollup merge of #54833 - abonander:issue-54441, r=petrochenkov
Pietro Albini [Fri, 5 Oct 2018 20:33:17 +0000 (22:33 +0200)]
Rollup merge of #54833 - abonander:issue-54441, r=petrochenkov

make `Parser::parse_foreign_item()` return a foreign item or error

Fixes `Parser::parse_foreign_item()` to follow the convention of `parse_trait_item()` and `parse_impl_item()` in that it *must* parse an item or return an error, and then the caller is responsible for detecting the closing delimiter.

This prevents it from looping endlessly on an unexpected token in `ext/expand.rs` where it was also leaking memory by continually pushing to `Parser::expected_tokens` via `Parser::check_keyword()`.

closes #54441

r? @petrochenkov
cc @dtolnay

5 years agoRollup merge of #54812 - pnkfelix:issue-32382-index-assoc-type-with-lifetime, r=nikom...
Pietro Albini [Fri, 5 Oct 2018 20:33:16 +0000 (22:33 +0200)]
Rollup merge of #54812 - pnkfelix:issue-32382-index-assoc-type-with-lifetime, r=nikomatsakis

Regression test for #32382.