]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agotranslate / export weak lang items
Jorge Aparicio [Thu, 21 Jun 2018 18:01:16 +0000 (13:01 -0500)]
translate / export weak lang items

see #51671 for details

fixes #51671
fixes #51342

6 years agoAuto merge of #50698 - Eijebong:tempfile, r=oli-obk
bors [Wed, 20 Jun 2018 22:40:18 +0000 (22:40 +0000)]
Auto merge of #50698 - Eijebong:tempfile, r=oli-obk

Replace tempdir by tempfile

6 years agoFix tidy
Bastien Orivel [Sun, 13 May 2018 13:26:55 +0000 (15:26 +0200)]
Fix tidy

6 years agoReplace tempdir by tempfile in librustc
Bastien Orivel [Sat, 12 May 2018 21:19:35 +0000 (23:19 +0200)]
Replace tempdir by tempfile in librustc

This removes the last dependency on tempdir.

6 years agoReplace tempdir by tempfile in librustc_trans
Bastien Orivel [Tue, 8 May 2018 20:11:58 +0000 (22:11 +0200)]
Replace tempdir by tempfile in librustc_trans

6 years agoReplace tempdir by tempfile in librustdoc
Bastien Orivel [Tue, 8 May 2018 20:06:04 +0000 (22:06 +0200)]
Replace tempdir by tempfile in librustdoc

6 years agoAuto merge of #51651 - spastorino:fix_var_name_in_e0502, r=nikomatsakis
bors [Wed, 20 Jun 2018 12:46:15 +0000 (12:46 +0000)]
Auto merge of #51651 - spastorino:fix_var_name_in_e0502, r=nikomatsakis

Fix variable name in E0502 double borrow error

Closes #51268

r? @nikomatsakis

6 years agoFix variable name in E0502 double borrow error
Santiago Pastorino [Wed, 20 Jun 2018 04:31:33 +0000 (01:31 -0300)]
Fix variable name in E0502 double borrow error

6 years agoAuto merge of #51638 - spastorino:diagnostic-suggest-drop-in-reverse, r=nikomatsakis
bors [Wed, 20 Jun 2018 09:30:02 +0000 (09:30 +0000)]
Auto merge of #51638 - spastorino:diagnostic-suggest-drop-in-reverse, r=nikomatsakis

Diagnostic suggest drop in reverse

Closes #51195

6 years agoAuto merge of #51644 - Sgeo:patch-1, r=rkruppe
bors [Wed, 20 Jun 2018 06:54:17 +0000 (06:54 +0000)]
Auto merge of #51644 - Sgeo:patch-1, r=rkruppe

Remove erroneous example of main as a non-Result function.

6 years agoAuto merge of #51631 - WiSaGaN:patch-1, r=Mark-Simulacrum
bors [Wed, 20 Jun 2018 03:46:05 +0000 (03:46 +0000)]
Auto merge of #51631 - WiSaGaN:patch-1, r=Mark-Simulacrum

Fix links in RELEASES.md

6 years agoAuto merge of #51617 - nnethercote:nll-allocs, r=pnkfelix
bors [Wed, 20 Jun 2018 01:39:43 +0000 (01:39 +0000)]
Auto merge of #51617 - nnethercote:nll-allocs, r=pnkfelix

Reduce number of allocations done by NLL

A couple of easy wins. Here are the NLL speedups that exceed 1%:
```
sentry-cli-check
        avg: -3.5%      min: -3.5%      max: -3.5%
inflate-check
        avg: -1.9%      min: -1.9%      max: -1.9%
inflate
        avg: -1.7%      min: -1.7%      max: -1.7%
clap-rs-check
        avg: -1.6%      min: -1.6%      max: -1.6%
cargo-check
        avg: -1.6%      min: -1.6%      max: -1.6%
ripgrep-check
        avg: -1.4%      min: -1.4%      max: -1.4%
serde-check
        avg: -1.2%      min: -1.2%      max: -1.2%
regex-check
        avg: -1.0%      min: -1.0%      max: -1.0%
sentry-cli
        avg: -1.0%      min: -1.0%      max: -1.0%
```
r? @nikomatsakis

6 years agoRun rustfmt
Santiago Pastorino [Wed, 20 Jun 2018 00:22:52 +0000 (21:22 -0300)]
Run rustfmt

6 years agoSuggest that values are dropped in the opposite order they are defined
Santiago Pastorino [Wed, 13 Jun 2018 17:51:53 +0000 (14:51 -0300)]
Suggest that values are dropped in the opposite order they are defined

6 years agoAuto merge of #51639 - SimonSapin:missing-alloc, r=rkruppe
bors [Tue, 19 Jun 2018 23:37:09 +0000 (23:37 +0000)]
Auto merge of #51639 - SimonSapin:missing-alloc, r=rkruppe

Update the error message for a missing global allocator

Don’t mention `#[default_lib_allocator]` (which is an implementation detail irrelevant to most users) and  instead suggest using `#[global_allocator]`, which is often the correct fix.

6 years agoRemove erroneous example of main as a non-Result function.
Sgeo [Tue, 19 Jun 2018 22:32:44 +0000 (18:32 -0400)]
Remove erroneous example of main as a non-Result function.

6 years agoAuto merge of #51275 - pnkfelix:nll-diagnostics-revise-check-access-permissions,...
bors [Tue, 19 Jun 2018 21:31:36 +0000 (21:31 +0000)]
Auto merge of #51275 - pnkfelix:nll-diagnostics-revise-check-access-permissions, r=nikomatsakis

NLL diagnostics: revise `fn check_access_permissions`

NLL: revise `fn check_access_permissions` so that its (still branchy) shares more code paths between the different cases, and also provide more diagnostics in more cases (though the added diagnostics still do not always meet the quality bar established by AST-borrowck)

----

Transcribing "checklist" suggested by Niko, except I am rendering it as a table to make it clear that I do not regard every item in the list to be a "must have" for landing this PR.

goal | does this PR do it?
-----|------------------------------
no suggestions for `ref mut` |  yes
suggestions for direct local assignment (`{ let x = 3; x = 4; }`) | yes (see commits at end)
suggestions for direct field assignment (`{ let x = (3, 4); x.0 = 5; }` | yes (see commits at end)
suggestions for upvars (`let x = 3; let c = \|\| { &mut x; }`) | yes

Note that I added support for a couple of rows via changes that are not strictly part of `fn check_access_permissions`. If desired I can remove those commits from this PR and leave them for a later PR.

Fix #51031
Fix #51032
(bug #51191 needs a little more investigation before closing.)
Fix #51578

6 years agoAuto merge of #51543 - SimonSapin:oom, r=SimonSapin
bors [Tue, 19 Jun 2018 19:22:12 +0000 (19:22 +0000)]
Auto merge of #51543 - SimonSapin:oom, r=SimonSapin

Rename OOM to allocation error

The acronym is not descriptive unless one has seen it before.

* Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle.
* Rename `set_oom_hook` to `set_alloc_error_hook`
* Rename `take_oom_hook` to `take_alloc_error_hook`

Bikeshed: `on` v.s. `for`, `alloc` v.s. `allocator`, `error` v.s. `failure`

6 years agoUpdate the error message for a missing global allocator
Simon Sapin [Tue, 19 Jun 2018 18:10:56 +0000 (20:10 +0200)]
Update the error message for a missing global allocator

Don’t mention `#[default_lib_allocator]` (which is an implementation detail
irrelevant to most users) and instead suggest using `#[global_allocator]`,
which is often the correct fix.

6 years agoAdd a UI test for the missing allocator error message
Simon Sapin [Tue, 19 Jun 2018 17:44:18 +0000 (19:44 +0200)]
Add a UI test for the missing allocator error message

6 years agoAdd unit test for case that didn't seem to be covered in existing UI tests
Felix S. Klock II [Fri, 15 Jun 2018 03:51:42 +0000 (05:51 +0200)]
Add unit test for case that didn't seem to be covered in existing UI tests
(since I made this mistake at first but the tests didn't catch it):
we should not suggest adding `mut` to a reassigned `ref` or `ref mut` binding.

(The Rust language, since at least 1.0, does not have `mut ref mut` or
`ref mut mut` etc.)

6 years agoUpdate the existing compile-fail tests to reflect diagnostic changes in NLL.
Felix S. Klock II [Fri, 15 Jun 2018 03:49:53 +0000 (05:49 +0200)]
Update the existing compile-fail tests to reflect diagnostic changes in NLL.

6 years agoUpdate the existing UI tests to reflect diagnostic changes in NLL.
Felix S. Klock II [Fri, 15 Jun 2018 03:49:29 +0000 (05:49 +0200)]
Update the existing UI tests to reflect diagnostic changes in NLL.

6 years agoAdded diagnostics for suggesting `mut x` on repeated mutations of `x`.
Felix S. Klock II [Fri, 15 Jun 2018 03:47:36 +0000 (05:47 +0200)]
Added diagnostics for suggesting `mut x` on repeated mutations of `x`.

(Follow-on commits updating the test suite show the resulting changes
to diagnostic output.)

6 years agoupdates to compile-fail tests for changes to NLL.
Felix S. Klock II [Tue, 12 Jun 2018 17:12:19 +0000 (19:12 +0200)]
updates to compile-fail tests for changes to NLL.

6 years agoNLL: Updates to diagnostic output in `test/ui`.
Felix S. Klock II [Tue, 12 Jun 2018 16:01:48 +0000 (18:01 +0200)]
NLL: Updates to diagnostic output in `test/ui`.

6 years agoNLL: Broad rewrite of check_access_perimssions.
Felix S. Klock II [Tue, 12 Jun 2018 16:00:27 +0000 (18:00 +0200)]
NLL: Broad rewrite of check_access_perimssions.

Tried to unify various common code paths and also vaguely approximate
the AST-borrowck diagnostics.

The change in (subjective) quality of diagnostics is not a universal
improvement. But I think this is a better code base to work from
for future fixes.

6 years agosmall refactoring: replaced mutable state with `return` statements in control flow.
Felix S. Klock II [Mon, 11 Jun 2018 17:11:48 +0000 (19:11 +0200)]
small refactoring: replaced mutable state with `return` statements in control flow.

As a drive-by, removed some dead-code.

6 years agoThread more argument info down from `Hir` into the `mir::LocalDecls`.
Felix S. Klock II [Thu, 7 Jun 2018 15:05:58 +0000 (17:05 +0200)]
Thread more argument info down from `Hir` into the `mir::LocalDecls`.

Namely, we thread down the `HirId` of the explicit type of the
argument.  In the case of the special `self` variable with an implicit
type, we also thread down a description of its structure (`self`/`mut
self`/`&self`/`&mut self`).

6 years agoAdd `fn fn_decl` to `Hir`, for looking up the `FnDecl` of a body owner.
Felix S. Klock II [Thu, 7 Jun 2018 15:03:58 +0000 (17:03 +0200)]
Add `fn fn_decl` to `Hir`, for looking up the `FnDecl` of a body owner.

6 years agoRefactor: Replace anonymous-tuple with tuple struct as prep for adding more fields...
Felix S. Klock II [Thu, 7 Jun 2018 14:32:07 +0000 (16:32 +0200)]
Refactor: Replace anonymous-tuple with tuple struct as prep for adding more fields in future.

6 years agoThread info about form of variable bindings, including spans of arg types, down into...
Felix S. Klock II [Thu, 7 Jun 2018 13:25:08 +0000 (15:25 +0200)]
Thread info about form of variable bindings, including spans of arg types, down into `mir::LocalDecls`.

As a drive-by: the ref_for_guards created by `fn declare_binding`
should not have been tagged as user_variables in the first
place. These secret internal locals are *pointers* to user variables,
but themselves are not such (IMO. For now at least.)

6 years agoAuto merge of #51367 - oli-obk:silence!_I_test_you, r=Mark-Simulacrum
bors [Tue, 19 Jun 2018 15:05:19 +0000 (15:05 +0000)]
Auto merge of #51367 - oli-obk:silence!_I_test_you, r=Mark-Simulacrum

Use quiet tests by default

r? @eddyb

6 years agoAuto merge of #51081 - kornelski:examplestr, r=steveklabnik
bors [Tue, 19 Jun 2018 13:09:04 +0000 (13:09 +0000)]
Auto merge of #51081 - kornelski:examplestr, r=steveklabnik

Use String, not &str in some collection examples

Discussed in #46966

Overuse of borrowed values in data structures is a common mistake I see in Rust user forums. Users who copy&paste such examples end up fighting with the borrow checker as soon as they replace string literals with some real values.

This changes a couple of examples to use `String`, and it adds opportunity to demonstrate use of `Borrow`.

6 years agoAuto merge of #51597 - Mark-Simulacrum:update-books, r=Mark-Simulacrum
bors [Tue, 19 Jun 2018 10:53:36 +0000 (10:53 +0000)]
Auto merge of #51597 - Mark-Simulacrum:update-books, r=Mark-Simulacrum

Update books for next release

6 years agoAuto merge of #50383 - stevepentland:union-derive, r=oli-obk
bors [Tue, 19 Jun 2018 08:50:41 +0000 (08:50 +0000)]
Auto merge of #50383 - stevepentland:union-derive, r=oli-obk

Add ability to apply custom derive to union types.

The Union item type has been included in the allowed types for a custom derive.
fyi @abonander

Closes #50223

6 years agoFix links in README.md
Wangshan Lu [Tue, 19 Jun 2018 08:07:14 +0000 (16:07 +0800)]
Fix links in README.md

6 years agoAuto merge of #51383 - Zoxc:parallel-stuff, r=nikomatsakis
bors [Tue, 19 Jun 2018 06:51:18 +0000 (06:51 +0000)]
Auto merge of #51383 - Zoxc:parallel-stuff, r=nikomatsakis

Run some stuff in parallel

Requires https://github.com/rust-lang/rust/pull/50699 to actually work correctly.

r? @nikomatsakis

6 years agoAuto merge of #51278 - EPashkin:fix_mod_with_multilevel_paths_on_windows, r=nikomatsakis
bors [Tue, 19 Jun 2018 02:17:52 +0000 (02:17 +0000)]
Auto merge of #51278 - EPashkin:fix_mod_with_multilevel_paths_on_windows, r=nikomatsakis

Fix processing mod with multi-level path on Windows

Fix error in [rustfmt](https://github.com/rust-lang-nursery/rustfmt/issues/1754) because libsyntax can not handle `mod` with multilevel path on Windows.

Alternative is do almost same in https://github.com/rust-lang/rust/blob/master/src/libstd/sys/windows/fs.rs#L717 to allow work on paths with different separators, Ex. "\\\\?\\c:\\windows/temp"

6 years agoAdd ability to apply custom derive to union types.
Steve Pentland [Tue, 1 May 2018 23:57:42 +0000 (19:57 -0400)]
Add ability to apply custom derive to union types.

The Union item type has been included in the allowed types for a custom
derive. Closes #50223

6 years agoUse MTRef and MTLock to avoid a RefCell
John Kåre Alsaker [Fri, 8 Jun 2018 15:49:21 +0000 (17:49 +0200)]
Use MTRef and MTLock to avoid a RefCell

6 years agoAdd MTRef and a lock_mut function to MTLock
John Kåre Alsaker [Fri, 8 Jun 2018 15:48:31 +0000 (17:48 +0200)]
Add MTRef and a lock_mut function to MTLock

6 years agoParallelize trans item collection
John Kåre Alsaker [Sun, 21 Jan 2018 18:46:14 +0000 (19:46 +0100)]
Parallelize trans item collection

6 years agoSave query results and the dep graph in parallel
John Kåre Alsaker [Wed, 24 Jan 2018 08:59:08 +0000 (09:59 +0100)]
Save query results and the dep graph in parallel

6 years agoParallel code
John Kåre Alsaker [Thu, 15 Mar 2018 09:08:52 +0000 (10:08 +0100)]
Parallel code

6 years agoAdd par_body_owners
John Kåre Alsaker [Thu, 15 Mar 2018 09:05:33 +0000 (10:05 +0100)]
Add par_body_owners

6 years agoReturn a `SmallVec` from `place_elements`.
Nicholas Nethercote [Mon, 18 Jun 2018 06:32:28 +0000 (16:32 +1000)]
Return a `SmallVec` from `place_elements`.

These vectors are always small, so this avoids lots of allocations.

6 years agoAvoid allocations in `has_any_child_of`.
Nicholas Nethercote [Mon, 18 Jun 2018 04:52:59 +0000 (14:52 +1000)]
Avoid allocations in `has_any_child_of`.

`has_any_child_of` is hot. It allocates a `Vec` that almost always
doesn't exceed a length of 1.

This patch peels off the first iteration of the loop, avoiding the need
for the `Vec` creation in ~99% of cases.

6 years agoAuto merge of #51248 - fabric-and-ink:newtype_index_debrujin, r=nikomatsakis
bors [Mon, 18 Jun 2018 23:14:50 +0000 (23:14 +0000)]
Auto merge of #51248 - fabric-and-ink:newtype_index_debrujin, r=nikomatsakis

Declare DebruijnIndex via newtype_index macro

Part of #49887

Declare `DebruijnIndex` via the `newtype_index` macro.

6 years agoRename OOM to allocation error
Simon Sapin [Wed, 13 Jun 2018 22:32:30 +0000 (00:32 +0200)]
Rename OOM to allocation error

The acronym is not descriptive unless one has seen it before.

* Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle.
* Rename `set_oom_hook` to `set_alloc_error_hook`
* Rename `take_oom_hook` to `take_alloc_error_hook`

Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`

6 years agoAuto merge of #50894 - teiesti:stabilize_path_ancestors, r=dtolnay
bors [Mon, 18 Jun 2018 18:56:13 +0000 (18:56 +0000)]
Auto merge of #50894 - teiesti:stabilize_path_ancestors, r=dtolnay

Stabilize std::path::Path::ancestors

Closes #48581

r? @BurntSushi

6 years agoStabilize std::path::Path:ancestors
Tobias Stolzmann [Sat, 19 May 2018 15:49:13 +0000 (17:49 +0200)]
Stabilize std::path::Path:ancestors

6 years agoAuto merge of #51460 - nikomatsakis:nll-perf-examination-refactor-1, r=pnkfelix
bors [Mon, 18 Jun 2018 16:37:10 +0000 (16:37 +0000)]
Auto merge of #51460 - nikomatsakis:nll-perf-examination-refactor-1, r=pnkfelix

Improve memoization and refactor NLL type check

I have a big branch that is refactoring NLL type check with the goal of introducing canonicalization-based memoization for all of the operations it does. This PR contains an initial prefix of that branch which, I believe, stands alone. It does introduce a few smaller optimizations of its own:

- Skip operations that are trivially a no-op
- Cache the results of the dropck-outlives computations done by liveness
- Skip resetting unifications if nothing changed

r? @pnkfelix

6 years agoUpdate books for next release
Mark Simulacrum [Sat, 16 Jun 2018 17:33:20 +0000 (11:33 -0600)]
Update books for next release

6 years agoAuto merge of #51414 - oli-obk:impl_trait_type_def, r=pnkfelix
bors [Mon, 18 Jun 2018 14:34:52 +0000 (14:34 +0000)]
Auto merge of #51414 - oli-obk:impl_trait_type_def, r=pnkfelix

Add existential type definitions

Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items.

r? @nikomatsakis

6 years agoPrefer use of owned values in examples
Kornel [Sat, 26 May 2018 11:18:24 +0000 (12:18 +0100)]
Prefer use of owned values in examples

6 years agoAuto merge of #51605 - ericfindlay:master, r=kennytm
bors [Mon, 18 Jun 2018 00:27:58 +0000 (00:27 +0000)]
Auto merge of #51605 - ericfindlay:master, r=kennytm

Fixed minor error in Compiler Error Index, E0603.

6 years agoAuto merge of #51404 - clarcharr:never_hash, r=KodrAus
bors [Sun, 17 Jun 2018 22:25:34 +0000 (22:25 +0000)]
Auto merge of #51404 - clarcharr:never_hash, r=KodrAus

impl Hash for !

This was missing in some generic code I was writing and I figured that it would be worthwhile to add this. Blanket-requiring these traits to allow usage of errors in `HashSet`s and `HashMap`s isn't too unreasonable of a use case, and a prerequisite for allowing `!` as an error in such situations is this impl.

6 years agoAuto merge of #51529 - nodakai:improve-sys_common-mutex, r=oli-obk
bors [Sun, 17 Jun 2018 20:11:35 +0000 (20:11 +0000)]
Auto merge of #51529 - nodakai:improve-sys_common-mutex, r=oli-obk

libstd: add an RAII utility for sys_common::mutex::Mutex

It is indeed debatable whether or not we should introduce more sophistication like this to the lowest layer of a system library. In fact, `Drop::drop()` cannot be `unsafe` (IIRC there was a discussion on introducing an unsafe variant of `Drop` whose entire scope must be within `unsafe`)

6 years agoAuto merge of #51555 - ccesare:remove_unused_variables_redox_os, r=kennytm
bors [Sun, 17 Jun 2018 18:06:31 +0000 (18:06 +0000)]
Auto merge of #51555 - ccesare:remove_unused_variables_redox_os, r=kennytm

Removed two unused variables in os.rs

Issue #51419 suggested removing two unused variables in `libstd/sys/redox/os.rs`. This PR implements that change.

It compiles for me locally, but I haven't run any other tests.

6 years agoAuto merge of #51552 - ccesare:patch-1, r=kennytm
bors [Sun, 17 Jun 2018 16:07:29 +0000 (16:07 +0000)]
Auto merge of #51552 - ccesare:patch-1, r=kennytm

Minor language change to CONTRIBUTING.md

In the `#building` section, the doc read that a default configuration "shall use around 3.5 GB of disk space." Changed "shall use" to "requires," as I don't think it's meant to sound so prescriptive.

6 years agoAuto merge of #51549 - PSeitz:patch-1, r=kennytm
bors [Sun, 17 Jun 2018 14:05:43 +0000 (14:05 +0000)]
Auto merge of #51549 - PSeitz:patch-1, r=kennytm

Follow up to #51508, make parse_block public instead parse_block_expr

This is an follow up to #51508

I mistakenly made parse_block_expr public instead of parse_block.
This fixes this.

6 years agoAuto merge of #51392 - glaubitz:powerpc-tests, r=petrochenkov
bors [Sun, 17 Jun 2018 11:53:56 +0000 (11:53 +0000)]
Auto merge of #51392 - glaubitz:powerpc-tests, r=petrochenkov

test: Ignore some problematic tests on powerpc and powerpc64*

This updates the list of tests which can be safely ignored on powerpc and powerpc64*.

6 years agotest: Ignore some problematic tests on powerpc and powerpc64*
John Paul Adrian Glaubitz [Tue, 5 Jun 2018 22:12:00 +0000 (00:12 +0200)]
test: Ignore some problematic tests on powerpc and powerpc64*

6 years agoAuto merge of #51425 - QuietMisdreavus:thats-def-a-namespace-there, r=petrochenkov
bors [Sun, 17 Jun 2018 09:48:10 +0000 (09:48 +0000)]
Auto merge of #51425 - QuietMisdreavus:thats-def-a-namespace-there, r=petrochenkov

refactor: create multiple HIR items for imports

When lowering `use` statements into HIR, they get a `Def` of the thing they're pointing at. This is great for things that need to know what was just pulled into scope. However, this is a bit misleading, because a `use` statement can pull things from multiple namespaces if their names collide. This is a problem for rustdoc, because if there are a module and a function with the same name (for example) then it will only document the module import, because that's that the lowered `use` statement points to.

The current version of this PR does the following:

* Whenever the resolver comes across a `use` statement, it loads the definitions into a new `import_map` instead of the existing `def_map`. This keeps the resolutions per-namespace so that all the target definitions are available.
* When lowering `use` statements, it looks up the resolutions in the `import_map` and creates multiple `Item`s if there is more than one resolution.
* To ensure the `NodeId`s are properly tracked in the lowered module, they need to be created in the AST, and pulled out as needed if multiple resolutions are available.

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

6 years agoAuto merge of #51466 - joshlf:ref-split, r=dtolnay
bors [Sun, 17 Jun 2018 07:49:25 +0000 (07:49 +0000)]
Auto merge of #51466 - joshlf:ref-split, r=dtolnay

Add Ref/RefMut map_split method

As proposed [here](https://internals.rust-lang.org/t/make-refcell-support-slice-splitting/7707).

TLDR: Add a `map_split` method that allows multiple `RefMut`s to exist simultaneously so long as they refer to non-overlapping regions of the original `RefCell`. This is useful for things like the slice `split_at_mut` method.

6 years agolibstd: add an RAII utility for sys_common::mutex::Mutex
NODA, Kai [Sat, 9 Jun 2018 13:13:04 +0000 (21:13 +0800)]
libstd: add an RAII utility for sys_common::mutex::Mutex

Signed-off-by: NODA, Kai <nodakai@gmail.com>
6 years agoAuto merge of #51382 - GuillaumeGomez:intra-link-lint, r=QuietMisdreavus
bors [Sun, 17 Jun 2018 02:57:40 +0000 (02:57 +0000)]
Auto merge of #51382 - GuillaumeGomez:intra-link-lint, r=QuietMisdreavus

Add lint for intra link resolution failure

This PR is almost done, just remains this note:

```
note: requested on the command line with `-W intra-link-resolution-failure`
```

I have no idea why my lint is considered as being passed through command line and wasn't able to find where it was set. If anyone has an idea, it'd be very helpful!

cc @QuietMisdreavus

6 years agoFixed minor error in Compiler Error Index, E0603.
Eric Findlay [Sun, 17 Jun 2018 02:35:53 +0000 (11:35 +0900)]
Fixed minor error in Compiler Error Index, E0603.

6 years agoAuto merge of #51596 - Mark-Simulacrum:bootstrap-racy-tests, r=petrochenkov
bors [Sat, 16 Jun 2018 23:48:16 +0000 (23:48 +0000)]
Auto merge of #51596 - Mark-Simulacrum:bootstrap-racy-tests, r=petrochenkov

Prevent Windows filesystem races in bootstrap tests

Fixes #51595.

This also makes bootstrap tests run near last in `./x.py test` invocations
since they are unlikely to fail.

r? @petrochenkov

6 years agoAuto merge of #51594 - eddyb:issue-51582, r=nagisa
bors [Sat, 16 Jun 2018 21:48:31 +0000 (21:48 +0000)]
Auto merge of #51594 - eddyb:issue-51582, r=nagisa

rustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums.

Fixes #51582. r? @nagisa cc @nox @oli-obk

6 years agoAuto merge of #51558 - Manishearth:manish-is-stupid, r=oli-obk
bors [Sat, 16 Jun 2018 19:49:33 +0000 (19:49 +0000)]
Auto merge of #51558 - Manishearth:manish-is-stupid, r=oli-obk

Fix my comment on editions

me = idiot

r? @oli-obk

6 years agoAuto merge of #51584 - QuietMisdreavus:globs-and-crosses, r=ollie27
bors [Sat, 16 Jun 2018 17:43:24 +0000 (17:43 +0000)]
Auto merge of #51584 - QuietMisdreavus:globs-and-crosses, r=ollie27

rustdoc: process cross-crate glob re-exports

Turns out, we were deliberately ignoring glob re-exports when they were occurring across crates, even though we were fully processing them for local re-exports. This will at least bring the two into parity.

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

6 years agoPrevent Windows filesystem races in bootstrap tests
Mark Simulacrum [Sat, 16 Jun 2018 17:12:15 +0000 (11:12 -0600)]
Prevent Windows filesystem races in bootstrap tests

6 years agoMove bootstrap tests to the end of the default test run
Mark Simulacrum [Sat, 16 Jun 2018 17:11:06 +0000 (11:11 -0600)]
Move bootstrap tests to the end of the default test run

Since they are unlikely to fail and are almost never going to fail
except with bootstrap changes (which would be tested locally anyway) it
makes sense to run these tests close to last.

6 years agoAuto merge of #51591 - pietroalbini:release-notes-fix, r=Mark-Simulacrum
bors [Sat, 16 Jun 2018 13:08:16 +0000 (13:08 +0000)]
Auto merge of #51591 - pietroalbini:release-notes-fix, r=Mark-Simulacrum

Remove `?` macro separator compatibility note from 1.27 release notes

The implementation has been reverted in https://github.com/rust-lang/rust/pull/51417, so this no longer applies to 1.27.0.

r? @Mark-Simulacrum

6 years agorustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums.
Eduard-Mihai Burtescu [Sat, 16 Jun 2018 11:19:05 +0000 (14:19 +0300)]
rustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums.

6 years agoRemove `?` macro separator compatibility note from 1.27 release notes
Pietro Albini [Sat, 16 Jun 2018 11:39:35 +0000 (13:39 +0200)]
Remove `?` macro separator compatibility note from 1.27 release notes

The implementation has been reverted.

6 years agoAuto merge of #51562 - SimonSapin:transparent, r=cramertj
bors [Sat, 16 Jun 2018 10:59:40 +0000 (10:59 +0000)]
Auto merge of #51562 - SimonSapin:transparent, r=cramertj

Stabilize #[repr(transparent)]

Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318
Reference PR: https://github.com/rust-lang-nursery/reference/pull/353

6 years agoAuto merge of #51550 - eddyb:queries-not-maps, r=nikomatsakis
bors [Sat, 16 Jun 2018 08:48:46 +0000 (08:48 +0000)]
Auto merge of #51550 - eddyb:queries-not-maps, r=nikomatsakis

rustc: rename ty::maps to ty::query.

Should've never been `maps` but "query system/engine" didn't fully settle from the start.

r? @michaelwoerister or @nikomatsakis

6 years agoAuto merge of #51581 - GuillaumeGomez:keyword-doc, r=QuietMisdreavus
bors [Sat, 16 Jun 2018 06:38:16 +0000 (06:38 +0000)]
Auto merge of #51581 - GuillaumeGomez:keyword-doc, r=QuietMisdreavus

Keyword doc

Part of #51451.

r? @QuietMisdreavus

6 years agoFollow up on https://github.com/rust-lang/rust/pull/51508, make parse_block public...
PSeitz [Thu, 14 Jun 2018 08:18:44 +0000 (10:18 +0200)]
Follow up on https://github.com/rust-lang/rust/pull/51508, make parse_block public instead parse_block_expr

This is an follow up to #51508

I mistakenly made parse_block_expr public instead of parse_block.
This fixes this.

6 years agoAuto merge of #51411 - nnethercote:process_predicate, r=nikomatsakis
bors [Sat, 16 Jun 2018 03:06:10 +0000 (03:06 +0000)]
Auto merge of #51411 - nnethercote:process_predicate, r=nikomatsakis

Speed up obligation forest code

Here are the rustc-perf benchmarks that get at least a 1% speedup on one or more of their runs with these patches applied:
```
inflate-check
        avg: -8.7%      min: -12.1%     max: 0.0%
inflate
        avg: -5.9%      min: -8.6%      max: 1.1%
inflate-opt
        avg: -1.5%      min: -2.0%      max: -0.3%
clap-rs-check
        avg: -0.6%      min: -1.9%      max: 0.5%
coercions
        avg: -0.2%?     min: -1.3%?     max: 0.6%?
serde-opt
        avg: -0.6%      min: -1.0%      max: 0.1%
coercions-check
        avg: -0.4%?     min: -1.0%?     max: -0.0%?
```

6 years agoprocess cross-crate glob re-exports
QuietMisdreavus [Fri, 15 Jun 2018 23:16:43 +0000 (18:16 -0500)]
process cross-crate glob re-exports

6 years agoAuto merge of #51462 - Havvy:refactor-cmp, r=nikomatsakis
bors [Fri, 15 Jun 2018 23:16:09 +0000 (23:16 +0000)]
Auto merge of #51462 - Havvy:refactor-cmp, r=nikomatsakis

Refactor: Rename ExistentialPredicate::cmp to ExistentialPredicate::stable_cmp

See https://github.com/rust-lang/rust/pull/51276#discussion_r193549404 for
rationale.

Because stable_cmp takes three arguments and Ord::cmp takes two, I am confident that there is no shadowing happening here.

r? @nikomatsakis

6 years agoAdd rustdoc-js tester should-fail option
Guillaume Gomez [Fri, 15 Jun 2018 21:39:20 +0000 (23:39 +0200)]
Add rustdoc-js tester should-fail option

6 years agoFix search fn keyword
Guillaume Gomez [Fri, 15 Jun 2018 21:23:25 +0000 (23:23 +0200)]
Fix search fn keyword

6 years agoAdd doc for fn keyword
Guillaume Gomez [Fri, 15 Jun 2018 21:23:11 +0000 (23:23 +0200)]
Add doc for fn keyword

6 years agoturn expect_full_def_from_use into an iterator
QuietMisdreavus [Fri, 15 Jun 2018 19:47:07 +0000 (14:47 -0500)]
turn expect_full_def_from_use into an iterator

6 years agoAuto merge of #50296 - cmdd:master, r=nikomatsakis
bors [Fri, 15 Jun 2018 19:05:25 +0000 (19:05 +0000)]
Auto merge of #50296 - cmdd:master, r=nikomatsakis

Add error message for using >= 65535 hashes for raw string literal escapes

Fixes #50111.

6 years agoFix compile error
Fabian Drinck [Fri, 15 Jun 2018 17:03:36 +0000 (19:03 +0200)]
Fix compile error

6 years agoAuto merge of #51565 - kennytm:fix-toolstate-on-appveyor, r=Mark-Simulacrum
bors [Fri, 15 Jun 2018 16:38:08 +0000 (16:38 +0000)]
Auto merge of #51565 - kennytm:fix-toolstate-on-appveyor, r=Mark-Simulacrum

Fix the recent spurious breakage on AppVeyor.

Fixed the spurious error introduced by d2b5b7603b6b7ecb4ff93981c785aef640015e68 due to a wrongly resolved relative path on AppVeyor.

This only starts to happen today because we just entered the last week of the 6-week cycle.

6 years agoFix issue on unix
Guillaume Gomez [Fri, 15 Jun 2018 08:00:57 +0000 (10:00 +0200)]
Fix issue on unix

6 years agoimpl Hash for !
Clar Charr [Wed, 6 Jun 2018 23:40:03 +0000 (19:40 -0400)]
impl Hash for !

6 years agoadd test for issue 34843
QuietMisdreavus [Fri, 8 Jun 2018 18:38:10 +0000 (13:38 -0500)]
add test for issue 34843

6 years agorustdoc: discard struct ctors from imports
QuietMisdreavus [Thu, 14 Jun 2018 21:34:32 +0000 (16:34 -0500)]
rustdoc: discard struct ctors from imports

6 years agocreate multiple HIR items for a use statement
QuietMisdreavus [Wed, 13 Jun 2018 16:44:06 +0000 (11:44 -0500)]
create multiple HIR items for a use statement

6 years agoFix checkregression breakage of toolstate builder on AppVeyor.
kennytm [Thu, 14 Jun 2018 19:49:13 +0000 (03:49 +0800)]
Fix checkregression breakage of toolstate builder on AppVeyor.

6 years agoFix comment on editions
Manish Goregaokar [Thu, 14 Jun 2018 17:46:50 +0000 (10:46 -0700)]
Fix comment on editions

6 years agoCircumvent const fn problem
Fabian Drinck [Sun, 10 Jun 2018 16:07:58 +0000 (18:07 +0200)]
Circumvent const fn problem