]> git.lizzy.rs Git - rust.git/log
rust.git
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 #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 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 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 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 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 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 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 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 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 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 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 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.

5 years agoRollup merge of #54804 - euclio:inverted-parameters, r=estebank
Pietro Albini [Fri, 5 Oct 2018 20:33:15 +0000 (22:33 +0200)]
Rollup merge of #54804 - euclio:inverted-parameters, r=estebank

add suggestion for inverted function parameters

Fixes #54065.

5 years agoRollup merge of #54787 - varkor:unused-mut-in-desugaring, r=nikomatsakis
Pietro Albini [Fri, 5 Oct 2018 20:33:13 +0000 (22:33 +0200)]
Rollup merge of #54787 - varkor:unused-mut-in-desugaring, r=nikomatsakis

Only warn about unused `mut` in user-written code

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

r? @pnkfelix
cc @blitzerr

5 years agoRollup merge of #54781 - phansch:master, r=varkor
Pietro Albini [Fri, 5 Oct 2018 20:33:12 +0000 (22:33 +0200)]
Rollup merge of #54781 - phansch:master, r=varkor

Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs

This adds two examples to the docs of `TyKind::FnDef` and `TyKind::FnPtr`.

I found these two types a bit confusing when I learned about them and I think adding these examples might help others.

5 years agoRollup merge of #54717 - ljedrz:cleanup_ty_p1, r=davidtwco
Pietro Albini [Fri, 5 Oct 2018 20:33:11 +0000 (22:33 +0200)]
Rollup merge of #54717 - ljedrz:cleanup_ty_p1, r=davidtwco

Cleanup rustc/ty part 1

Part 2 will follow soon; I wouldn't want these changes to rot too quickly.

- improve stack shifting and remove related allocations
- move a faster early return up
- improve allocations
- use Cow<str> where applicable
- simplify common patterns
- whitespace fixes

5 years agoRollup merge of #54078 - GabrielMajeri:expand-sync-docs, r=steveklabnik
Pietro Albini [Fri, 5 Oct 2018 20:33:10 +0000 (22:33 +0200)]
Rollup merge of #54078 - GabrielMajeri:expand-sync-docs, r=steveklabnik

Expand the documentation for the `std::sync` module

I've tried to expand the documentation for Rust's synchronization primitives. The module level documentation explains why synchronization is required when working with a multiprocessor system,
and then links to the appropiate structure in this module.

Fixes #29377, since this should be the last item on the checklist (documentation for `Atomic*` was fixed in #44854, but not ticked off the checklist).

5 years agoAuto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavis
bors [Fri, 5 Oct 2018 19:32:14 +0000 (19:32 +0000)]
Auto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavis

Cleanup rustc/ty part 2

The second part of cleanups and minor improvements for rustc/ty.
- improve allocations
- calculate span after a possible early continue
- simplify some patterns
- mark a comment as FIXME
- whitespace fixes

The PR is independent from from the first part.

5 years agoSimplify test.
David Wood [Fri, 5 Oct 2018 16:35:23 +0000 (18:35 +0200)]
Simplify test.

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

5 years agoRevert "Slightly refactor VecDeque implementation"
Alex Crichton [Fri, 5 Oct 2018 16:15:57 +0000 (09:15 -0700)]
Revert "Slightly refactor VecDeque implementation"

This reverts commit 6ce76acae455a32113116cd2f95f8076388fc2d3.

5 years agoRevert "Optimize VecDeque::append"
Alex Crichton [Fri, 5 Oct 2018 16:15:52 +0000 (09:15 -0700)]
Revert "Optimize VecDeque::append"

This reverts commit 11e488b64fed181820280d494d4fcc157ee1adc5.

5 years agoRevert "Add docs and debug asserts"
Alex Crichton [Fri, 5 Oct 2018 16:15:48 +0000 (09:15 -0700)]
Revert "Add docs and debug asserts"

This reverts commit 1a1a7f6167edf18b8a0ab488e651f7748cc2e9d3.

5 years agoRevert "Fix tidy"
Alex Crichton [Fri, 5 Oct 2018 16:15:44 +0000 (09:15 -0700)]
Revert "Fix tidy"

This reverts commit 1908892d3f60008f265dfc25ac46db387c0ad6a0.

5 years agoRevert "Add another assert"
Alex Crichton [Fri, 5 Oct 2018 16:15:39 +0000 (09:15 -0700)]
Revert "Add another assert"

This reverts commit 21d2a6c9868541ec9829ced9a5bae936b18741c5.

5 years agodro -> duckduckgo
Kazuyoshi Kato [Fri, 5 Oct 2018 15:52:44 +0000 (08:52 -0700)]
dro -> duckduckgo

dro means "doc.rust-lang.org", but it is too cryptic.

5 years agoAuto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertj
bors [Fri, 5 Oct 2018 15:32:19 +0000 (15:32 +0000)]
Auto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertj

Nest the `impl Trait` existential item inside the return type

fixes #54045

r? @cramertj

5 years agoadd suggestion for inverted function parameters
Andy Russell [Thu, 4 Oct 2018 02:21:05 +0000 (22:21 -0400)]
add suggestion for inverted function parameters

Fixes #54065.

5 years agoAuto merge of #54336 - petrochenkov:preuni, r=alexcrichton
bors [Fri, 5 Oct 2018 12:52:53 +0000 (12:52 +0000)]
Auto merge of #54336 - petrochenkov:preuni, r=alexcrichton

resolve: Some refactorings in preparation for uniform paths 2.0

The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (`fn early_resolve_ident_in_lexical_scope`), which can now be used for resolving first import segments as well when uniform paths are enabled.

r? @ghost

5 years agoRemove graphviz::IntoCow
ljedrz [Fri, 5 Oct 2018 12:16:10 +0000 (14:16 +0200)]
Remove graphviz::IntoCow

5 years agoStabilize min_const_fn feature gate
Oliver Scherer [Fri, 5 Oct 2018 10:29:03 +0000 (12:29 +0200)]
Stabilize min_const_fn feature gate

5 years agoRemove old unused error code
Oliver Scherer [Fri, 5 Oct 2018 10:28:46 +0000 (12:28 +0200)]
Remove old unused error code

5 years agoAdd doc comment explaining what `BlockTailInfo` is.
Felix S. Klock II [Fri, 5 Oct 2018 10:26:29 +0000 (12:26 +0200)]
Add doc comment explaining what `BlockTailInfo` is.

5 years agoAuto merge of #52121 - jebrosen:macros2_feature, r=petrochenkov
bors [Fri, 5 Oct 2018 10:08:01 +0000 (10:08 +0000)]
Auto merge of #52121 - jebrosen:macros2_feature, r=petrochenkov

Merge `proc_macro_` expansion feature gates as `proc_macro_hygiene`

Merges `proc_macro_mod`, `proc_macro_expr`, `proc_macro_non_items`, and `proc_macro_gen` into a single feature: `proc_macro_hygiene`. These features are not all blocked on implementing macro hygiene *per se*, but rather on interactions with hygiene that have not been entirely resolved.

5 years agoUnit tests for issue #54556. Some were also taken from issues #21114, #46413.
Felix S. Klock II [Wed, 3 Oct 2018 15:47:23 +0000 (17:47 +0200)]
Unit tests for issue #54556. Some were also taken from issues #21114, #46413.

5 years agoUpdates to .stderr output in ui tests from earlier changes.
Felix S. Klock II [Sat, 29 Sep 2018 21:30:43 +0000 (23:30 +0200)]
Updates to .stderr output in ui tests from earlier changes.

5 years agoImprove diagnostics for borrow-check errors that result from drops of temporary r...
Felix S. Klock II [Fri, 28 Sep 2018 13:25:02 +0000 (15:25 +0200)]
Improve diagnostics for borrow-check errors that result from drops of temporary r-values.

Changed `BorrowExplanation::UsedLaterWhenDropped` to handle both named
locals and also unnamed (aka temporaries).

If the dropped temporary does not implement `Drop`, then we print its
full type; but when the dropped temporary is itself an ADT `D` that
implements `Drop`, then diagnostic points the user directly at `D`.

5 years agoReplaced `String` with `&str` in API for `add_explanation_to_diagnostic`.
Felix S. Klock II [Fri, 5 Oct 2018 09:00:05 +0000 (11:00 +0200)]
Replaced `String` with `&str` in API for `add_explanation_to_diagnostic`.

5 years agomake `Parser::parse_foreign_item()` return a foreign item or error
Austin Bonander [Wed, 3 Oct 2018 21:24:31 +0000 (14:24 -0700)]
make `Parser::parse_foreign_item()` return a foreign item or error

closes #54441

5 years agocontast -> contrast
Takanori Ishibashi [Fri, 5 Oct 2018 09:47:37 +0000 (18:47 +0900)]
contast -> contrast

5 years agoHave `add_explanation_to_diagnostic` also take `Mir` as parameter.
Felix S. Klock II [Fri, 28 Sep 2018 10:23:40 +0000 (12:23 +0200)]
Have `add_explanation_to_diagnostic` also take `Mir` as parameter.

This is preparation for allowing the `BorrowExplanation` carry things
like `mir::Location` or `mir::Local` and still be able to generate
usable diagnostic text.

5 years agoAlpha-rename `BorrowExplanation::emit` to `BorrowExplanation::add_explanation_to_diag...
Felix S. Klock II [Fri, 28 Sep 2018 10:19:28 +0000 (12:19 +0200)]
Alpha-rename `BorrowExplanation::emit` to `BorrowExplanation::add_explanation_to_diagnostic`.

(I found it confusing to have calls to an `emit` method in our
error_reporting module where that `emit` method *wasn't* the
`DiagnosticBuffer::emit` method.)