Commit Graph

83331 Commits

Author SHA1 Message Date
Tim
92dd526a4e Move check out of the match on the intrinsic name 2018-09-06 13:54:27 +02:00
Felix S. Klock II
ff8f1a3b94 Allow some lints to let the ported run-pass/borrowck tests get through. 2018-09-06 13:51:09 +02:00
Felix S. Klock II
4a7c8cc4b9 Add // run-pass to collection of tests. 2018-09-06 13:29:24 +02:00
Felix S. Klock II
65780bc0c7 Migrated src/test/run-pass/borrowck to src/test/ui/run-pass.
Just shuffling files here; the needed updates to content come later.
2018-09-06 13:29:24 +02:00
Tim
58af73c370 Add unchecked_shl/shr checks for intrinsics 2018-09-06 13:13:07 +02:00
Felix S. Klock II
5fe0851548 Allow more lints, mainly overflowing_literals for cases that only arose on 32-bit. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
dc124e4d0b Add #![allow(stable_features)] to ease review.
That is, opting to ignore stable `#![feature(..)]`, under my theory
that a reviewer would prefer as much stuff to be bucketed under "ah
another `#![allow(..)]` here." as possible.
2018-09-06 13:00:26 +02:00
Felix S. Klock II
f97eea1c10 Add .stderr file for test that appears to trigger a lint that cannot be silenced. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
2bce9b031f Add .stdout file for test of log_syntax! and trace_macros!. 2018-09-06 13:00:26 +02:00
Felix S. Klock II
18a77ae4ab Allow uses of #[unsafe_destructor_blind_to_params]. Should be ported to #[may_dangle].
See rust-lang/rust#34761.
2018-09-06 13:00:26 +02:00
Felix S. Klock II
4a9e55e05a Allow illegal_floating_point_literal_pattern. These will need to be updated at some point.
Discussion can be found on rust-lang/rust#41620.
2018-09-06 13:00:26 +02:00
Felix S. Klock II
dc7685e958 Update line numbers to reflect added lines at beginning of tests. 2018-09-06 13:00:26 +02:00
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