Commit Graph

83319 Commits

Author SHA1 Message Date
Felix S. Klock II
90412f149c Add .stderr files for shadowed labels where the point of the test is to test such cases. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
f78b9add44 Alpha-rename label to avoid the shadowing lint (which cannot be silenced). 2018-09-06 13:00:26 +02:00
Felix S. Klock II
175d7f4e48 Add .stderr file for test where there are conflicting repr hints.
See rust-lang/rust#53857.
2018-09-06 13:00:26 +02:00
Felix S. Klock II
d18b3bf104 Add #![allow(improper_ctypes)] to extern-pass-empty.rs; note this test seems bogus.
that is, I suspect it should be retired because it is testing behavior
(namely a `#[repr(C)] struct Empty;`) that, if I understand correctly,
is undefined.

See also rust-lang/rust#53859.
2018-09-06 13:00:26 +02:00
Felix S. Klock II
8bcf37d949 Add #[allow(improper_ctypes)] to slew of cases that need e.g. repr(C).
See also rust-lang/rust#53858.
2018-09-06 13:00:26 +02:00
Felix S. Klock II
e462c1adc5 Add #![allow(..)] for a slew of lints of migrated run-pass tests, to silence stderr output. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
90241dfba3 Remove references to a collection of unknown lints. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
06f36a04a4 Move a bunch of auxiliary support files into ui/run-pass/**/auxiliary. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
0909e0bf70 Add // run-pass annotations to all the tests under ui/run-pass/.
(I may have accidentally added it to some auxilliary crates as well;
my emacs-macro-based methodology was pretty crude.)
2018-09-06 13:00:26 +02:00
Felix S. Klock II
7834c22848 Migrated slew of run-pass tests to various subdirectories of ui/run-pass/. 2018-09-06 13:00:26 +02:00
bors
35a5541fd9 Auto merge of #53707 - eddyb:phantom-waffles, r=oli-obk
rustc_typeck: turn `where Type:,` into a WF(Type) predicate, instead of ignoring it.

Fixes #53696, assuming crater doesn't catch anyone using this syntax already.

Allowing an empty list of bounds in the grammar was done for the benefit of macro authors, most of which would *probably* be using it for bounds on type parameters, which are always WF.

r? @nikomatsakis cc @petrochenkov
2018-09-06 09:32:23 +00:00
bors
20ca02569a Auto merge of #53721 - arielb1:exhaustively-unpun, r=nikomatsakis
fix `is_non_exhaustive` confusion between structs and enums

Structs and enums can both be non-exhaustive, with a very different
meaning. This PR splits `is_non_exhaustive` to 2 separate functions - 1
for structs, and another for enums, and fixes the places that got the
usage confused.

Fixes #53549.

r? @eddyb
2018-09-06 06:42:19 +00:00
Thomas Lively
3dab33225a
Merge branch 'master' into fix-submodules 2018-09-05 21:40:39 -07:00
François Bernier
28745a6e19 Implement initializer() for FileDesc
in order to avoid constantly zeroing memory when it's not needed.
2018-09-05 23:41:20 -04:00
bors
27e5457f3f Auto merge of #53955 - alexcrichton:fix-dist-again, r=japaric
rustbuild: Tweak LLVM distribution layout

This commit tweaks the layout of a few components that we distribute to
hopefully fix across all platforms the recent issues with LLD being unable to
find the LLVM shared object. In #53245 we switched to building LLVM as a dynamic
library, which means that LLVM tools by default link to LLVM dynamically rather
than statically. This in turn means that the tools, at runtime, need to find the
LLVM shared library.

LLVM's shared library is currently distributed as part of the rustc component.
This library is located, however, at `$sysroot/lib`. The LLVM tools we ship are
in two locations:

* LLD is shipped at `$sysroot/lib/rustlib/$host/bin/rust-lld`
* Other LLVM tools are shipped at `$sysroot/bin`

Each LLVM tool has an embedded rpath directive indicating where it will search
for dynamic libraries. This currently points to `../lib` and is presumably
inserted by LLVM's build system. Unfortunately, though, this directive is only
correct for the LLVM tools at `$sysroot/bin`, not LLD!

This commit is targeted at fixing this situation by making two changes:

* LLVM tools other than LLD are moved in the distribution to
  `$sysroot/lib/rustlib/$host/bin`. This moves them next to LLD and should
  position them for...
* The LLVM shared object is moved to `$sysroot/lib/rustlib/$host/lib`

Together this means that all tools should natively be able to find the shared
object and the shared object should be installed all the time for the various
tools. Overall this should...

Closes #53813
2018-09-06 02:09:12 +00:00
bors
8b7f164eab Auto merge of #52994 - varkor:trim_direction, r=alexcrichton
Add trim_start, trim_end etc.; deprecate trim_left, trim_right, etc. in future

Adds the methods: `trim_start`, `trim_end`, `trim_start_matches` and `trim_end_matches`.
Deprecates `trim_left`, `trim_right`, `trim_left_matches` and `trim_right_matches` starting from Rust 1.33.0, three versions from when they'll initially be marked as being deprecated, using the future deprecation from https://github.com/rust-lang/rust/issues/30785 and https://github.com/rust-lang/rust/pull/51681.

Fixes https://github.com/rust-lang/rust/issues/30459.
2018-09-05 23:45:08 +00:00
Vadim Petrochenkov
a6adeae104 Validate syntax of --cfg command line arguments 2018-09-06 02:04:04 +03:00
Alex Crichton
0338d340c4 Remove #[repr(transparent)] from atomics
Added in #52149 the discussion in #53514 is showing how we may not want to
actually add this attribute to the atomic types. While we continue to
debate #53514 this commit reverts the addition of the `transparent` attribute.
This should be a more conservative route which leaves us the ability to tweak
this in the future but in the meantime allows us to continue discussion as well.
2018-09-05 15:41:44 -07:00
Vadim Petrochenkov
b0a05c5981 Validate syntax of cfg attributes 2018-09-06 01:18:30 +03:00
Without Boats
c82af09bb0
Add comment. 2018-09-05 23:47:10 +02:00
bors
6e0f1cc158 Auto merge of #53962 - michaelwoerister:close-thinlto-file-descriptors, r=alexcrichton
ThinLTO: Don't keep files open after mmaping them.

Fixes #53947.

r? @alexcrichton
2018-09-05 20:52:42 +00:00
ms2300
6c14360c32 Changing TyAnon -> TyOpaque and relevant functions 2018-09-05 13:01:16 -06:00
bors
780b0c7bbf Auto merge of #53951 - tromey:restore-lldb-build, r=alexcrichton
Restore lldb build

commit 6c10142251 ("Update LLVM submodule") disabled the lldb build.
This patch updates the lldb and clang submodules to once again build
against the LLVM that is included in the Rust tree, and reverts the
.travis.yml changes from that patch.
2018-09-05 18:11:27 +00:00
Andre Bogus
90b7c5acbc Individual docs for {from,to}_*_bytes 2018-09-05 19:49:57 +02:00
Esteban Küber
bebecf850a reword label as per review 2018-09-05 09:56:01 -07:00
Tom Tromey
7bb30ff0d9 Pick up State.h include path change 2018-09-05 10:37:05 -06:00
Alex Crichton
bce09b6e34 rustbuild: Tweak LLVM distribution layout
This commit tweaks the layout of a few components that we distribute to
hopefully fix across all platforms the recent issues with LLD being unable to
find the LLVM shared object. In #53245 we switched to building LLVM as a dynamic
library, which means that LLVM tools by default link to LLVM dynamically rather
than statically. This in turn means that the tools, at runtime, need to find the
LLVM shared library.

LLVM's shared library is currently distributed as part of the rustc component.
This library is located, however, at `$sysroot/lib`. The LLVM tools we ship are
in two locations:

* LLD is shipped at `$sysroot/lib/rustlib/$host/bin/rust-lld`
* Other LLVM tools are shipped at `$sysroot/bin`

Each LLVM tool has an embedded rpath directive indicating where it will search
for dynamic libraries. This currently points to `../lib` and is presumably
inserted by LLVM's build system. Unfortunately, though, this directive is only
correct for the LLVM tools at `$sysroot/bin`, not LLD!

This commit is targeted at fixing this situation by making two changes:

* LLVM tools other than LLD are moved in the distribution to
  `$sysroot/lib/rustlib/$host/bin`. This moves them next to LLD and should
  position them for...
* The LLVM shared object is moved to `$sysroot/lib/rustlib/$host/lib`

Together this means that all tools should natively be able to find the shared
object and the shared object should be installed all the time for the various
tools. Overall this should...

Closes #53813
2018-09-05 09:17:20 -07:00
Alex Crichton
ace7191df8 Update the compiler-builtins submodule
Fixes a mistake in using C shims to...

Closes #53916
2018-09-05 09:12:17 -07:00
Nathan Froyd
62cd02d7fc propagate build.python into cmake
If a suitable value of Python is not on PATH, one can still invoke x.py
manually, which propagates BOOTSTRAP_PYTHON into the bootstrap
environment.  But building LLVM will abort with error messages about not
being able to find Python, and instructions to set PYTHON_EXECUTABLE,
because nothing is done with BOOTSTRAP_PYTHON when invoking cmake.
Setting build.python in config.toml had no effect in this scenario,
either

To fix this, let's provide PYTHON_EXECUTABLE when invoking cmake; for
the "normal" case of Python in PATH, this doesn't alter any behavior.
For more unusual cases, however, this ensures cmake finds Python
properly.  (This change also ensures there are no differences between
what bootstrap is using, and what cmake uses, which may be useful for
consistency's sake.)
2018-09-05 11:43:48 -04:00
Esteban Küber
941b2e32ad slight rewording of labels 2018-09-05 08:39:50 -07:00
ljedrz
b7c0d32c5f A few cleanups and minor improvements to mir/dataflow 2018-09-05 16:37:21 +02:00
Esteban Küber
3192d3dc0c Change wording of unclosed delimiter label 2018-09-05 07:33:29 -07:00
Esteban Küber
b2d2d83723 Fix existing test 2018-09-05 07:03:02 -07:00
bors
d8af8b66d9 Auto merge of #53878 - alexcrichton:wasm-atomics-feature, r=eddyb
rustc: Prepare the `atomics` feature for wasm

This commit adds a few changes for atomic instructions on the
`wasm32-unknown-unknown` target. Atomic instructions are not yet stable in
WebAssembly itself but there are multiple implementations and LLVM has support
for the proposed instruction set, so let's work on exposing it!

Here there are a few inclusions:

* The `atomics` feature was whitelisted for LLVM, allowing code in Rust to
  enable/disable/gate on this.

* The `singlethread` option is turned off for wasm when the `atomics` feature is
  enabled. This means that by default wasm won't be lowering with atomics, but
  when atomics are enabled globally we'll turn off single-threaded mode to
  actually codegen atomics. This probably isn't what we'll want in the long term
  but for now it should work.

* Finally the maximum atomic width is increased to 64 to reflect the current
  wasm spec.
2018-09-05 13:19:19 +00:00
Siva Prasad
9d440d578d Spacing changes made to the example 2018-09-05 09:09:50 -04:00
MagnumOpus21
5e7039411b Added a missing backtick to no std 2018-09-05 08:56:00 -04:00
MagnumOpus21
94e8a6aa3b Made the requested changes for Note: and no_std within backticks 2018-09-05 08:56:00 -04:00
MagnumOpus21
6c66aeb6c0 Prefixed no_run to the no_std write macro 2018-09-05 08:56:00 -04:00
MagnumOpus21
efb88b40a1 Formatting errors rectified 2018-09-05 08:56:00 -04:00
MagnumOpus21
3ae6d06edb Refined the example 2018-09-05 08:56:00 -04:00
MagnumOpus21
2ae2c628ee Updated libcore/macro.rs to note write macro can work in no_std setups 2018-09-05 08:56:00 -04:00
Michael Woerister
fc47a92336 ThinLTO: Don't keep files open after mmaping them (because it's not needed). 2018-09-05 13:52:58 +02:00
Esteban Küber
008aa5a24e Provide more context for unenclosed delimiters
* When encountering EOF, point at the last opening brace that does not
   have the same indentation level as its close delimiter.
 * When encountering the wrong type of close delimiter, point at the
   likely correct open delimiter to give a better idea of what went
   wrong.
2018-09-05 03:43:24 -07:00
Esteban Küber
5238b523c3 Reword un-closed delimiter label 2018-09-05 03:43:24 -07:00
Esteban Küber
d7a74be09b Fix incorrect outer function type parameter message 2018-09-05 03:34:16 -07:00
bors
b0297f3043 Auto merge of #53867 - cwndrws:json-test-formatter-test-count-as-num, r=nrc
Make json test output formatter represent "test_count" as num

fixes #53866
2018-09-05 09:57:56 +00:00
Thomas Lively
482346ce75 Add .git extension to submodule paths missing it
Fixes a problem where submodules could not be cloned under some git
configurations. Specifically, when url.git@github.com:.insteadOf =
https://github.com/ is set.
2018-09-05 00:45:55 -07:00
bors
3f13b27c2b Auto merge of #53410 - djrenren:custom-test-frameworks, r=alexcrichton
Introduce Custom Test Frameworks

Introduces `#[test_case]` and `#[test_runner]` and re-implements `#[test]` and `#[bench]` in terms of them.

Details found here: https://blog.jrenner.net/rust/testing/2018/08/06/custom-test-framework-prop.html
2018-09-05 07:30:19 +00:00
John Renner
0593dc7e3c Move #[test_case] to a syntax extension 2018-09-04 22:33:23 -07:00
John Renner
e5ed105716 Document #[test_case] and #![test_runner] 2018-09-04 22:33:11 -07:00