Commit Graph

73514 Commits

Author SHA1 Message Date
Marco A L Barbosa
882cd3cf0b Add i586-unknown-linux-musl target 2018-01-11 15:57:28 -02:00
muvlon
bac725ecdf Fix dead links in docs for OsStr 2018-01-11 17:20:30 +01:00
muvlon
fc825f09e8 Fix confusing documentation for OsStr 2018-01-11 17:20:16 +01:00
Ed Schouten
6a8d55a235 Extend tidy to allow conditionalizing tests for multiple targets. 2018-01-11 17:06:33 +01:00
bors
73ac5d6a80 Auto merge of #47180 - varkor:range-iterator-overrides, r=alexcrichton
Add iterator method specialisations to Range*

Add specialised implementations of `max` for `Range`, and `last`, `min` and `max` for `RangeInclusive`, all of which lead to significant advantages in the generated assembly on x86.

Note that adding specialisations of `min` and `last` for `Range` led to no benefit, and adding `sum` for `Range` and `RangeInclusive` led to type inference issues (though this is possibly still worthwhile considering the performance gain).

This addresses some of the concerns in #39975.
2018-01-11 12:22:54 +00:00
Ed Schouten
9babb8a863 Make libtest build on CloudABI.
Just like on UNIX systems, we need to use sysconf() to obtain the number
of CPUs. Extend the existing cfg()'s to match CloudABI as well.
2018-01-11 11:42:33 +01:00
Ed Schouten
cc8565b20a Make the documentation build work on CloudABI.
Just like with wasm, we can't just import unix::ext and windows::ext.
Our shims are not complete enough for that.
2018-01-11 11:29:52 +01:00
Ed Schouten
d9d97c9f09 Make tests build on CloudABI.
There are some tests that need to be disabled on CloudABI specifically,
due to the fact that the shims cannot be built in combination with
unix::ext or windows::ext. Also improve the scoping of some imports to
suppress compiler warnings.
2018-01-11 11:28:34 +01:00
Ed Schouten
d882bb516e Add shims for modules that we can't implement on CloudABI.
As discussed in #47268, libstd isn't ready to have certain functionality
disabled yet. Follow wasm's approach of adding no-op modules for all of
the features that we can't implement.

I've placed all of those shims in a shims/ subdirectory, so we (the
CloudABI folks) can experiment with removing them more easily. It also
ensures that the code that does work doesn't get polluted with lots of
useless boilerplate code.
2018-01-11 11:26:13 +01:00
Ed Schouten
20745264ce Implement libstd for CloudABI.
Though CloudABI is strongly inspired by POSIX, its absence of features
that don't work well with capability-based sandboxing makes it different
enough that adding bits to sys/unix will make things a mess. This change
therefore adds CloudABI specific platform code under sys/cloudabi and
borrows parts from sys/unix that can be used without changes.

One of the goals of this implementation is to build as much as possible
directly on top of CloudABI's system call layer, as opposed to using the
C library. This is preferred, as the system call layer is supposed to be
stable, whereas the C library ABI technically is not. An advantage of
this approach is that it allows us to implement certain interfaces, such
as mutexes and condition variables more optimally. They can be lighter
than the ones provided by pthreads.

This change disables some modules that cannot realistically be
implemented right now. For example, libstd's pathname abstraction is not
designed with POSIX *at() (e.g., openat()) in mind. The *at() functions
are the only set of file system APIs available on CloudABI. There is no
global file system namespace, nor a process working directory.
Discussions on how to port these modules over are outside the scope of
this change.

Apart from this change, there are still some other minor fixups that
need to be made to platform independent code to make things build. These
will be sent out separately, so they can be reviewed more thoroughly.
2018-01-11 11:21:54 +01:00
Ed Schouten
795e173a76 Import the CloudABI system call bindings into the libstd tree.
These automatically generated Rust source files allow us to invoke
system calls within CloudABI processes. These will be used by libstd to
implement primitives for I/O, threading, etc.

These source files are normally part of the 'cloudabi' crate. In the
case of libstd, we'd better copy them into the source tree, as having
external dependencies in libstd is a bit messy. Original source files
can be found here:

    https://github.com/NuxiNL/cloudabi/tree/master/rust
2018-01-11 11:21:51 +01:00
Seiichi Uchida
9649c4a27c Add tests to fixed issues.
Closes #36792. Closes #38091. Closes #39687. Closes #42148. Closes #42956.
2018-01-11 13:03:25 +09:00
bors
619ced0578 Auto merge of #47087 - Zoxc:incr_no_in_ignore, r=michaelwoerister
Replace uses of DepGraph.in_ignore with DepGraph.with_ignore

I currently plan to track tasks in thread local storage. Ignoring things in a closure ensures that the ignore tasks do not overlap the beginning or end of any other task. The TLS API will also use a closure to change a TLS value, so having the ignore task be a closure also helps there.

It also adds `assert_ignored` which is used before a `TyCtxt` is created. Instead of adding a new ignore task this simply ensures that we are in a context where reads are ignored.

r? @michaelwoerister
2018-01-11 03:24:16 +00:00
Geoffry Song
2e0ad5af30 Glued tokens can themselves be joint.
When gluing two tokens, the second of which is joint, the result should also be
joint.
This fixes an issue with joining three `Dot` tokens to make a `DotDotDot` - the
intermediate `DotDot` would not be joint and therefore we would not attempt to
glue the last `Dot` token, yielding `.. .` instead of `...`.
2018-01-10 17:20:04 -08:00
bors
c9c2980736 Auto merge of #47243 - wesleywiser:incr_fingerprint_encoding, r=michaelwoerister
[incremental] Specialize encoding and decoding of Fingerprints

This saves the storage space used by about 32 bits per `Fingerprint`.
On average, this reduces the size of the `/target/{mode}/incremental`
folder by roughly 5% [Full details here](https://gist.github.com/wesleywiser/264076314794fbd6a4c110d7c1adc43e).

Fixes #45875

r? @michaelwoerister
2018-01-11 00:23:23 +00:00
Alexis Hunt
9d9504a27c Fix typo. 2018-01-10 17:58:00 -05:00
Matt Brubeck
3f9c057ea6 Use the new fs_read_write functions in rustc internals 2018-01-10 14:53:40 -08:00
Dan Robertson
c78679db08
Fix panic strings.
- Fix panic string in `check_ast_crate`.
2018-01-10 21:39:21 +00:00
Esteban Küber
90bc98c5d1 Modify message to match label 2018-01-10 11:41:12 -08:00
David Wood
1aa454e1e6
Updated other tests affected by change. 2018-01-10 19:12:57 +00:00
Matt Brubeck
44912bf77b Pre-allocate in fs::read and fs::read_string 2018-01-10 10:48:11 -08:00
Michael Woerister
fe21c4c522 Add -Ztime-passes line for dep-graph loading. 2018-01-10 18:23:50 +01:00
David Wood
cad7b4f450
Fixes #46983. Fixes bad error message when converting anonymous lifetime to 'static 2018-01-10 17:13:16 +00:00
David Wood
ee43e6d6c9
Added test for #46983 2018-01-10 17:12:23 +00:00
Niko Matsakis
00ce7eed7d resolve type and region variables in "NLL dropck"
Fixes #47022.
2018-01-10 10:15:08 -05:00
bors
f62f774035 Auto merge of #47167 - ivanbakel:builtin_indexing, r=nikomatsakis
Fix built-in indexing not being used where index type wasn't "obviously" usize

Fixes #33903
Fixes #46095

This PR was made possible thanks to the generous help of @eddyb

Following the example of binary operators, builtin checking for indexing has been moved from the typecheck stage to a writeback stage, after type constraints have been resolved.
2018-01-10 12:29:05 +00:00
Oliver Middleton
45cad0456f rustdoc: Populate external_traits with traits only seen in impls
This means default methods can always be found and "Important traits" will include all spotlight traits.
2018-01-10 07:05:30 +00:00
bors
27ede55414 Auto merge of #46830 - Diggsey:cursor-vec-mut, r=alexcrichton
Implement `Write` for `Cursor<&mut Vec<T>>`

Fixes #30132

r? @dtolnay (I'm just going through `feature-accepted` issues I swear 😛)
2018-01-10 06:33:31 +00:00
Manish Goregaokar
44b659ac2d Add test for #45868 2018-01-10 10:34:14 +05:30
Bulat Musin
d0d5db65c7
fix typo rwlock.rs
Hi. Fixed typo: contained -> content
2018-01-10 08:03:10 +03:00
Manish Goregaokar
730679685e Use correct line offsets for doctests (fixes #45868) 2018-01-10 10:10:34 +05:30
bors
92c32d2d8c Auto merge of #47308 - frewsxcv:rollup, r=frewsxcv
Rollup of 5 pull requests

- Successful merges: #46762, #46777, #47262, #47285, #47301
- Failed merges:
2018-01-10 03:52:19 +00:00
Corey Farwell
8fbfd2c940 Rollup merge of #47301 - GuillaumeGomez:fix-error-index-display, r=QuietMisdreavus
Fix error index display

Fixes #47284.

r? @QuietMisdreavus
2018-01-09 22:28:26 -05:00
Corey Farwell
14a9e264ba Rollup merge of #47285 - AndrewBrinker:master, r=kennytm
Fixed a typo in the compile_error docs

Noticed a typo and fixed it.
2018-01-09 22:28:25 -05:00
Corey Farwell
14284f3646 Rollup merge of #47262 - estebank:issue-45562, r=petrochenkov
Account for `pub` in `const` -> `static` suggestion

Fix #45562.
2018-01-09 22:28:24 -05:00
Corey Farwell
e2e8cd3d14 Rollup merge of #46777 - frewsxcv:frewsxcv-rotate, r=alexcrichton
Deprecate [T]::rotate in favor of [T]::rotate_{left,right}.

Background
==========

Slices currently have an **unstable** [`rotate`] method which rotates
elements in the slice to the _left_ N positions. [Here][tracking] is the
tracking issue for this unstable feature.

```rust
let mut a = ['a', 'b' ,'c', 'd', 'e', 'f'];
a.rotate(2);
assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
```

Proposal
========

Deprecate the [`rotate`] method and introduce `rotate_left` and
`rotate_right` methods.

```rust
let mut a = ['a', 'b' ,'c', 'd', 'e', 'f'];
a.rotate_left(2);
assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
```

```rust
let mut a = ['a', 'b' ,'c', 'd', 'e', 'f'];
a.rotate_right(2);
assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
```

Justification
=============

I used this method today for my first time and (probably because I’m a
naive westerner who reads LTR) was surprised when the docs mentioned that
elements get rotated in a left-ward direction. I was in a situation
where I needed to shift elements in a right-ward direction and had to
context switch from the main problem I was working on and think how much
to rotate left in order to accomplish the right-ward rotation I needed.

Ruby’s `Array.rotate` shifts left-ward, Python’s `deque.rotate` shifts
right-ward. Both of their implementations allow passing negative numbers
to shift in the opposite direction respectively. The current `rotate`
implementation takes an unsigned integer argument which doesn't allow
the negative number behavior.

Introducing `rotate_left` and `rotate_right` would:

- remove ambiguity about direction (alleviating need to read docs 😉)
- make it easier for people who need to rotate right

[`rotate`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rotate
[tracking]: https://github.com/rust-lang/rust/issues/41891
2018-01-09 22:28:23 -05:00
Corey Farwell
2b61564f26 Rollup merge of #46762 - est31:master, r=alexcrichton
Stabilize the panic_col feature

I've added the panic_col feature in PR #42938.
Now it's time to stabilize it!
Closes #42939.
2018-01-09 22:28:22 -05:00
est31
24918148bb We have Rust 1.25 now 2018-01-10 03:27:08 +01:00
est31
a8556d77c6 Stabilize the panic_col feature
I've added the panic_col feature in PR #42938.
Now it's time to stabilize it!
Closes #42939.
2018-01-10 03:23:49 +01:00
Wesley Wiser
01c890ee96 [incremental] Specialize encoding and decoding of Fingerprints
This saves the storage space used by about 32 bits per `Fingerprint`.
On average, this reduces the size of the `/target/{mode}/incremental`
folder by roughly 5%.

Fixes #45875
2018-01-09 20:20:50 -05:00
bors
107e65ec01 Auto merge of #47248 - EdSchouten:cloudabi-liblibc, r=kennytm
Upgrade liblibc to upstream version 0.2.35.

This version of liblibc is a prerequisite for getting libstd to build on
CloudABI.
2018-01-10 00:59:00 +00:00
Taylor Cramer
ce4673df39 Use copy/clone closures to simplify calendar test 2018-01-09 16:43:24 -08:00
Ryan Cumming
b69c32097a Fix typo 2018-01-10 09:15:51 +11:00
Ryan Cumming
4cc0fe5136 Restore the original Window comment
The Windows situation is more complicated than I realised
2018-01-10 09:10:59 +11:00
andjo403
bdc34fd7f7 fix faulty comment 2018-01-09 22:51:50 +01:00
Guillaume Gomez
265b234dd6 Fix error index display 2018-01-09 22:26:26 +01:00
varkor
919d643b79 Add min and last specialisations for Range 2018-01-09 19:37:44 +00:00
Taylor Cramer
7b420cf3da Treat #[path] files as mod.rs files 2018-01-09 10:54:13 -08:00
John Kåre Alsaker
9508922499 Replace uses of DepGraph.in_ignore with DepGraph.with_ignore 2018-01-09 18:35:50 +01:00
bors
61452e506f Auto merge of #47269 - michaelwoerister:mangled-cgu-names, r=alexcrichton
Shorten names of some compiler generated artifacts.

This PR makes the compiler mangle codegen unit names by default. The name of every codegen unit name will now be a random string of 16 characters. It also makes the file extensions of some intermediate compiler products shorter. Hopefully, these changes will reduce the pressure on tools with path length restrictions like buildbot. The change should also solve problems with case-insensitive file system.

cc #47186 and #47222

r? @alexcrichton
2018-01-09 16:04:21 +00:00