Commit Graph

73038 Commits

Author SHA1 Message Date
bors
687d3d15ba Auto merge of #47105 - matthewjasper:dont-panic-for-mut-in-static, r=estebank
Delay panic for aliasing violation for static items.

Closes #46604
2018-01-02 15:40:20 +00:00
bors
a37126b90c Auto merge of #47042 - redox-os:redox, r=estebank
Redox - Implement rename using new system call

This does the following:

- Update syscall module to match upstream
- Implement rename using new system call
- Make readlink and symlink utilize O_CLOEXEC
- Make readlink and symlink not leave dangling file handles on failure
2018-01-02 11:22:40 +00:00
bors
5873a74d8f Auto merge of #47111 - rkruppe:repr-transparent, r=estebank
Check all repr hints together when checking for mis-applied attributes

Fixes #47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at `foo` and/or `bar` in `repr(foo, bar)` instead of the whole attribute. This is sometimes more precise (e.g., `#[repr(C, packed)]` on an enum points at the `packed`) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.
2018-01-02 08:34:27 +00:00
bors
b9cf26c38a Auto merge of #47106 - EdSchouten:compiletest-cloudabi, r=alexcrichton
Tiny fixes to make compiletest work for CloudABI cross builds

I'm currently working toward getting a `src/ci/docker` container working to do isolated/automated builds and testing of `x86_64-unknown-cloudabi`. This is working pretty well, but still requires some fixes to `libtest` and `compiletest`. Here is the first set of fixes that I had to apply.
2018-01-02 00:31:07 +00:00
Robin Kruppe
03936115ef Check all repr hints together when checking for mis-applied attributes
Fixes #47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at `foo` and/or `bar` in `repr(foo, bar)` instead of the whole attribute. This is sometimes more precise (e.g., `#[repr(C, packed)]` on an enum points at the `packed`) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.
2018-01-01 22:05:29 +01:00
bors
b65f0bedd2 Auto merge of #46735 - Manishearth:memchr-find, r=burntsushi
Use memchr for str::find(char)

This is a 10x improvement for searching for characters.

This also contains the patches from https://github.com/rust-lang/rust/pull/46713 . Feel free to land both separately or together.

cc @mystor @alexcrichton

r? @bluss

fixes #46693
2018-01-01 19:04:33 +00:00
Ed Schouten
7b5543d7b6 Move the TestPaths structure from libtest to compiletest.
This structure doesn't seem to be used by libtest itself. It is used by
compiletest, but never passed on to anything externally. This makes it
easier to get the testing framework to work for CloudABI crossbuilds, as
CloudABI currently lacks PathBuf, which is used by TestPaths.
2018-01-01 19:30:19 +01:00
Ed Schouten
79b25c666f Add CloudABI to the list of supported targets in compiletest.
Without this change, compiletest will fail to run when targetting
CloudABI.
2018-01-01 19:27:58 +01:00
matthewjasper
f26c0b41d2 Delay panic for aliasing violation for static items. 2018-01-01 17:53:12 +00:00
bors
5deba220d4 Auto merge of #46278 - MaloJaffre:ci-compiler-docs, r=kennytm
Add compiler docs testing to CI.

Fixes #47025.
I don't know if `x86_64-gnu` is the right builder for this, but there seems to be time left on [Travis](https://travis-ci.org/rust-lang/rust/jobs/307488864).

Remaining problems blocking this PR:
- [x] broken links caused by rustdoc issues:
  - [x] `pub use self::Enum::...`: #46766 and #46767 (fixed by #47050, thanks @ollie27!)
  - [x] `impl Deref for DerefToStdType`: #32129 (ignored in linkchecker)
  - [x] `#[feature(decl_macro)]` and `use std::vec`: #47038 (ignored in linkchecker)
  - [x]  `rustc_data_structures::sync::{Lrc, RwLock}` aliases `std` types: #32130 (ignored in linkchecker)
- [x] markdown differences, in rust repository and in external crates, now failing the build with #46880 merged (all fixed)
- [x] multiple crate updates needed: `rand`, `log`, `parking_lot_core`, `flate2`
  - [x] submodule updates needed to deduplicate dependencies: `rust-installer`, ~`cargo`~ (done by #47052)
  - [x] #44953 test broken by `log` update (removed, this can be controversial)
- [x] Waiting `x86_64-gnu` build results ([done](https://travis-ci.org/rust-lang/rust/builds/323451069))

See individual commits for more details.
2018-01-01 16:22:26 +00:00
Manish Goregaokar
5cf55165fa handle overflow/underflow in index offsets 2018-01-01 19:55:21 +05:30
Malo Jaffré
2449230cce Enable compiler docs testing in x86_64-gnu 2018-01-01 14:44:13 +01:00
Malo Jaffré
cbb32a9418 Fix docs for future pulldown migration 2018-01-01 14:44:12 +01:00
Malo Jaffré
8395798d1a Ignore remaining broken links caused by rustdoc bugs
As pointed out by @ollie27.
2018-01-01 14:44:11 +01:00
Malo Jaffré
7249539de9 Fix broken links in internal docs 2018-01-01 14:44:11 +01:00
Malo Jaffré
8ed13d643a Update crates and submodules to pull doc fixes
Update `rand` crate to `0.3.19`.
Update `log` crate to `0.3.9` and `0.4.1`.
Update `parking_lot_core` crate to `0.2.9`.
Upgrade all flate2 dependencies to `1.0.1`.
- Update `rust-installer` submodule.
2018-01-01 14:44:10 +01:00
Malo Jaffré
0b177b4185 Remove a test blocking the update of the log crate
It tested #44953.
`log` macros in newer versions are no longer recursive, so these duplicated
error messages (about unstable feature uses) previously occurring at each
level of recursion are no longer possible, even with the fix by #45540.
Furthermore this test breaks when multiple versions of `log` are in the
sysroot (`log 0.3.9` depends on`log 0.4.1`)
2018-01-01 14:44:10 +01:00
bors
d5f2745e7c Auto merge of #47098 - estebank:immutable-field, r=nagisa
Reword trying to operate in immutable fields

The previous message ("cannot assign/mutably borrow immutable field")
when trying to modify a field of an immutable binding gave the
(incorrect) impression that fields can be mutable independently of their
ADT's binding. Slightly reword the message to read "cannot
assign/mutably borrow field of immutable binding".

Re #35937.
2018-01-01 12:51:54 +00:00
bors
bc1dda43ec Auto merge of #47095 - leodasvacas:clarify-is-import, r=jseyfried
Clarify where `is_import` is used

So it's not mistaken for dead code.
2018-01-01 10:02:45 +00:00
bors
1bcc6dc7ea Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfried
Allow lifetimes in macros

This is a resurrection of PR #41927 which was a resurrection of #33135, which is intended to fix #34303.

In short, this allows macros_rules! to use :lifetime as a matcher to match 'lifetimes.

Still to do:
- [x]  Feature gate
2018-01-01 07:21:23 +00:00
bors
f3ca88cff7 Auto merge of #47064 - kennytm:force-trailing-newlines, r=estebank
Add a tidy check for missing or too many trailing newlines.

I've noticed recently there are lots of review comments requesting to fix trailing newlines. If this is going to be an official style here, it's better to let the CI do this repetitive check.
2018-01-01 04:09:51 +00:00
bors
037bc651e5 Auto merge of #47052 - fschutt:master, r=estebank
Improved error messages for linking failure

Partial fix for #46998

It's unnecessary to print the linker options if there is no linker installed in the first place. Currently, for libraries, the output is still printed, but that should be cleaned up in the future. If you don't have gcc or g++ installed, so that no linker is installed on the system, the output is now this:

```
$ ./rustc hello.rs
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error
```

For libraries, the linker arguments are still printed, but they should be cleaned up in further commits.
2018-01-01 01:00:24 +00:00
Esteban Küber
6384568fdb Reword trying to operate in immutable fields
The previous message ("cannot assign/mutably borrow immutable field")
when trying to modify a field of an immutable binding gave the
(incorrect) impression that fields can be mutable independently of their
ADT's binding. Slightly reword the message to read "cannot
assign/mutably borrow field of immutable binding".
2017-12-31 15:32:41 -08:00
bors
ad30f5476d Auto merge of #47089 - EdSchouten:cloudabi-is-not-unix, r=kennytm
Don't announce CloudABI as being UNIX.

This was originally brought in, because the definitions are based on
those of FreeBSD, Linux, etc. Even though CloudABI is based on POSIX, it
uses a subset that is so small that it's not reasonable to call it POSIX.

Now that I'm porting libstd, I'm running into some spots where I have to
explicitly disable code paths that were enabled by cfg(unix).
2017-12-31 22:21:20 +00:00
Felix Schütt
7c13fa3730 Update cargo 2017-12-31 22:48:33 +01:00
Felix Schütt
3e3536c09c Removed unnecessary output of linker options when linker is not installed
It's unnecessary to print the linker options if there is no linker installed.
Currently, for libraries, the output is still printed, see #46998 for
discussion
2017-12-31 22:48:33 +01:00
leonardo.yvens
f6ff3771e3 Clarify where is_import is used.
So it's not mistaken for dead code.
2017-12-31 17:25:56 -02:00
bors
9389e23a8a Auto merge of #47072 - EdSchouten:cloudabi-jemalloc, r=kennytm
Add CloudABI to the list of systems on which we stub out alloc_jemalloc.

The official jemalloc sources don't build cleanly on CloudABI yet, for
the reason that some of its tracing frameworks try to access the global
filesystem namespace, which CloudABI doesn't provide.

Always make use of the malloc implementation used by the C library,
which already happens to be jemalloc with some tiny build fixes.
2017-12-31 19:25:05 +00:00
bors
8c59418962 Auto merge of #46713 - Manishearth:memchr, r=bluss
Use memchr to speed up [u8]::contains 3x

None
2017-12-31 16:38:10 +00:00
Manish Goregaokar
4ef6847d4d Use memchr for [i8]::contains as well 2017-12-31 20:35:39 +05:30
bors
885011ef1f Auto merge of #47084 - zackmdavis:and_the_case_of_the_bloated_tuple_struct_indices, r=petrochenkov
in which leading zeroes on tuple-struct accesses are abjured

Resolves #47073. If accepted, a point in the compatibility section of the release notes is warranted.
2017-12-31 13:54:24 +00:00
bors
e03742368f Auto merge of #47004 - nvzqz:rc-conversions, r=bluss,kennytm
Remove transmute in From<&str> impls for Arc/Rc

Performs conversion via raw pointer casts.
2017-12-31 10:36:28 +00:00
Ed Schouten
4685233122 Don't announce CloudABI as being UNIX.
This was originally brought in, because the definitions are based on
those of FreeBSD, Linux, etc. Even though CloudABI is based on POSIX, it
uses a subset that is so small that it's not reasonable to call it POSIX.

Now that I'm porting libstd, I'm running into some spots where I have to
explicitly disable code paths that were enabled by cfg(unix).
2017-12-31 11:14:38 +01:00
bors
a18dea908c Auto merge of #47079 - varkor:contrib-11, r=Mark-Simulacrum
Fix doc typo for is_ascii_graphic

Fixes #47067.
2017-12-31 07:29:16 +00:00
Zack M. Davis
b0f880ddd9 in which leading zeroes on tuple-struct accesses are abjured
Resolves #47073.
2017-12-30 21:16:16 -08:00
bors
2d74ce292e Auto merge of #47044 - topecongiro:fixed-ices, r=estebank
Add tests on fixed ICEs

Closes #29924. Closes #38857. Closes #39665. Closes #39872.
Closes #41210. Closes #41880. Closes #43483.

Note that compile-fail/E0599.rs is for #41210.
2017-12-31 04:46:26 +00:00
Matt Peterson
8b4bdc2f3f refactor lifetime out of is_lifetime 2017-12-30 21:47:45 -05:00
bors
54d7285a34 Auto merge of #47080 - varkor:contrib-12, r=rkruppe
Optimise min/max

Swapping the conditions generates more efficient x86 assembly. See
https://github.com/rust-lang/rust/pull/46926#issuecomment-354567412.

r? @rkruppe
2017-12-31 00:09:18 +00:00
varkor
fba16d3f0b Optimise min/max
Swapping the conditions generates more efficient x86 assembly. See
https://github.com/rust-lang/rust/pull/46926#issuecomment-354567412.
2017-12-30 21:38:43 +00:00
varkor
e154e33add Fix doc typo for is_ascii_graphic
Fixes #47067.
2017-12-30 21:27:43 +00:00
bors
3f916bd302 Auto merge of #47063 - kennytm:gate-tools-on-update, r=alexcrichton
Requires tools to test-pass if the corresponding submodule is updated.

Follow up of #46554. Breaking a tool would not stop bors from accepting a merge, but this also means when we intend to *fix* a tool but failed, bors will *still* accept the PR. This behavior is not helpful to the tool maintainers.

This PR attempts to fix this by rejecting the tool-update merge when a tool failed. It recognizes a PR as "tool-updating" when the corresponding submodule is changed, compared with the previous commit.
2017-12-30 19:38:24 +00:00
bors
0296b7165b Auto merge of #47076 - steveklabnik:update-books, r=frewsxcv
update books for next release
2017-12-30 17:04:27 +00:00
steveklabnik
28d13f9edf update books for next release 2017-12-30 12:02:53 -05:00
Seiichi Uchida
b3c022db8b Add tests on fixed ICEs
Closes #29924. Closes #38857. Closes #39665. Closes #39872.
Closes #39553. Closes #41210. Closes #41880. Closes #43483.
2017-12-30 19:02:25 +09:00
kennytm
8ed16fe47a
Requires tools to test-pass if the corresponding submodule is updated.
If a PR intends to update a tool but its test has failed, abort the merge
regardless of current channel. This should help the tool maintainers if the
update turns out to be failing due to changes in latest master.
2017-12-30 17:15:40 +08:00
Ed Schouten
df0a2e440e Add CloudABI to the list of systems on which we stub out alloc_jemalloc.
The official jemalloc sources don't build cleanly on CloudABI yet, for
the reason that some of its tracing frameworks try to access the global
filesystem namespace, which CloudABI doesn't provide.

Always make use of the malloc implementation used by the C library,
which already happens to be jemalloc with some tiny build fixes.
2017-12-30 10:00:35 +01:00
kennytm
4577a70934
Add a tidy check to ensure all files have 1 or 2 trailing newlines. 2017-12-30 15:50:53 +08:00
kennytm
470a8e1a97
Remove excessive trailing newlines. 2017-12-30 15:50:52 +08:00
kennytm
4daaee900f
Add trailing newlines to files which have no trailing newlines. 2017-12-30 15:50:52 +08:00
bors
35681fbc76 Auto merge of #47026 - EdSchouten:cloudabi-unwind, r=kennytm
Link against -lunwind on CloudABI.

CloudABI makes use of LLVM's libunwind to do stack unwinding. It is
installed under the name libunwind.a.
2017-12-29 23:07:42 +00:00