]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoDeny bare trait objects in in src/librustc
ljedrz [Wed, 11 Jul 2018 10:05:10 +0000 (12:05 +0200)]
Deny bare trait objects in in src/librustc

6 years agoAuto merge of #52177 - ljedrz:bare_gcc_warning, r=alexcrichton
bors [Tue, 10 Jul 2018 06:52:20 +0000 (06:52 +0000)]
Auto merge of #52177 - ljedrz:bare_gcc_warning, r=alexcrichton

Warn windows-gnu users that the bundled gcc can't compile

Add a `DO NOT USE THIS gcc.exe FOR COMPILATION.txt` file to `lib\rustlib\*-pc-windows-gnu\bin` folders in `windows-gnu` installations in order to warn against attempting to use the bundled `gcc.exe` as a C compiler. I'm pretty sure that location is usually found manually, so this should be easily noticeable.

This mistake has been made plenty of times and has lead to misunderstandings:
Rust: [Bundled gcc (windows x64) is unable to build any c file](https://github.com/rust-lang/rust/issues/24418)
gtk-rs:    [Compiling on windows](https://github.com/gtk-rs/gtk/issues/625)
bzip2-rs: [Build failure at gcc level: blocksort.c not found](https://github.com/alexcrichton/bzip2-rs/issues/30)

Alternatives: rename the bundled `gcc.exe` to e.g. `rustc-gcc.exe` or `gcc-linker.exe`. This might require a more comprehensive change or break crates already using it as a linker.

r? @alexcrichton

6 years agoAuto merge of #51583 - cuviper:packed_pair-bool, r=Mark-Simulacrum
bors [Tue, 10 Jul 2018 03:08:47 +0000 (03:08 +0000)]
Auto merge of #51583 - cuviper:packed_pair-bool, r=Mark-Simulacrum

Store scalar pair bools as i8 in memory

We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates,
to optimize IR for checked operators and the like.  With this patch, we
still do so when the pair is an immediate value, but we use the `i8`
memory type when the value is loaded or stored as an LLVM aggregate.

So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }`
in memory.  When a pair is a direct function argument, `PassMode::Pair`,
it is still passed using the immediate `i1` type, but as a return value
it will use the `i8` memory type.  Also, `bool`-like` enum tags will now
use scalar pairs when possible, where they were previously excluded due
to optimization issues.

Fixes #51516.
Closes #51566.

r? @eddyb
cc @nox

6 years agoAuto merge of #52100 - nielx:fix/rust_driver-stacklimit, r=cramertj
bors [Tue, 10 Jul 2018 01:07:23 +0000 (01:07 +0000)]
Auto merge of #52100 - nielx:fix/rust_driver-stacklimit, r=cramertj

Haiku: work around the lack of setrlimit

The default Unix codepath fails, because Haiku does not implement
setrlimit for stack size. Thus we create an additional path.

By default, Haiku has the desired 16 MB stack, therefore in general
we do not have to spawn a new thread. The code has been written in
such a way that any changes in Haiku or in Rust will be adapted to.

6 years agoAuto merge of #51899 - gnzlbg:llvm501, r=alexcrichton
bors [Mon, 9 Jul 2018 23:08:51 +0000 (23:08 +0000)]
Auto merge of #51899 - gnzlbg:llvm501, r=alexcrichton

bump minimum LLVM version to 5.0

Closes #51878 .

r? @alexcrichton

--

cc @cuviper @infinity0

6 years agoAuto merge of #50250 - csmoe:wf_traitref, r=scalexm
bors [Mon, 9 Jul 2018 21:01:58 +0000 (21:01 +0000)]
Auto merge of #50250 - csmoe:wf_traitref, r=scalexm

Chalk lowering rule: WellFormed-TraitRef

Address chalk lowering "Implemented-From-Env" as part of #49177.
r? @nikomatsakis

6 years agoChange gcc warning file name, remove unnecessary reference
ljedrz [Mon, 9 Jul 2018 19:25:16 +0000 (21:25 +0200)]
Change gcc warning file name, remove unnecessary reference

6 years agoChange wording
scalexm [Mon, 9 Jul 2018 19:20:26 +0000 (21:20 +0200)]
Change wording

6 years agoAuto merge of #51956 - GuillaumeGomez:shutdown-doc-lints, r=oli-obk
bors [Mon, 9 Jul 2018 18:50:37 +0000 (18:50 +0000)]
Auto merge of #51956 - GuillaumeGomez:shutdown-doc-lints, r=oli-obk

Fix rustdoc run failures by shutting down definitely some lints

Fixes #51661.

cc @oli-obk @arielb1 @eddyb

6 years agoadd comment about lints whitelisting
Guillaume Gomez [Mon, 9 Jul 2018 16:10:08 +0000 (18:10 +0200)]
add comment about lints whitelisting

6 years agorevert travis-ci changes
gnzlbg [Mon, 9 Jul 2018 15:25:00 +0000 (17:25 +0200)]
revert travis-ci changes

6 years agoAuto merge of #52159 - SimonSapin:alloc-prelude, r=alexcrichton
bors [Mon, 9 Jul 2018 14:29:59 +0000 (14:29 +0000)]
Auto merge of #52159 - SimonSapin:alloc-prelude, r=alexcrichton

Add the `alloc::prelude` module

It contains the re-exports that are in `std::prelude::v1` but not in `core::prelude::v1`.

Calling it prelude is somewhat of a misnomer since (unlike those modules in `std` or `core`) its contents are never implicitly imported in modules. Rather it is intended to be used with an explicit glob import like `use alloc::prelude::*;`. However there is precedent for the same misnomer with `std::io::prelude`, for example.

This new module is unstable with the same feature name as the `alloc` care. They are proposed for stabilization together in RFC https://github.com/rust-lang/rfcs/pull/2480.

6 years agoWarn windows-gnu users that the bundled gcc can't compile
ljedrz [Mon, 9 Jul 2018 13:28:12 +0000 (15:28 +0200)]
Warn windows-gnu users that the bundled gcc can't compile

6 years agorun asmjs and emscripten builds on CI (temporary)
gnzlbg [Mon, 9 Jul 2018 09:29:32 +0000 (11:29 +0200)]
run asmjs and emscripten builds on CI (temporary)

6 years agostill support LLVM4 for emscripten
gnzlbg [Mon, 9 Jul 2018 09:29:13 +0000 (11:29 +0200)]
still support LLVM4 for emscripten

6 years agobump llvm version of failing codegen test
gnzlbg [Mon, 2 Jul 2018 09:13:34 +0000 (11:13 +0200)]
bump llvm version of failing codegen test

6 years agobump minimum LLVM version to 5.0
gnzlbg [Fri, 29 Jun 2018 08:28:51 +0000 (10:28 +0200)]
bump minimum LLVM version to 5.0

6 years agoAuto merge of #52160 - euclio:include-macros, r=oli-obk
bors [Mon, 9 Jul 2018 08:41:43 +0000 (08:41 +0000)]
Auto merge of #52160 - euclio:include-macros, r=oli-obk

add regression test for #48835

Fixes #48835.

The underlying issue was fixed in #51978.

6 years agoAuto merge of #52066 - benjaminp:obligation-select, r=Mark-Simulacrum
bors [Mon, 9 Jul 2018 06:38:47 +0000 (06:38 +0000)]
Auto merge of #52066 - benjaminp:obligation-select, r=Mark-Simulacrum

Remove obsolete documentation from FufillmentContext::select comment.

The `only_new_obligations` parameter has not existed since 43756934d255603a0fb7a871f2a145380e488b71.

6 years agoAuto merge of #52166 - orlp:master, r=joshtriplett
bors [Mon, 9 Jul 2018 04:42:27 +0000 (04:42 +0000)]
Auto merge of #52166 - orlp:master, r=joshtriplett

Performance improvement of Vec's swap_remove.

The old implementation *literally* swapped and then removed, which resulted in unnecessary move instructions. The new implementation does use unsafe code, but is easy to see that it is correct.

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

6 years agoRemoved a single trailing space. Oops.
Orson Peters [Mon, 9 Jul 2018 04:31:24 +0000 (06:31 +0200)]
Removed a single trailing space. Oops.

6 years agoReimplemented Vec's swap_remove to not rely on pop.
Orson Peters [Mon, 9 Jul 2018 04:13:58 +0000 (06:13 +0200)]
Reimplemented Vec's swap_remove to not rely on pop.

6 years agoPerformance improvement of Vec's swap_remove.
Orson Peters [Mon, 9 Jul 2018 03:01:39 +0000 (05:01 +0200)]
Performance improvement of Vec's swap_remove.

6 years agoadd regression test for #48835
Andy Russell [Sun, 8 Jul 2018 18:52:23 +0000 (14:52 -0400)]
add regression test for #48835

Fixes #48835.

The underlying issue was fixed in #51978.

6 years agoAuto merge of #52152 - fabric-and-ink:edit-file-open-example, r=frewsxcv
bors [Sun, 8 Jul 2018 16:08:54 +0000 (16:08 +0000)]
Auto merge of #52152 - fabric-and-ink:edit-file-open-example, r=frewsxcv

Edit code example for File::open

It looked kinda strange and is now aligned with the other examples for `File`.

6 years agoAuto merge of #52106 - PramodBisht:issue/52049, r=oli-obk
bors [Sun, 8 Jul 2018 14:08:36 +0000 (14:08 +0000)]
Auto merge of #52106 - PramodBisht:issue/52049, r=oli-obk

Don't suggest `let` bindings if they don't help with borrows

@oli-obk I have added a condition to address #52049, right now, this is on WIP because I think code change is also required on `error_reporting.rs`. Plus I need to check if any test cases fail.
I will ping you again if everything passes

r? @oli-obk

6 years agoEdit code example for File::open
Fabian Drinck [Sun, 8 Jul 2018 14:07:09 +0000 (16:07 +0200)]
Edit code example for File::open

6 years agoAuto merge of #51955 - zackmdavis:item_semi, r=oli-obk
bors [Sun, 8 Jul 2018 02:51:54 +0000 (02:51 +0000)]
Auto merge of #51955 - zackmdavis:item_semi, r=oli-obk

clarify why we're suggesting removing semicolon after braced items

Previously (issue #46186, pull-request #46258), a suggestion was added
to remove the semicolon after we fail to parse an item, but issue #51603
complains that it's still insufficiently obvious why. Let's add a note.

Resolves #51603.

6 years agoAuto merge of #51590 - bjorn3:codegen_llvm_extract, r=alexcrichton
bors [Sun, 8 Jul 2018 00:52:36 +0000 (00:52 +0000)]
Auto merge of #51590 - bjorn3:codegen_llvm_extract, r=alexcrichton

Mostly fix metadata_only backend and extract some code out of rustc_codegen_llvm

Removes dependency on the `ar` crate and removes the `llvm.enabled` config option in favour of setting `rust.codegen-backends` to `[]`.

6 years agoReformat std prelude source to show it is the sum of core and alloc preludes
Simon Sapin [Sat, 7 Jul 2018 21:16:27 +0000 (23:16 +0200)]
Reformat std prelude source to show it is the sum of core and alloc preludes

6 years agoAdd the `alloc::prelude` module
Simon Sapin [Fri, 6 Jul 2018 22:43:11 +0000 (00:43 +0200)]
Add the `alloc::prelude` module

It contains the re-exports that are in `std::prelude::v1`
but not in `core::prelude::v1`.

Calling it prelude is somewhat of a misnomer since (unlike those modules
in `std` or `core`) its contents are never implicitly imported in modules.
Rather it is intended to be used with an explicit glob import like
`use alloc::prelude::*;`.
However there is precedent for the same misnomer with `std::io::prelude`,
for example.

This new module is unstable with the same feature name as the `alloc` care.
They are proposed for stabilization together in RFC
https://github.com/rust-lang/rfcs/pull/2480

6 years agoAuto merge of #52132 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sat, 7 Jul 2018 16:21:28 +0000 (16:21 +0000)]
Auto merge of #52132 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 3 pull requests

Successful merges:

 - #52087 (Update musl to 1.1.19 and add patch to fix tls issue)
 - #52107 (removed redundant header file import in rustllvm.h)
 - #52131 (Ship clippy in manifests)

Failed merges:

r? @ghost

6 years agoRollup merge of #52131 - Mark-Simulacrum:ship-clippy, r=kennytm
Mark Rousskov [Sat, 7 Jul 2018 14:27:02 +0000 (08:27 -0600)]
Rollup merge of #52131 - Mark-Simulacrum:ship-clippy, r=kennytm

Ship clippy in manifests

cc @Manishearth
r? @kennytm

6 years agoRollup merge of #52107 - PramodBisht:feature/52105, r=rkruppe
Mark Rousskov [Sat, 7 Jul 2018 14:27:01 +0000 (08:27 -0600)]
Rollup merge of #52107 - PramodBisht:feature/52105, r=rkruppe

removed redundant header file import in rustllvm.h

fix #52105
removed redundant header file import in rustllvm.h
cc @wqweto

6 years agoRollup merge of #52087 - malbarbo:musl-1.1.19, r=alexcrichton
Mark Rousskov [Sat, 7 Jul 2018 14:27:00 +0000 (08:27 -0600)]
Rollup merge of #52087 - malbarbo:musl-1.1.19, r=alexcrichton

Update musl to 1.1.19 and add patch to fix tls issue

This fixes https://github.com/rust-lang/rust/issues/48967

6 years agoShip clippy in manifests
Mark Rousskov [Sat, 7 Jul 2018 14:17:24 +0000 (08:17 -0600)]
Ship clippy in manifests

6 years agoAuto merge of #52109 - michaelwoerister:ir-objs, r=alexcrichton
bors [Sat, 7 Jul 2018 14:09:49 +0000 (14:09 +0000)]
Auto merge of #52109 - michaelwoerister:ir-objs, r=alexcrichton

When doing linker-plugin based LTO, write LLVM bitcode obj-files instead of embedding the bitcode into the regular object file.

This PR makes the compiler emit LLVM bitcode object files instead of regular object files with the IR embed when compiling for linker-plugin-based LTO. The reasoning for switching the strategy is this:
- Embedding bitcode in a section of the object file actually makes us save bitcode twice in rlibs and Rust dylibs, once for linker-based LTO and once for rustc-based LTO. That's a waste of space.
- When compiling for plugin-based LTO, one usually has no use for the machine code also present in the object file. Generating it is a waste of time.
- When compiling for plugin-based LTO, `rustc` will skip running ThinLTO because the linker will do that anyway. This has the side effect of then generating poorly optimized machine code, which makes it even less useful (and may lead to users not knowing why their code is slow instead of getting an error).
- Not having machine code available makes it impossible for the linker to silently fall back to not inlining stuff across language boundaries.
- This is what Clang does and according to [the documentation](https://llvm.org/docs/BitCodeFormat.html#native-object-file-wrapper-format) is the better supported option.
- The current behavior (minus the runtime performance problems) is still available via `-Z embed-bitcode` (we might want to do this for `libstd` at some point).

r? @alexcrichton

6 years agoAdded UI testcases for #52049
Pramod Bisht [Sat, 7 Jul 2018 10:21:50 +0000 (15:51 +0530)]
Added UI testcases for #52049

6 years agoAuto merge of #51993 - TheDarkula:master, r=oli-obk
bors [Sat, 7 Jul 2018 09:09:43 +0000 (09:09 +0000)]
Auto merge of #51993 - TheDarkula:master, r=oli-obk

Omitted the walks in visit_expr() and visit_stmt()

@oli-obk

6 years agoUpdate Cargo.lock
bjorn3 [Sat, 7 Jul 2018 09:05:21 +0000 (11:05 +0200)]
Update Cargo.lock

6 years agoRevert changes to bootstrap, rustc_driver and fix {core,std}simd
bjorn3 [Sat, 30 Jun 2018 08:45:14 +0000 (10:45 +0200)]
Revert changes to bootstrap, rustc_driver and fix {core,std}simd

6 years agoHopefully fix it
bjorn3 [Sun, 24 Jun 2018 11:32:33 +0000 (13:32 +0200)]
Hopefully fix it

6 years agoOnly use coresimd when codegen_backend is LLVM
bjorn3 [Sat, 23 Jun 2018 15:23:04 +0000 (17:23 +0200)]
Only use coresimd when codegen_backend is LLVM

6 years agoMove llvm_target_features back to llvm_util
bjorn3 [Sat, 23 Jun 2018 15:22:35 +0000 (17:22 +0200)]
Move llvm_target_features back to llvm_util

6 years agoAdd missing ) to comment
bjorn3 [Sat, 23 Jun 2018 15:01:40 +0000 (17:01 +0200)]
Add missing ) to comment

6 years agoMove time_graph.rs to rustc/util
bjorn3 [Sat, 23 Jun 2018 11:52:52 +0000 (13:52 +0200)]
Move time_graph.rs to rustc/util

6 years agoUpdate Cargo.lock and move size_and_align_of_dst back
bjorn3 [Fri, 22 Jun 2018 17:28:06 +0000 (19:28 +0200)]
Update Cargo.lock and move size_and_align_of_dst back

6 years agoRemove unused rustc_driver dependency on ar
bjorn3 [Fri, 22 Jun 2018 12:35:53 +0000 (14:35 +0200)]
Remove unused rustc_driver dependency on ar

6 years agoChange comment on setting codegen-backend empty
bjorn3 [Fri, 22 Jun 2018 12:32:49 +0000 (14:32 +0200)]
Change comment on setting codegen-backend empty

6 years agoAdd comment about disabling LLVM by setting codegen-backends empty
bjorn3 [Thu, 21 Jun 2018 11:12:56 +0000 (13:12 +0200)]
Add comment about disabling LLVM by setting codegen-backends empty

6 years agoLeave fixme comment
bjorn3 [Wed, 20 Jun 2018 07:35:01 +0000 (09:35 +0200)]
Leave fixme comment

6 years agoFix test
bjorn3 [Tue, 19 Jun 2018 08:52:13 +0000 (10:52 +0200)]
Fix test

6 years agoFix metadata_only metadata encoding
bjorn3 [Mon, 18 Jun 2018 16:13:00 +0000 (18:13 +0200)]
Fix metadata_only metadata encoding

6 years agoSolve review comment
bjorn3 [Sat, 16 Jun 2018 16:46:54 +0000 (18:46 +0200)]
Solve review comment

6 years agoUndo unnecessary change
bjorn3 [Sat, 16 Jun 2018 14:46:03 +0000 (16:46 +0200)]
Undo unnecessary change

6 years agoFix some errors
bjorn3 [Sat, 16 Jun 2018 10:07:54 +0000 (12:07 +0200)]
Fix some errors

6 years agoMostly fix compiling without LLVM (with metadata_only backend)
bjorn3 [Sat, 16 Jun 2018 09:45:59 +0000 (11:45 +0200)]
Mostly fix compiling without LLVM (with metadata_only backend)

6 years agoMove some functions out of rustc_codegen_llvm and fix metadata_only backend
bjorn3 [Fri, 15 Jun 2018 17:02:41 +0000 (19:02 +0200)]
Move some functions out of rustc_codegen_llvm and fix metadata_only backend

6 years agoAuto merge of #52037 - lqd:skipping-regionless-types, r=nikomatsakis
bors [Sat, 7 Jul 2018 07:06:14 +0000 (07:06 +0000)]
Auto merge of #52037 - lqd:skipping-regionless-types, r=nikomatsakis

NLL Liveness: Skip regionless types when visiting free regions

The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions

Closes #52027

6 years agoremoved redundant header file import in rustllvm.h
Pramod Bisht [Fri, 6 Jul 2018 10:37:07 +0000 (16:07 +0530)]
removed redundant header file import in rustllvm.h

6 years agoAddresses #52049
Pramod Bisht [Thu, 5 Jul 2018 18:12:03 +0000 (23:42 +0530)]
Addresses #52049

6 years agoupdate tests
csmoe [Sat, 7 Jul 2018 03:57:04 +0000 (11:57 +0800)]
update tests

6 years agoAuto merge of #52123 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sat, 7 Jul 2018 03:55:28 +0000 (03:55 +0000)]
Auto merge of #52123 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 9 pull requests

Successful merges:

 - #51901 (Rc: remove unused allocation and fix segfault in Weak::new())
 - #52058 (Use of unimplemented!() causing ICE with NLL)
 - #52067 (Visit the mir basic blocks in reverse-postfix order)
 - #52083 (Dont run ast borrowck on mir mode)
 - #52099 (fix typo in stable `--edition` error message)
 - #52103 (Stabilize rc_downcast)
 - #52104 (Remove unnecessary feature gate.)
 - #52117 (Dedupe filetime)
 - #52120 (ARM: expose the "mclass" target feature)

Failed merges:

r? @ghost

6 years agoRollup merge of #52120 - japaric:mclass, r=alexcrichton
Mark Rousskov [Sat, 7 Jul 2018 03:29:20 +0000 (21:29 -0600)]
Rollup merge of #52120 - japaric:mclass, r=alexcrichton

ARM: expose the "mclass" target feature

This let us differentiate, in conditional compilation context, between ARM Cortex-M targets, like
the `thumbv*` targets, and other ARM targets, like the ARM Cortex-A Linux targets.

r? @alexcrichton
cc @gnzlbg
cc rust-lang-nursery/stdsimd#437

6 years agoRollup merge of #52117 - Eijebong:filetime, r=alexcrichton
Mark Rousskov [Sat, 7 Jul 2018 03:29:19 +0000 (21:29 -0600)]
Rollup merge of #52117 - Eijebong:filetime, r=alexcrichton

Dedupe filetime

6 years agoRollup merge of #52104 - tmccombs:repr_trans_stable, r=Mark-Simulacrum
Mark Rousskov [Sat, 7 Jul 2018 03:29:18 +0000 (21:29 -0600)]
Rollup merge of #52104 - tmccombs:repr_trans_stable, r=Mark-Simulacrum

Remove unnecessary feature gate.

To fix a warning.

6 years agoRollup merge of #52103 - tmccombs:rc_downcast, r=Mark-Simulacrum
Mark Rousskov [Sat, 7 Jul 2018 03:29:17 +0000 (21:29 -0600)]
Rollup merge of #52103 - tmccombs:rc_downcast, r=Mark-Simulacrum

Stabilize rc_downcast

Fixes #44608

6 years agoRollup merge of #52099 - zackmdavis:and_the_case_of_the_typ, r=oli-obk
Mark Rousskov [Sat, 7 Jul 2018 03:29:16 +0000 (21:29 -0600)]
Rollup merge of #52099 - zackmdavis:and_the_case_of_the_typ, r=oli-obk

fix typo in stable `--edition` error message

(diff is self-explanatory)

6 years agoRollup merge of #52083 - spastorino:dont-run-ast-borrowck-on-mir-mode, r=nikomatsakis
Mark Rousskov [Sat, 7 Jul 2018 03:29:14 +0000 (21:29 -0600)]
Rollup merge of #52083 - spastorino:dont-run-ast-borrowck-on-mir-mode, r=nikomatsakis

Dont run ast borrowck on mir mode

r? @nikomatsakis

6 years agoRollup merge of #52067 - csmoe:issue-51167, r=nikomatsakis
Mark Rousskov [Sat, 7 Jul 2018 03:29:13 +0000 (21:29 -0600)]
Rollup merge of #52067 - csmoe:issue-51167, r=nikomatsakis

Visit the mir basic blocks in reverse-postfix order

cc #51167
r? @nikomatsakis

6 years agoRollup merge of #52058 - davidtwco:issue-51345, r=nikomatsakis
Mark Rousskov [Sat, 7 Jul 2018 03:29:12 +0000 (21:29 -0600)]
Rollup merge of #52058 - davidtwco:issue-51345, r=nikomatsakis

Use of unimplemented!() causing ICE with NLL

Fixes #51345.

r? @nikomatsakis

6 years agoRollup merge of #51901 - rust-lang:weak-unboxing, r=alexcrichton
Mark Rousskov [Sat, 7 Jul 2018 03:29:11 +0000 (21:29 -0600)]
Rollup merge of #51901 - rust-lang:weak-unboxing, r=alexcrichton

Rc: remove unused allocation and fix segfault in Weak::new()

Same as https://github.com/rust-lang/rust/pull/50357 did for `Arc`.

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

6 years agoextend where clauses
csmoe [Sat, 7 Jul 2018 03:02:47 +0000 (11:02 +0800)]
extend where clauses

6 years agoAuto merge of #51656 - soc:topic/fix-home-dir, r=SimonSapin
bors [Sat, 7 Jul 2018 01:51:08 +0000 (01:51 +0000)]
Auto merge of #51656 - soc:topic/fix-home-dir, r=SimonSapin

Deprecate `std::env::home_dir` and fix incorrect documentation

Compare `std::env::home_dir`s claim:

> Returns the value of the 'HOME' environment variable if it is set and not equal to the empty string.

... with its actual behavior:

```
std::env::set_var("HOME", "");
println!("{:?}", std::env::var_os("HOME")); // Some("")
println!("{:?}", std::env::home_dir());     // Some("")
```

The implementation is incorrect in two cases:
- `$HOME` is set, but empty.
- An entry for the user exists in `/etc/passwd`, but it's `pw_dir` is empty.

In both cases Rust considers an empty string to be a valid home directory. This contradicts the documentation, and is wrong in general.

6 years agoGeneral fixes and cleanup.
Meade Kincke [Fri, 6 Jul 2018 22:23:12 +0000 (23:23 +0100)]
General fixes and cleanup.

6 years agoOmitted the walk in visit_expr()
Meade Kincke [Mon, 2 Jul 2018 17:09:47 +0000 (18:09 +0100)]
Omitted the walk in visit_expr()

6 years agoFix is_dangling import when Arc is #[cfg]’ed out
Simon Sapin [Fri, 6 Jul 2018 23:44:57 +0000 (01:44 +0200)]
Fix is_dangling import when Arc is #[cfg]’ed out

6 years agoAdd some unit tests for dangling Weak references
Simon Sapin [Fri, 6 Jul 2018 17:30:09 +0000 (19:30 +0200)]
Add some unit tests for dangling Weak references

6 years agoAdd a test for Weak::new() not crashing for uninhabited types
Simon Sapin [Wed, 27 Jun 2018 19:36:29 +0000 (21:36 +0200)]
Add a test for Weak::new() not crashing for uninhabited types

6 years agoRc: remove unused allocation from Weak::new()
Simon Sapin [Wed, 27 Jun 2018 16:09:21 +0000 (18:09 +0200)]
Rc: remove unused allocation from Weak::new()

Same as https://github.com/rust-lang/rust/pull/50357

6 years agoUse an aligned dangling pointer in Weak::new, rather than address 1
Simon Sapin [Fri, 29 Jun 2018 13:43:34 +0000 (15:43 +0200)]
Use an aligned dangling pointer in Weak::new, rather than address 1

6 years agoAuto merge of #52021 - nikomatsakis:nll-region-errors, r=estebank
bors [Fri, 6 Jul 2018 23:36:16 +0000 (23:36 +0000)]
Auto merge of #52021 - nikomatsakis:nll-region-errors, r=estebank

refactor and cleanup region errors for NLL

This is a WIP commit. It simplifies some of the code from https://github.com/rust-lang/rust/pull/51536 and extends a few more steps towards the errors that @davidtwco and I were shooting for. These are intended as a replacement for the general "unable to infer lifetime" messages -- one that is actually actionable. We're certainly not there yet, but the overall shape hopefully gets a bit clearer.

I'm thinking about trying to open up an internals thread to sketch out the overall plan and perhaps discuss how to get the wording right, which special cases to handle, etc.

r? @estebank
cc @davidtwco

6 years agoARM: expose the "mclass" target feature
Jorge Aparicio [Fri, 6 Jul 2018 22:12:03 +0000 (17:12 -0500)]
ARM: expose the "mclass" target feature

6 years agoDeprecate `std::env::home_dir` and fix incorrect documentation
Simon Ochsenreither [Thu, 5 Jul 2018 15:32:09 +0000 (17:32 +0200)]
Deprecate `std::env::home_dir` and fix incorrect documentation

6 years agoDedupe filetime
Bastien Orivel [Fri, 6 Jul 2018 20:52:40 +0000 (22:52 +0200)]
Dedupe filetime

6 years agoAuto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa
bors [Fri, 6 Jul 2018 20:05:23 +0000 (20:05 +0000)]
Auto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa

Haiku: several smaller fixes to build and run rust on Haiku

This PR combines three small patches that help Rust build and run on the Haiku platform. These patches do not intend to impact other platforms.

6 years agoAuto merge of #52018 - flip1995:rfc2103, r=oli-obk
bors [Fri, 6 Jul 2018 18:03:46 +0000 (18:03 +0000)]
Auto merge of #52018 - flip1995:rfc2103, r=oli-obk

Implementation of tool lints.

Tracking issue: #44690

6 years agoAuto merge of #52010 - toidiu:ak-crossCrateOutlives, r=nikomatsakis
bors [Fri, 6 Jul 2018 16:01:25 +0000 (16:01 +0000)]
Auto merge of #52010 - toidiu:ak-crossCrateOutlives, r=nikomatsakis

Fix: infer outlives requirements across crates

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

6 years agoAuto merge of #51894 - mikhail-m1:8636, r=nikomatsakis
bors [Fri, 6 Jul 2018 12:54:45 +0000 (12:54 +0000)]
Auto merge of #51894 - mikhail-m1:8636, r=nikomatsakis

fix for issue #8636

r? @nikomatsakis

Fix #8636

also fixes #42291

6 years agoRemove CrossLangLto::NoLink which does not have a use case anymore.
Michael Woerister [Fri, 6 Jul 2018 12:08:40 +0000 (14:08 +0200)]
Remove CrossLangLto::NoLink which does not have a use case anymore.

6 years agoWhen doing linker-plugin based LTO, write LLVM bitcode obj-files
Michael Woerister [Fri, 6 Jul 2018 11:58:25 +0000 (13:58 +0200)]
When doing linker-plugin based LTO, write LLVM bitcode obj-files
instead of embedding the bitcode into the regular object file.

6 years agoAuto merge of #51677 - nrc:update, r=kennytm
bors [Fri, 6 Jul 2018 10:55:02 +0000 (10:55 +0000)]
Auto merge of #51677 - nrc:update, r=kennytm

Update RLS and Rustfmt

r? @Mark-Simulacrum

6 years agorefactor
csmoe [Fri, 6 Jul 2018 10:44:42 +0000 (18:44 +0800)]
refactor

6 years agotweak comment
Niko Matsakis [Fri, 6 Jul 2018 10:33:38 +0000 (06:33 -0400)]
tweak comment

6 years agoAuto merge of #51953 - japaric:atomic-load-store, r=alexcrichton
bors [Fri, 6 Jul 2018 08:59:22 +0000 (08:59 +0000)]
Auto merge of #51953 - japaric:atomic-load-store, r=alexcrichton

enable Atomic*.{load,store} for ARMv6-M / MSP430

closes #45085

as proposed in https://github.com/rust-lang/rust/issues/45085#issuecomment-384825434

this commit adds an `atomic_cas` target option and extends the `#[cfg(target_has_atomic)]`
attribute to enable a subset of the `Atomic*` API on architectures that don't support atomic CAS
natively, like MSP430 and ARMv6-M.

r? @alexcrichton

6 years agoUpdate RLS, Rustfmt, Cargo, and Clippy
Nick Cameron [Fri, 6 Jul 2018 00:34:00 +0000 (12:34 +1200)]
Update RLS, Rustfmt, Cargo, and Clippy

6 years agoRemove unnecessary feature gate.
Thayne McCombs [Fri, 6 Jul 2018 07:06:17 +0000 (01:06 -0600)]
Remove unnecessary feature gate.

To fix a warning.

6 years agoStabilize rc_downcast
Thayne McCombs [Fri, 6 Jul 2018 07:00:40 +0000 (01:00 -0600)]
Stabilize rc_downcast

Fixes #44608

6 years agoAuto merge of #52088 - kennytm:rollup, r=kennytm
bors [Fri, 6 Jul 2018 06:48:12 +0000 (06:48 +0000)]
Auto merge of #52088 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #51619 (rust: add initial changes to support powerpc64le musl)
 - #51793 (Fix variant background color on hover in search results)
 - #52005 (Update LLVM to bring in a wasm codegen fix)
 - #52016 (Deduplicate error reports for statics)
 - #52019 ([cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD))
 - #52030 (Any docs preposition change)
 - #52031 (Strenghten synchronization in `Arc::is_unique`)
 - #52033 ([Gardening] Update outdated comments: ByVal -> Scalar)
 - #52055 (Include VS 2017 in error message.)
 - #52063 (Add a link to the rustc docs)
 - #52073 (Add a punch card to weird expressions test)
 - #52080 (Improve dependency deduplication diagnostics)
 - #52093 (rustc: Update tracking issue for wasm_import_module)
 - #52096 (Fix typo in cell.rs)

Failed merges:

6 years agoHaiku: work around the lack of setrlimit
Niels Sascha Reedijk [Thu, 5 Jul 2018 05:12:24 +0000 (07:12 +0200)]
Haiku: work around the lack of setrlimit

By default, Haiku has the desired 16 MB stack, therefore in general
we do not have to spawn a new thread. The code has been written in
such a way that any changes in Haiku or in Rust will be adapted to.