]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #48133 - matthiaskrgr:endianess_to_endianness, r=oli-obk
kennytm [Wed, 14 Feb 2018 08:14:39 +0000 (16:14 +0800)]
Rollup merge of #48133 - matthiaskrgr:endianess_to_endianness, r=oli-obk

typo: correct endianess to endianness (this also changes function names!)

6 years agoRollup merge of #48130 - ollie27:stab, r=Mark-Simulacrum
kennytm [Wed, 14 Feb 2018 08:14:38 +0000 (16:14 +0800)]
Rollup merge of #48130 - ollie27:stab, r=Mark-Simulacrum

Correct a few stability attributes

* `core_float_bits`, `duration_core`, `path_component_asref`, and `repr_align` were stabalized in 1.25.0 not 1.24.0.
* Impls for `NonNull` involving unstable things should remain unstable.
* `Duration` should remain stable since 1.3.0 so it appears correctly in the `std` docs.
* `cursor_mut_vec` is an impl on only stable things so should be marked stable.

6 years agoRollup merge of #48126 - newpavlov:patch-1, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:37 +0000 (16:14 +0800)]
Rollup merge of #48126 - newpavlov:patch-1, r=alexcrichton

Whitelist pclmulqdq x86 feature flag

Relevant `stdsimd` [issue](https://github.com/rust-lang-nursery/stdsimd/issues/318).

6 years agoRollup merge of #48114 - kennytm:xcode9, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:36 +0000 (16:14 +0800)]
Rollup merge of #48114 - kennytm:xcode9, r=alexcrichton

Upgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.

Retry of #47749, since LLVM 6 has been merged.

6 years agoRollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:33 +0000 (16:14 +0800)]
Rollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichton

Add Range[Inclusive]::is_empty

During https://github.com/rust-lang/rfcs/pull/1980, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it.  It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- such as `Range<i64>` and `RangeInclusive<usize>`.

Things to ponder:
- Unless this is stabilized first, this makes stabilizing ExactSizeIterator::is_empty more icky, since this hides that.
- This is only on `Range` and `RangeInclusive`, as those are the only ones where it's interesting.  But one could argue that it should be on more for consistency, or on RangeArgument instead.
- The bound on this is PartialOrd, since that works ok (see tests for float examples) and is consistent with `contains`.  But ranges like `NAN..=NAN`_are_ kinda weird.
- [x] ~~There's not a real issue number on this yet~~

6 years agoRollup merge of #48065 - Xaeroxe:patch-1, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:32 +0000 (16:14 +0800)]
Rollup merge of #48065 - Xaeroxe:patch-1, r=alexcrichton

Apply optimization from #44355 to retain

As discussed in #44355 this PR applies a similar optimization to `Vec::retain`.  For `drain_filter`, a very similar function, this improved performance by up to 20%.

6 years agoRollup merge of #48033 - GuillaumeGomez:better-char-cast-message, r=estebank
kennytm [Wed, 14 Feb 2018 08:14:31 +0000 (16:14 +0800)]
Rollup merge of #48033 - GuillaumeGomez:better-char-cast-message, r=estebank

Show better warning for trying to cast non-u8 scalar to char

Fixes #44201.

6 years agoRollup merge of #48005 - panicbit:env_unimpl_send_sync, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:30 +0000 (16:14 +0800)]
Rollup merge of #48005 - panicbit:env_unimpl_send_sync, r=alexcrichton

Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs}

Fixes #48004

6 years agoRollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytm
kennytm [Wed, 14 Feb 2018 08:14:29 +0000 (16:14 +0800)]
Rollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytm

Work around LLVM OCAML binding installation failure

Hello,

I have OCaml installed on my machine, and compiling rust systematically fails when LLVM attempts installing the OCaml bindings in `/usr/lib/ocaml`, which is write-protected. Here are the logs: https://gist.github.com/roblabla/3f147914c5df627c9d97ab311ba133ad

Some digging around the issue reveals:

- The code that finds if OCaml is installed, and sets the bindings to be compiled/installed: https://github.com/llvm-mirror/llvm/blob/b24a45d2e9f4fc10c3f9e16172104910b38637f2/cmake/config-ix.cmake#L612
- https://github.com/llvm-mirror/llvm/blob/b24a45d2e9f4fc10c3f9e16172104910b38637f2/bindings/ocaml/llvm/CMakeLists.txt Some code that does the installation.

The problem seems to be that `LLVM_OCAML_INSTALL_PATH` is set to `OCAML_STDLIB_PATH` by default, which is in `/usr/lib/ocaml`, instead of the prefix.

This PR "fixes" the issue by setting `LLVM_OCAML_INSTALL_PATH` to `usr/lib/ocaml`. I haven't found a way to make LLVM not build OCaml, which would probably be a superior fix.

6 years agoRollup merge of #47806 - PramodBisht:feature/47801, r=steveklabnik
kennytm [Wed, 14 Feb 2018 08:14:28 +0000 (16:14 +0800)]
Rollup merge of #47806 - PramodBisht:feature/47801, r=steveklabnik

Changed color of struct link from #ff794d to #2dbfb8 for Rust docs

This is in reference to https://github.com/rust-lang/rust/issues/47801

here I have changed the default color of struct link for `#ff794d` to `#2dbfb8`

cc: @nagisa  @timClicks

6 years agoRollup merge of #47784 - alexcrichton:less-dsymutil, r=michaelwoerister
kennytm [Wed, 14 Feb 2018 08:14:27 +0000 (16:14 +0800)]
Rollup merge of #47784 - alexcrichton:less-dsymutil, r=michaelwoerister

rustc: Add the ability to not run dsymutil

This commit adds the ability for rustc to not run `dsymutil` by default
on OSX. A new codegen option, `-Z run-dsymutil=no`, was added to specify
that `dsymutil` should *not* run and instead the compiler should
unconditionally keep the object files around in a compilation if
necessary for debug information.

cc #47240

6 years agoSwitch to retain calling drain_filter.
Jacob Kiesel [Tue, 13 Feb 2018 15:48:25 +0000 (08:48 -0700)]
Switch to retain calling drain_filter.

6 years agoAuto merge of #47804 - retep007:recursive-requirements, r=pnkfelix
bors [Tue, 13 Feb 2018 00:14:11 +0000 (00:14 +0000)]
Auto merge of #47804 - retep007:recursive-requirements, r=pnkfelix

Optimized error reporting for recursive requirements #47720

Fixes #47720

6 years agorustc: Add the ability to not run dsymutil
Alex Crichton [Fri, 26 Jan 2018 05:21:02 +0000 (21:21 -0800)]
rustc: Add the ability to not run dsymutil

This commit adds the ability for rustc to not run `dsymutil` by default
on OSX. A new codegen option, `-Z run-dsymutil=no`, was added to specify
that `dsymutil` should *not* run and instead the compiler should
unconditionally keep the object files around in a compilation if
necessary for debug information.

cc #47240

6 years agoAuto merge of #47843 - estebank:teach, r=nikomatsakis
bors [Mon, 12 Feb 2018 09:38:40 +0000 (09:38 +0000)]
Auto merge of #47843 - estebank:teach, r=nikomatsakis

Add `-Zteach` documentation

Add extra inline documentation to E0019, E0016, E0013, E0396, E0017,
E0018, E0010, E0022, E0030, E0029, E0033, E0026 and E0027.

Follow up to #47652.

6 years agoAuto merge of #48144 - kennytm:reduce-musl-test-size, r=Mark-Simulacrum
bors [Mon, 12 Feb 2018 06:43:24 +0000 (06:43 +0000)]
Auto merge of #48144 - kennytm:reduce-musl-test-size, r=Mark-Simulacrum

Compiletest: delete the compiled program once its test is done.

Reduces CI disk usage which prevents #48118 from succeeding.

6 years agoDelete executables if the test ran successfully.
Mark Simulacrum [Sun, 11 Feb 2018 23:27:33 +0000 (16:27 -0700)]
Delete executables if the test ran successfully.

This isn't a perfect heuristic, but since the amount of run-fail tests
is far lower than run-pass tests for now, it should be sufficient to
ensure that we don't run into CI limits. This makes it possible to run
the test binary manually (e.g., under gdb/lldb) if it failed to attempt
to find out why.

6 years agocompiletest: Delete the executable immediately after running.
kennytm [Sun, 11 Feb 2018 19:04:43 +0000 (03:04 +0800)]
compiletest: Delete the executable immediately after running.

This should save a lot of space on musl test cases (whose standard library
are linked statically).

6 years agoAuto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis
bors [Sun, 11 Feb 2018 18:11:01 +0000 (18:11 +0000)]
Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis

Implement `?` macro repetition

See rust-lang/rfcs#2298 (with disposition merge)

6 years agoAuto merge of #47614 - dotdash:x86_64_sysv_ffi, r=eddyb
bors [Sun, 11 Feb 2018 15:10:46 +0000 (15:10 +0000)]
Auto merge of #47614 - dotdash:x86_64_sysv_ffi, r=eddyb

Fix oversized loads on x86_64 SysV FFI calls

The x86_64 SysV ABI should use exact sizes for small structs passed in
registers, i.e. a struct that occupies 3 bytes should use an i24,
instead of the i32 it currently uses.

Refs #45543

6 years agoDangling pointer fix
Artyom Pavlov [Sun, 11 Feb 2018 12:57:07 +0000 (15:57 +0300)]
Dangling pointer fix

6 years agoUpgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.
kennytm [Thu, 25 Jan 2018 19:14:20 +0000 (03:14 +0800)]
Upgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.

6 years agoAuto merge of #47657 - algesten:save-analysis-impls, r=nrc
bors [Sun, 11 Feb 2018 05:29:20 +0000 (05:29 +0000)]
Auto merge of #47657 - algesten:save-analysis-impls, r=nrc

Emit data::Impl in save-analysis

As discussed on [internals.rust-lang](https://internals.rust-lang.org/t/rustdoc2-rls-analysis-and-the-compiler-help-wanted/6592/5), this PR emits `rls-data::Impl` in the save-analysis.

A number of questions are outstanding:

- [x] A few `???` around row 356. We need to discuss what goes here, if anything.
- [ ] ~~Deriving `id` for impl using hashing. Is this going to clash with rustc defids?~~
- [ ] ~~Deriving `id` for impl using hashing. Is the conversion from 64 bit -> 32 bit problematic?~~
- [x] Need a new rls-data with an `id` field in `Impl` struct.
- [ ] ~~Need a new rls-data which `derive` `Hash` for `ImplKind` enum.~~

6 years agoAuto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakis
bors [Sun, 11 Feb 2018 02:42:19 +0000 (02:42 +0000)]
Auto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakis

 rustc_mir: insert a dummy access to places being matched on, when building MIR.

Fixes #47412 by adding a `_dummy = Discriminant(place)` before each `match place {...}`.

r? @nikomatsakis

6 years agoAdd the emptiness condition to the docs; add a PartialOrd example with NAN
Scott McMurray [Sun, 11 Feb 2018 00:32:05 +0000 (16:32 -0800)]
Add the emptiness condition to the docs; add a PartialOrd example with NAN

6 years agofixed errors
Артём Павлов [Artyom Pavlov] [Sun, 11 Feb 2018 00:27:04 +0000 (03:27 +0300)]
fixed errors

6 years agotypo: correct endianess to endianness (this also changes function names!)
Matthias Krüger [Sat, 10 Feb 2018 23:56:24 +0000 (00:56 +0100)]
typo: correct endianess to endianness (this also changes function names!)

6 years agoAuto merge of #47286 - Aaronepower:master, r=Mark-Simulacrum
bors [Sat, 10 Feb 2018 23:50:18 +0000 (23:50 +0000)]
Auto merge of #47286 - Aaronepower:master, r=Mark-Simulacrum

Update RELEASES.md for 1.24.0

[rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

6 years agoiterator instead loop
Артём Павлов [Artyom Pavlov] [Sat, 10 Feb 2018 23:36:22 +0000 (02:36 +0300)]
iterator instead loop

6 years agoadded conversion from Rust feature to LLVM feature
Артём Павлов [Artyom Pavlov] [Sat, 10 Feb 2018 23:27:21 +0000 (02:27 +0300)]
added conversion from Rust feature to LLVM feature

6 years agoUpdate release notes for 1.24.0
Aaron Power [Tue, 9 Jan 2018 01:38:58 +0000 (01:38 +0000)]
Update release notes for 1.24.0

6 years agoCorrect a few stability attributes
Oliver Middleton [Sat, 10 Feb 2018 21:20:42 +0000 (21:20 +0000)]
Correct a few stability attributes

6 years agoAdd comment about the problem, and use provided path if available
roblabla [Sat, 10 Feb 2018 20:29:10 +0000 (21:29 +0100)]
Add comment about the problem, and use provided path if available

6 years agoAuto merge of #48113 - kennytm:rollup, r=kennytm
bors [Sat, 10 Feb 2018 19:48:20 +0000 (19:48 +0000)]
Auto merge of #48113 - kennytm:rollup, r=kennytm

Rollup of 20 pull requests

- Successful merges: #47790, #47835, #47854, #48015, #48047, #48051, #48058, #48059, #48064, #48078, #48080, #48086, #48098, #48101, #48107, #48100, #48085, #48120, #48124, #47547
- Failed merges:

6 years agoRollup merge of #47547 - varkor:infinite-iterators-warning-doc, r=frewsxcv
kennytm [Sat, 10 Feb 2018 19:39:53 +0000 (03:39 +0800)]
Rollup merge of #47547 - varkor:infinite-iterators-warning-doc, r=frewsxcv

Document the behaviour of infinite iterators on potentially-computable methods

It’s not entirely clear from the current documentation what behaviour
calling a method such as `min` on an infinite iterator like `RangeFrom`
is. One might expect this to terminate, but in fact, for infinite
iterators, `min` is always nonterminating (at least in the standard
library). This adds a quick note about this behaviour for clarification.

6 years agotypo fix
Artyom Pavlov [Sat, 10 Feb 2018 17:07:37 +0000 (20:07 +0300)]
typo fix

6 years agoRollup merge of #48124 - alexcrichton:clean-up-debugging, r=kennytm
kennytm [Sat, 10 Feb 2018 16:53:47 +0000 (00:53 +0800)]
Rollup merge of #48124 - alexcrichton:clean-up-debugging, r=kennytm

Explain unusual debugging code in librustc

Introduced in #47828 to help track down some bugs, it landed a bit hastily so
this is intended on cleaning it up a bit.

6 years agoRollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichton
kennytm [Sat, 10 Feb 2018 16:53:05 +0000 (00:53 +0800)]
Rollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichton

fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}

via codespell

6 years agoRollup merge of #48085 - alexcrichton:update-dlmalloc, r=Mark-Simulacrum
kennytm [Sat, 10 Feb 2018 16:51:56 +0000 (00:51 +0800)]
Rollup merge of #48085 - alexcrichton:update-dlmalloc, r=Mark-Simulacrum

Update the dlmalloc submodule

A bug was recently fixed in dlmalloc which meant that released memory to the
system accidentally wasn't getting reused, causing programs to be far slower
than they should be!

6 years agoWhitelist pclmul x86 feature flag
Artyom Pavlov [Sat, 10 Feb 2018 16:22:04 +0000 (19:22 +0300)]
Whitelist pclmul x86 feature flag

Relevant `stdsimd` [issue](https://github.com/rust-lang-nursery/stdsimd/issues/318).

6 years agoExplain unusual debugging code in librustc
Alex Crichton [Sat, 10 Feb 2018 15:03:35 +0000 (07:03 -0800)]
Explain unusual debugging code in librustc

Introduced in #47828 to help track down some bugs, it landed a bit hastily so
this is intended on cleaning it up a bit.

6 years agoUpdate the dlmalloc submodule
Alex Crichton [Fri, 9 Feb 2018 04:45:45 +0000 (20:45 -0800)]
Update the dlmalloc submodule

A bug was recently fixed in dlmalloc which meant that released memory to the
system accidentally wasn't getting reused, causing programs to be far slower
than they should be!

6 years agoShow better warning for trying to cast non-u8 scalar to char
Guillaume Gomez [Tue, 6 Feb 2018 13:57:08 +0000 (14:57 +0100)]
Show better warning for trying to cast non-u8 scalar to char

6 years agofix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}
Matthias Krüger [Sat, 10 Feb 2018 11:22:57 +0000 (12:22 +0100)]
fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}

6 years agoRollup merge of #48100 - Mark-Simulacrum:fetch-nand, r=alexcrichton
kennytm [Sat, 10 Feb 2018 06:26:57 +0000 (14:26 +0800)]
Rollup merge of #48100 - Mark-Simulacrum:fetch-nand, r=alexcrichton

Add fetch_nand to atomics

I think this is all fine but I have little familiarity with the atomic code (or libcore in general) so I may have accidentally done something wrong here...

cc #13226 (the tracking issue)

6 years agoRollup merge of #48107 - matthiaskrgr:typo__substract_to_subtract, r=kennytm
kennytm [Sat, 10 Feb 2018 06:24:10 +0000 (14:24 +0800)]
Rollup merge of #48107 - matthiaskrgr:typo__substract_to_subtract, r=kennytm

fix typo: substract -> subtract

6 years agoRollup merge of #48101 - Mark-Simulacrum:new-books, r=steveklabnik
kennytm [Sat, 10 Feb 2018 06:24:08 +0000 (14:24 +0800)]
Rollup merge of #48101 - Mark-Simulacrum:new-books, r=steveklabnik

Update books for next release

r? @steveklabnik

6 years agoRollup merge of #48098 - alexcrichton:fix-i686-dist-bootstrap, r=Mark-Simulacrum
kennytm [Sat, 10 Feb 2018 06:24:07 +0000 (14:24 +0800)]
Rollup merge of #48098 - alexcrichton:fix-i686-dist-bootstrap, r=Mark-Simulacrum

ci: Actually bootstrap on i686 dist

Right now the `--build` option was accidentally omitted, so we're bootstraping
from `x86_64` to `i686`. In addition to being slower (more compiles) that's not
actually bootstrapping!

6 years agoRollup merge of #48086 - Zoxc:gen-fix, r=nikomatsakis
kennytm [Sat, 10 Feb 2018 06:24:06 +0000 (14:24 +0800)]
Rollup merge of #48086 - Zoxc:gen-fix, r=nikomatsakis

Fix visitation order of calls so that it matches execution order. Fixes #48048

r? @nikomatsakis

6 years agoRollup merge of #48080 - GuillaumeGomez:mobile-docs-fixes, r=QuietMisdreavus
kennytm [Sat, 10 Feb 2018 06:24:05 +0000 (14:24 +0800)]
Rollup merge of #48080 - GuillaumeGomez:mobile-docs-fixes, r=QuietMisdreavus

Hide theme button under menu in mobile mode and fix top margin issue …

Fixes #48060.

r? @QuietMisdreavus

6 years agoRollup merge of #48078 - alexcrichton:fix-required-const-and-proc-macro, r=eddyb
kennytm [Sat, 10 Feb 2018 06:24:04 +0000 (14:24 +0800)]
Rollup merge of #48078 - alexcrichton:fix-required-const-and-proc-macro, r=eddyb

Disallow function pointers to #[rustc_args_required_const]

This commit disallows acquiring a function pointer to functions tagged as
`#[rustc_args_required_const]`. This is intended to be used as future-proofing
for the stdsimd crate to avoid taking a function pointer to any intrinsic which
has a hard requirement that one of the arguments is a constant value.

Note that the first commit here isn't related specifically to this feature, but was necessary to get this working in stdsimd!

6 years agoRollup merge of #48064 - Manishearth:intra-doc-bail, r=QuietMisdreavus
kennytm [Sat, 10 Feb 2018 06:24:03 +0000 (14:24 +0800)]
Rollup merge of #48064 - Manishearth:intra-doc-bail, r=QuietMisdreavus

intra-doc-links: bail early for linky things

r? @QuietMisdreavus

6 years agoRollup merge of #48059 - alexcrichton:sccachebs, r=Mark-Simulacrum
kennytm [Sat, 10 Feb 2018 06:24:02 +0000 (14:24 +0800)]
Rollup merge of #48059 - alexcrichton:sccachebs, r=Mark-Simulacrum

rustbuild: Pass `ccache` to build scripts

Right now the ccache setting is only used for LLVM, but this tweaks it to also
be used for build scripts so C++ builds like `librustc_llvm` can be a bit
speedier.

6 years agoRollup merge of #48058 - cuviper:binaryen-gcc8, r=alexcrichton
kennytm [Sat, 10 Feb 2018 06:24:00 +0000 (14:24 +0800)]
Rollup merge of #48058 - cuviper:binaryen-gcc8, r=alexcrichton

Update binaryen to fix -Werror with GCC 8

r? @alexcrichton

6 years agoRollup merge of #48051 - ollie27:rustdoc_fn_unit_return, r=QuietMisdreavus
kennytm [Sat, 10 Feb 2018 06:23:59 +0000 (14:23 +0800)]
Rollup merge of #48051 - ollie27:rustdoc_fn_unit_return, r=QuietMisdreavus

rustdoc: Hide `-> ()` in cross crate inlined Fn* bounds

6 years agoRollup merge of #48047 - etaoins:fix-ice-for-mismatched-args-on-target-without-span...
kennytm [Sat, 10 Feb 2018 06:23:58 +0000 (14:23 +0800)]
Rollup merge of #48047 - etaoins:fix-ice-for-mismatched-args-on-target-without-span, r=estebank

Fix ICE for mismatched args on target without span

Commit 7ed00caacc improved our error reporting by including the target function in our error messages when there is an argument count mismatch. A simple example from the UI tests is:

```
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
  --> $DIR/closure-arg-count.rs:32:53
   |
32 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
   |                                                     ^^^ expected function that takes a single 2-tuple as argument
...
44 | fn foo() {}
   | -------- takes 0 arguments
```

However, this assumed the target span was always available. This does not hold true if the target function is in `std` or another crate. A simple example from #48046 is assigning `str::split` to a function type with a different number of arguments.

Fix by omitting all of the labels and suggestions related to the target span when it's not found.

Fixes #48046

r? @estebank

6 years agoRollup merge of #48015 - o01eg:disableable-installation, r=alexcrichton
kennytm [Sat, 10 Feb 2018 06:23:57 +0000 (14:23 +0800)]
Rollup merge of #48015 - o01eg:disableable-installation, r=alexcrichton

Customizable extended tools

This PR adds `build.tools` option to manage installation of extended rust tools.

By default it doesn't change installation. All tools are built and `rls` and `rustfmt` allowed to fail installation.

If some set of tools chosen only those tools are built and installed without any fails allowed.

It solves some slotting issues with extended build enabled: https://bugs.gentoo.org/show_bug.cgi?id=645498

6 years agoRollup merge of #47854 - varkor:create-out-dir, r=pnkfelix
kennytm [Sat, 10 Feb 2018 06:23:56 +0000 (14:23 +0800)]
Rollup merge of #47854 - varkor:create-out-dir, r=pnkfelix

Create a directory for --out-dir if it does not already exist

Currently if `--out-dir` is set to a non-existent directory, the compiler will throw unfriendly messages like `error: could not write output to subdir/example.crate.allocator.rcgu.o: No such file or
directory`, which, while not completely unreadable, isn’t very user-friendly either. This change creates the directory automatically if it does not yet exist.

6 years agoRollup merge of #47835 - Mark-Simulacrum:remove-data-structs, r=nikomatsakis
kennytm [Sat, 10 Feb 2018 06:23:54 +0000 (14:23 +0800)]
Rollup merge of #47835 - Mark-Simulacrum:remove-data-structs, r=nikomatsakis

Remove unused data structures

Cleanup; as far as I can tell the compiler no longer uses these.

6 years agoRollup merge of #47790 - tinaun:patch-1, r=sfackler
kennytm [Sat, 10 Feb 2018 06:23:53 +0000 (14:23 +0800)]
Rollup merge of #47790 - tinaun:patch-1, r=sfackler

derive PartialEq and Eq for `ParseCharError`

unlike the other Parse*Error types, ParseCharError didn't have these implemented for whatever reason

6 years agoAuto merge of #47828 - alexcrichton:llvm-6, r=nikomatsakis
bors [Sat, 10 Feb 2018 02:52:12 +0000 (02:52 +0000)]
Auto merge of #47828 - alexcrichton:llvm-6, r=nikomatsakis

rustc: Upgrade to LLVM 6

The following submodules have been updated for a new version of LLVM:

- `src/llvm`
- `src/libcompiler_builtins` - transitively contains compiler-rt
- `src/dlmalloc`

This also updates the docker container for dist-i686-freebsd as the old 16.04
container is no longer capable of building LLVM. The
compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without
much interesting happening, but the LLVM update here is of particular note.
Unlike previous updates I haven't cherry-picked all existing patches we had on
top of our LLVM branch as we have a [huge amount][patches4] and have at this
point forgotten what most of them are for. Instead I started from the current
`release_60` branch in LLVM and only applied patches that were necessary to get
our tests working and building.

The [current set of custom rustc-specific patches](https://github.com/rust-lang/llvm/compare/f1286127b73c0d81ced8595af62e78ed703ced8b...rust-llvm-release-6-0-0) included in this LLVM update are:

* rust-lang/llvm@1187443 - this is how we actually implement
  `cfg(target_feature)` for now and continues to not be upstreamed. While a
  hazard for SIMD stabilization this commit is otherwise keeping the status
  quo of a small rustc-specific feature.
* rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't
  upstreamed, notably teaching LLVM about our allocation-related routines (which
  aren't malloc/free). Once we stabilize the global allocator routines we will
  likely want to upstream this patch, but for now it seems reasonable to keep it
  on our fork.
* rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in
  our 32-bit linux container. I'm not really sure why it's necessary but my
  guess is that it's because of the absolutely ancient glibc that we're using.
  In any case it's only updating pieces we're not actually using in LLVM so I'm
  hoping it'll turn out alright. This doesn't seem like something we'll want to
  upstream.c
* rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our
  i686-freebsd container, I'm not really sure what's going on but we for sure
  probably don't want to upstream this and otherwise it seems not too bad for
  now at least.
* rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug]
  which although diagnosed to a particular revision isn't currently fixed
  upstream (and the bug itself doesn't seem too active). This commit is a
  partial revert of the suspected cause of this regression (found via a
  bisection). I'm sort of hoping that this eventually gets fixed upstream with a
  similar fix (which we can replace in our branch), but for now I'm also hoping
  it's a relatively harmless change to have.

After applying these patches (plus one [backport] which should be [backported
upstream][llvm-back]) I believe we should have all tests working on all
platforms in our current test suite. I'm like 99% sure that we'll need some more
backports as issues are reported for LLVM 6 when this propagates through
nightlies, but that's sort of just par for the course nowadays!

In any case though some extra scrutiny of the patches here would definitely be
welcome, along with scrutiny of the "missing patches" like a [change to pass
manager order](rust-lang/llvm@2717444), [another change to pass manager
order](rust-lang/llvm@c782feb), some [compile fixes for
sparc](rust-lang/llvm@1a83de6), and some [fixes for
solaris](rust-lang/llvm@c2bfe0a).

[patches4]: rust-lang/llvm@5401fdf...rust-llvm-release-4-0-1
[backport]: rust-lang/llvm@5c54c25
[llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114
[upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096

---

The update to LLVM 6 is desirable for a number of reasons, notably:

* This'll allow us to keep up with the upstream wasm backend, picking up new
  features as they start landing.
* Upstream LLVM has fixed a number of SIMD-related compilation errors,
  especially around AVX-512 and such.
* There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed
  in the LLVM 4 branch we're using.
* Overall it's not a great idea to stagnate with our codegen backend!

This update is mostly powered by #47730 which is allowing us to update LLVM
*independent* of the version of LLVM that Emscripten is locked to. This means
that when compiling code for Emscripten we'll still be using the old LLVM 4
backend, but when compiling code for any other target we'll be using the new
LLVM 6 target. Once Emscripten updates we may no longer need this distinction,
but we're not sure when that will happen!

Closes #43370
Closes #43418
Closes #47015
Closes #47683
Closes rust-lang-nursery/stdsimd#157
Closes rust-lang-nursery/rust-wasm#3

6 years agoEmit data::Impl in save-analysis
Martin Algesten [Fri, 2 Feb 2018 07:29:59 +0000 (08:29 +0100)]
Emit data::Impl in save-analysis

6 years agorange_is_empty tracking issue is #48111
Scott McMurray [Sat, 10 Feb 2018 02:01:12 +0000 (18:01 -0800)]
range_is_empty tracking issue is #48111

6 years agoUse is_empty in range iteration exhaustion tests
Scott McMurray [Sat, 10 Feb 2018 01:54:27 +0000 (17:54 -0800)]
Use is_empty in range iteration exhaustion tests

6 years agorustc: Upgrade to LLVM 6
Alex Crichton [Mon, 22 Jan 2018 22:23:30 +0000 (14:23 -0800)]
rustc: Upgrade to LLVM 6

The following submodules have been updated for a new version of LLVM:

- `src/llvm`
- `src/libcompiler_builtins` - transitively contains compiler-rt
- `src/dlmalloc`

This also updates the docker container for dist-i686-freebsd as the old 16.04
container is no longer capable of building LLVM. The
compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without
much interesting happening, but the LLVM update here is of particular note.
Unlike previous updates I haven't cherry-picked all existing patches we had on
top of our LLVM branch as we have a [huge amount][patches4] and have at this
point forgotten what most of them are for. Instead I started from the current
`release_60` branch in LLVM and only applied patches that were necessary to get
our tests working and building.

The current set of custom rustc-specific patches included in this LLVM update are:

* rust-lang/llvm@1187443 - this is how we actually implement
  `cfg(target_feature)` for now and continues to not be upstreamed. While a
  hazard for SIMD stabilization this commit is otherwise keeping the status
  quo of a small rustc-specific feature.
* rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't
  upstreamed, notably teaching LLVM about our allocation-related routines (which
  aren't malloc/free). Once we stabilize the global allocator routines we will
  likely want to upstream this patch, but for now it seems reasonable to keep it
  on our fork.
* rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in
  our 32-bit linux container. I'm not really sure why it's necessary but my
  guess is that it's because of the absolutely ancient glibc that we're using.
  In any case it's only updating pieces we're not actually using in LLVM so I'm
  hoping it'll turn out alright. This doesn't seem like something we'll want to
  upstream.c
* rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our
  i686-freebsd container, I'm not really sure what's going on but we for sure
  probably don't want to upstream this and otherwise it seems not too bad for
  now at least.
* rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug]
  which although diagnosed to a particular revision isn't currently fixed
  upstream (and the bug itself doesn't seem too active). This commit is a
  partial revert of the suspected cause of this regression (found via a
  bisection). I'm sort of hoping that this eventually gets fixed upstream with a
  similar fix (which we can replace in our branch), but for now I'm also hoping
  it's a relatively harmless change to have.

After applying these patches (plus one [backport] which should be [backported
upstream][llvm-back]) I believe we should have all tests working on all
platforms in our current test suite. I'm like 99% sure that we'll need some more
backports as issues are reported for LLVM 6 when this propagates through
nightlies, but that's sort of just par for the course nowadays!

In any case though some extra scrutiny of the patches here would definitely be
welcome, along with scrutiny of the "missing patches" like a [change to pass
manager order](rust-lang/llvm@27174447533), [another change to pass manager
order](rust-lang/llvm@c782febb7b9), some [compile fixes for
sparc](rust-lang/llvm@1a83de63c42), and some [fixes for
solaris](rust-lang/llvm@c2bfe0abb).

[patches4]: https://github.com/rust-lang/llvm/compare/5401fdf23...rust-llvm-release-4-0-1
[backport]: https://github.com/rust-lang/llvm/commit/5c54c252db
[llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114
[upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096

---

The update to LLVM 6 is desirable for a number of reasons, notably:

* This'll allow us to keep up with the upstream wasm backend, picking up new
  features as they start landing.
* Upstream LLVM has fixed a number of SIMD-related compilation errors,
  especially around AVX-512 and such.
* There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed
  in the LLVM 4 branch we're using.
* Overall it's not a great idea to stagnate with our codegen backend!

This update is mostly powered by #47730 which is allowing us to update LLVM
*independent* of the version of LLVM that Emscripten is locked to. This means
that when compiling code for Emscripten we'll still be using the old LLVM 4
backend, but when compiling code for any other target we'll be using the new
LLVM 6 target. Once Emscripten updates we may no longer need this distinction,
but we're not sure when that will happen!

Closes #43370
Closes #43418
Closes #47015
Closes #47683
Closes rust-lang-nursery/stdsimd#157
Closes rust-lang-nursery/rust-wasm#3

6 years agofix typo: substract -> subtract.
Matthias Krüger [Fri, 9 Feb 2018 21:18:06 +0000 (22:18 +0100)]
fix typo: substract -> subtract.

6 years agoAdd fetch_nand.
Mark Simulacrum [Fri, 9 Feb 2018 18:19:52 +0000 (11:19 -0700)]
Add fetch_nand.

cc #13226 (the tracking issue)

6 years agorustc_mir: insert a dummy access to places being matched on, when building MIR.
Eduard-Mihai Burtescu [Fri, 9 Feb 2018 14:49:38 +0000 (16:49 +0200)]
rustc_mir: insert a dummy access to places being matched on, when building MIR.

6 years agoUpdate books for next release
Mark Simulacrum [Fri, 9 Feb 2018 18:27:47 +0000 (11:27 -0700)]
Update books for next release

6 years agoci: Actually bootstrap on i686 dist
Alex Crichton [Fri, 9 Feb 2018 18:12:32 +0000 (10:12 -0800)]
ci: Actually bootstrap on i686 dist

Right now the `--build` option was accidentally omitted, so we're bootstraping
from `x86_64` to `i686`. In addition to being slower (more compiles) that's not
actually bootstrapping!

6 years agoAuto merge of #47802 - bobtwinkles:loop_false_edge, r=nikomatsakis
bors [Fri, 9 Feb 2018 13:04:17 +0000 (13:04 +0000)]
Auto merge of #47802 - bobtwinkles:loop_false_edge, r=nikomatsakis

[NLL] Add false edges out of infinite loops

Resolves #46036 by adding a `cleanup` member to the `FalseEdges` terminator kind. There's also a small doc fix to one of the other comments in `into.rs` which I can pull out in to another PR if desired =)

This PR should pass CI but the test suite has been relatively unstable on my system so I'm not 100% sure.

r? @nikomatsakis

6 years agoFix tidy
Scott McMurray [Fri, 9 Feb 2018 10:11:04 +0000 (02:11 -0800)]
Fix tidy

6 years agoFix visitation order of calls so that it matches execution order. Fixes #48048
John Kåre Alsaker [Fri, 9 Feb 2018 08:48:54 +0000 (09:48 +0100)]
Fix visitation order of calls so that it matches execution order. Fixes #48048

6 years agoAdd Range[Inclusive]::is_empty
Scott McMurray [Fri, 9 Feb 2018 09:47:18 +0000 (01:47 -0800)]
Add Range[Inclusive]::is_empty

During the RFC, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it.  It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- not even Range<i32> or RangeInclusive<usize>.

6 years agoAuto merge of #47761 - GuillaumeGomez:test-themes, r=Mark-Simulacrum
bors [Fri, 9 Feb 2018 08:23:53 +0000 (08:23 +0000)]
Auto merge of #47761 - GuillaumeGomez:test-themes, r=Mark-Simulacrum

Test themes

r? @QuietMisdreavus

cc @Mark-Simulacrum

6 years agoFix the test
Mark Mansi [Fri, 9 Feb 2018 05:00:38 +0000 (23:00 -0600)]
Fix the test

6 years agoUpdate feature gate test
Mark Mansi [Fri, 9 Feb 2018 04:00:51 +0000 (22:00 -0600)]
Update feature gate test

6 years agoAuto merge of #47489 - pnkfelix:limit-2pb-issue-46747, r=nikomatsakis
bors [Fri, 9 Feb 2018 02:26:43 +0000 (02:26 +0000)]
Auto merge of #47489 - pnkfelix:limit-2pb-issue-46747, r=nikomatsakis

NLL: Limit two-phase borrows to autoref-introduced borrows

This imposes a restriction on two-phase borrows so that it only applies to autoref-introduced borrows.

The goal is to ensure that our initial deployment of two-phase borrows is very conservative. We want it to still cover the `v.push(v.len());` example, but we do not want it to cover cases like `let imm = &v; let mu = &mut v; mu.push(imm.len());`

(Why do we want it to be conservative? Because when you are not conservative, then the results you get, at least with the current analysis, are tightly coupled to details of the MIR construction that we would rather remain invisible to the end user.)

Fix #46747

I decided, for this PR, to add a debug-flag `-Z two-phase-beyond-autoref`, to re-enable the more general approach. But my intention here is *not* that we would eventually turn on that debugflag by default; the main reason I added it was that I thought it was useful for writing tests to be able to write source that looks like desugared MIR.

6 years agoUse the right tracking issue
Mark Mansi [Fri, 9 Feb 2018 00:40:00 +0000 (18:40 -0600)]
Use the right tracking issue

6 years agorustbuild: Pass `ccache` to build scripts
Alex Crichton [Wed, 7 Feb 2018 20:56:04 +0000 (12:56 -0800)]
rustbuild: Pass `ccache` to build scripts

Right now the ccache setting is only used for LLVM, but this tweaks it to also
be used for build scripts so C++ builds like `librustc_llvm` can be a bit
speedier.

6 years agoHide theme button under menu in mobile mode and fix top margin issue (in mobile too)
Guillaume Gomez [Thu, 8 Feb 2018 22:47:49 +0000 (23:47 +0100)]
Hide theme button under menu in mobile mode and fix top margin issue (in mobile too)

6 years agoDisallow function pointers to #[rustc_args_required_const]
Alex Crichton [Thu, 8 Feb 2018 21:11:13 +0000 (13:11 -0800)]
Disallow function pointers to #[rustc_args_required_const]

This commit disallows acquiring a function pointer to functions tagged as
`#[rustc_args_required_const]`. This is intended to be used as future-proofing
for the stdsimd crate to avoid taking a function pointer to any intrinsic which
has a hard requirement that one of the arguments is a constant value.

6 years agoAdd `rustc_args_required_const` to the feature whitelist
Alex Crichton [Thu, 8 Feb 2018 20:48:25 +0000 (12:48 -0800)]
Add `rustc_args_required_const` to the feature whitelist

Unfortunately left out it means that when the `#![feature(proc_macro)]` flag is
in effect it fails to find `rustc_args_required_const` for expansion. This
version, however, is verified to work with stdsimd's requirements!

6 years agoMove some E0XXX to `ui`
Esteban Küber [Thu, 8 Feb 2018 03:35:35 +0000 (19:35 -0800)]
Move some E0XXX to `ui`

6 years agoSwap `ptr::read` for `ptr::drop_in_place`
Jacob Kiesel [Thu, 8 Feb 2018 15:27:53 +0000 (08:27 -0700)]
Swap `ptr::read` for `ptr::drop_in_place`

6 years agorustc: don't ICE when using Rvalue::Discriminant on a non-ADT.
Eduard-Mihai Burtescu [Thu, 8 Feb 2018 15:15:41 +0000 (17:15 +0200)]
rustc: don't ICE when using Rvalue::Discriminant on a non-ADT.

6 years agoFix oversized loads on x86_64 SysV FFI calls
Björn Steinbrink [Sat, 20 Jan 2018 16:09:55 +0000 (17:09 +0100)]
Fix oversized loads on x86_64 SysV FFI calls

The x86_64 SysV ABI should use exact sizes for small structs passed in
registers, i.e. a struct that occupies 3 bytes should use an i24,
instead of the i32 it currently uses.

Refs #45543

6 years agoFleshed out the test a lot more.
Felix S. Klock II [Tue, 6 Feb 2018 15:47:38 +0000 (16:47 +0100)]
Fleshed out the test a lot more.

6 years agoTest that autoref'ing beyond method receivers does not leak into two-phase borrows.
Felix S. Klock II [Tue, 6 Feb 2018 11:48:36 +0000 (12:48 +0100)]
Test that autoref'ing beyond method receivers does not leak into two-phase borrows.

6 years agoAdd `AutoBorrowMutability`; its like `hir::Mutability` but w/ two-phase borrow info...
Felix S. Klock II [Tue, 23 Jan 2018 12:31:11 +0000 (13:31 +0100)]
Add `AutoBorrowMutability`; its like `hir::Mutability`  but w/ two-phase borrow info too.

Namely, the mutable borrows also carries a flag indicating whether
they should support two-phase borrows.

This allows us to thread down, from the point of the borrow's
introduction, whether the particular adjustment that created it is one
that yields two-phase mutable borrows.

6 years agoRestrict two-phase borrows to solely borrows introduced via autoref.
Felix S. Klock II [Tue, 16 Jan 2018 09:52:52 +0000 (10:52 +0100)]
Restrict two-phase borrows to solely borrows introduced via autoref.

Added `-Z two-phase-beyond-autoref` to bring back old behavior (mainly
to allow demonstration of desugared examples).

Updated tests to use aforementioned flag when necessary. (But in each
case where I added the flag, I made sure to also include a revision
without the flag so that one can readily see what the actual behavior
we expect is for the initial deployment of NLL.)

6 years agoEncode (in MIR) whether borrows are explicit in source or arise due to autoref.
Felix S. Klock II [Mon, 15 Jan 2018 11:47:26 +0000 (12:47 +0100)]
Encode (in MIR) whether borrows are explicit in source or arise due to autoref.

This is foundation for issue 46747 (limit two-phase borrows to method-call autorefs).

6 years agoConvert python script to rust
Guillaume Gomez [Mon, 5 Feb 2018 22:43:53 +0000 (23:43 +0100)]
Convert python script to rust

6 years agoPass themes folder as parameter
Guillaume Gomez [Sat, 27 Jan 2018 21:12:28 +0000 (22:12 +0100)]
Pass themes folder as parameter

6 years agoAdd tests for themes
Guillaume Gomez [Thu, 25 Jan 2018 23:44:52 +0000 (00:44 +0100)]
Add tests for themes

6 years agoImprove output a bit in case of error
Guillaume Gomez [Thu, 25 Jan 2018 23:43:57 +0000 (00:43 +0100)]
Improve output a bit in case of error

6 years agoAdd test when trying to add new theme
Guillaume Gomez [Thu, 25 Jan 2018 22:31:48 +0000 (23:31 +0100)]
Add test when trying to add new theme

6 years agoHandle comments in css selector and add tests
Guillaume Gomez [Thu, 25 Jan 2018 22:23:09 +0000 (23:23 +0100)]
Handle comments in css selector and add tests

6 years agoFix missing rules for dark.css
Guillaume Gomez [Thu, 25 Jan 2018 20:59:54 +0000 (21:59 +0100)]
Fix missing rules for dark.css

6 years agoget differences
Guillaume Gomez [Thu, 25 Jan 2018 20:58:10 +0000 (21:58 +0100)]
get differences