Commit Graph

73924 Commits

Author SHA1 Message Date
Stjepan Glavina
6076cf6f4e Remove T: Ord bound from BTreeSet::{is_empty, len} 2018-01-03 20:00:11 +01:00
Ed Schouten
05949b09a8 Explain why local-exec is used by CloudABI. 2018-01-03 18:32:41 +01:00
Steve Klabnik
50989cd98d
This is an unstable feature 2018-01-03 12:05:57 -05:00
bors
d96cc6e286 Auto merge of #47127 - EdSchouten:cloudabi-tests, r=kennytm
First cut at getting some part of the test suite working for CloudABI

I am currently working on creating a Docker container for automated CI for CloudABI. Here are some of the trivial changes that need to land to make tests pass.
2018-01-03 17:00:24 +00:00
Steve Klabnik
47e18e0db7
This isn't in Rust 1.23 2018-01-03 11:58:42 -05:00
Vadim Petrochenkov
ef2b131144 Add docs for crate_in_paths, extern_in_paths and extern_absolute_paths into the unstable book 2018-01-03 19:18:02 +03:00
Marco A L Barbosa
00b5413087 ci: use musl shared script in dist-i586-gnu-i686-musl 2018-01-03 13:49:13 -02:00
Marco A L Barbosa
10a759130e ci: use musl shared script in dist-various-1 (for arm targets)
Update libunwind to 39. This is necessary to build the arm targets
2018-01-03 13:49:13 -02:00
Marco A L Barbosa
ca0499d736 ci: use musl shared script in dist-x86_64-musl 2018-01-03 13:49:13 -02:00
Vadim Petrochenkov
32db83b16e Support extern in paths 2018-01-03 18:09:20 +03:00
Sam
28dd4d974e Restore working debuginfo tests by trimming comments from non-header directive lines 2018-01-03 15:03:00 +00:00
Ed Schouten
3ca407e24b Restore a FIXME that was removed by one of my previous changes.
Requested by: kennytm
2018-01-03 15:40:37 +01:00
Sebastian Dröge
3f29e2b495 Fix compilation of TrustedRandomAccess impl for slice::Chunks
https://github.com/rust-lang/rust/pull/47113 renamed the private size
field to chunk_size for consistency.
2018-01-03 15:05:18 +02:00
Sebastian Dröge
a56a3fc85f Add unit test for zipping slice::{Chunks, ChunksMut, Windows} iterators
For testing if the TrustedRandomAccess implementation works.
2018-01-03 15:05:18 +02:00
Sebastian Dröge
48f2f71185 Implement TrustedRandomAccess for slice::{Chunks, ChunksMut, Windows} 2018-01-03 15:05:18 +02:00
bors
8d1a30289e Auto merge of #46913 - Eh2406:master, r=eddyb
CStore switch FxHashMap to IndexVec

This is a first attempt to fix #46876.
2018-01-03 12:59:52 +00:00
bors
b107f720e5 Auto merge of #47151 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #47104, #47107, #47113, #47117, #47118, #47121, #47125, #47134, #47145
- Failed merges:
2018-01-03 10:07:39 +00:00
kennytm
b416119472 Rollup merge of #47145 - frewsxcv:frewsxcv-linewriter-error, r=QuietMisdreavus
Document when LineWriter flushes; document errors for into_inner.

Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-03 16:58:04 +08:00
kennytm
08501bd983 Rollup merge of #47134 - Sogomn:master, r=QuietMisdreavus
Defocus search bar in rustdoc pages

rust-lang/rfcs#2265
2018-01-03 16:58:03 +08:00
kennytm
bf3fd1744c Rollup merge of #47125 - daboross:patch-3, r=estebank
Mention SliceConcatExt's stability in its docs

Just saw someone in IRC mention there being no stable way to join string slices! It isn't entirely clear from the rust documentation that `SliceConcatExt` is usable. While this is mentioned in https://doc.rust-lang.org/std/prelude/, the trait has nothing to indicate that it's currently usable if found via a documentation search.

The wording on this could probably be improved, but I'm hoping its better than nothing.
2018-01-03 16:58:02 +08:00
kennytm
8bfb420d63 Rollup merge of #47121 - frewsxcv:frewsxcv-vec, r=kennytm
Fix panic condition docs for Vec::insert.

Fixes https://github.com/rust-lang/rust/issues/47065.
2018-01-03 16:58:01 +08:00
kennytm
2182f1431c Rollup merge of #47118 - hdhoang:patch-2, r=BurntSushi
memchr: fix variable name in docstrings

upstream BurntSushi/rust-memchr#24

r=BurntSushi
2018-01-03 16:58:00 +08:00
kennytm
d6cf5a56ac Rollup merge of #47117 - tinaun:no_more_dups, r=frewsxcv
[unstable book] remove duplicate entries

if a unstable feature is a language feature, it shouldn't also have a library feature stub generated
2018-01-03 16:57:58 +08:00
kennytm
219e72c908 Rollup merge of #47113 - sdroege:chunks-size-field, r=dtolnay
Minor cleanup for slice::Chunks and ChunksMut

This only renames the `size` field to `chunk_size` in one of them for consistency, and changes an assertion to check for != 0 instead of > 0.
2018-01-03 16:57:57 +08:00
kennytm
dd0b70e3fe Rollup merge of #47107 - mark-i-m:patch-1, r=steveklabnik
Fix typo

I am assuming that there was once something else you could do and somebody forgot to remove "either". Is that correct?
2018-01-03 16:57:56 +08:00
kennytm
f7932ef1d5 Rollup merge of #47104 - matthewjasper:dont-panic-on-generic-drop, r=estebank
Delay panic from incoherent drop implementation

Closes #41974
2018-01-03 16:57:55 +08:00
Sergio Benitez
ab365be140 Add 'Span.parent()' and 'Span.source()' to proc_macro API. 2018-01-03 00:20:33 -08:00
David Tolnay
000e907c1f
Span::resolved_at and Span::located_at to combine behavior of two spans
Proc macro spans serve two mostly unrelated purposes: controlling name
resolution and controlling error messages. It can be useful to mix the
name resolution behavior of one span with the line/column error message
locations of a different span.

In particular, consider the case of a trait brought into scope within
the def_site of a custom derive. I want to invoke trait methods on the
fields of the user's struct. If the field type does not implement the
right trait, I want the error message to underline the corresponding
struct field.

Generating the method call with the def_site span is not ideal -- it
compiles and runs but error messages sadly always point to the derive
attribute like we saw with Macros 1.1.

```
  |
4 | #[derive(HeapSize)]
  |          ^^^^^^^^
```

Generating the method call with the same span as the struct field's
ident or type is not correct -- it shows the right underlines but fails
to resolve to the trait in scope at the def_site.

```
  |
7 |     bad: std:🧵:Thread,
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
```

The correct span for the method call is one that combines the def_site's
name resolution with the struct field's line/column.

```
field.span.resolved_at(Span::def_site())

// equivalently
Span::def_site().located_at(field.span)
```

Adding both because which one is more natural will depend on context.
2018-01-02 23:43:52 -08:00
David Tolnay
2b9add2c16
Return None from Span::join if in different files 2018-01-02 23:37:36 -08:00
bors
b8934399a8 Auto merge of #47088 - clarcharr:cleanup_unicode_py, r=alexcrichton
Move static code outside of unciode.py.

This script in libstd_unicode is a mess and also contains code that shouldn't be output by a script, and instead just put in modules. So, this change does that.
2018-01-03 06:24:23 +00:00
projektir
6536d363d5 Force appropriate extension when converting from int to ptr #43291 2018-01-02 20:23:13 -08:00
Clar Charr
b4b3ddd59e Move static code outside of unciode.py. 2018-01-02 22:51:22 -05:00
Esteban Küber
48b684a40a Be ambiguous when type cannot be properly mentioned 2018-01-02 19:49:38 -08:00
bors
0f4ebf9f0a Auto merge of #47146 - ereslibre:issue-42106, r=estebank
Only bump error count when we are sure that the diagnostic is not a repetition

This ensures that if we emit the same diagnostic twice, the error count will
match the real number of errors shown to the user.

Fixes #42106

This is a followup of https://github.com/rust-lang/rust/pull/45603 as stated in https://github.com/rust-lang/rust/issues/42106#issuecomment-345218473.

This program, for example:

```rust
fn do_something<T>(collection: &mut Vec<T>) {
    let _a = &collection;
    collection.swap(1, 2);
}

fn main() {}
```

without this patch, produces:

```
error[E0502]: cannot borrow `*collection` as mutable because `collection` is also borrowed as immutable
  --> $DIR/issue-42106.rs:13:5
   |
12 |     let _a = &collection;
   |               ---------- immutable borrow occurs here
13 |     collection.swap(1, 2); //~ ERROR also borrowed as immutable
   |     ^^^^^^^^^^ mutable borrow occurs here
14 | }
   | - immutable borrow ends here

error: aborting due to 2 previous errors
```

The number of errors do not match the diagnostics reported. This PR fixes this problem. The output is now in this case:

```
error[E0502]: cannot borrow `*collection` as mutable because `collection` is also borrowed as immutable
  --> $DIR/issue-42106.rs:13:5
   |
12 |     let _a = &collection;
   |               ---------- immutable borrow occurs here
13 |     collection.swap(1, 2); //~ ERROR also borrowed as immutable
   |     ^^^^^^^^^^ mutable borrow occurs here
14 | }
   | - immutable borrow ends here

error: aborting due to previous error
```

Also, some other tests outputs have been adapted because their count didn't really match the number of diagnostics reported.

As an aside, an outdated comment has been removed (`Handler::cancel` will only call to the `Diagnostic::cancel` method and will not decrease the count of errors).

All tests are passing with this PR (`x.py test` is successful).
2018-01-03 03:37:47 +00:00
Rafael Fernández López
063607eecb
Only bump error count when we are sure that the diagnostic is not a repetition.
This ensures that if we emit the same diagnostic twice, the error count will
match the real number of errors shown to the user.

Fixes #42106
2018-01-03 00:42:12 +01:00
Corey Farwell
f3ef077b91 Document when LineWriter flushes; document errors for into_inner.
Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-02 13:30:44 -08:00
Johannes Boczek
3153d23bb7 Indentation fix
Fixed intentaion (tabs -> spaces)
Added trailing newline
2018-01-02 19:58:06 +01:00
Johannes Boczek
0772b6faed Defocus search bar in rustdoc pages
Escape now removes focus from the search bar
2018-01-02 19:47:44 +01:00
Taylor Cramer
b86a65d39b Limit style lint to non-synthetic generic params 2018-01-02 09:42:11 -08:00
Ed Schouten
c51f8783f2 Correct for changes in line numbers in expected stderr output.
Due to the disable-cloudabi tags being added to the source files, the
expected output of the compiler is altered slightly.
2018-01-02 18:12:10 +01:00
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
Ed Schouten
abced5a6b5 Provide a copy of stdout_isatty() on CloudABI.
CloudABI doesn't make any distinction between TTYs and ordinary pipes.
While there, remove the redundant implementation used by Redox. It can
use the same stub function.
2018-01-02 14:22:37 +01:00
Ed Schouten
04ce26a6f6 Force the creation of libs instead of dylibs on CloudABI.
CloudABI doesn't support the creation of dynamic libraries. Any test
making use of auxiliary libraries will fail without this change applied.
2018-01-02 14:18:40 +01:00
Ed Schouten
3f880912e9 Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.
It looks like many of these tests are already disabled on emscripten,
which also doesn't seem to support environment variables and subprocess
spawning. Just add a similar tag for CloudABI. While there, sort some of
the lists of operating systems alphabetically.
2018-01-02 14:11:41 +01: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
David Ross
d5acd23565 Mention SliceConcatExt's stability in its docs
SliceConcatExt's status as an unstable trait with stable methods is
documented in the compiler error for using it, and in
https://doc.rust-lang.org/std/prelude/, but it is not mentioned in the
trait itself.

Mentioning the methods can be used in stable rust today should help
users who are looking for a `join` method while working on stable rust.
2018-01-02 00:38:03 -08: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
Sebastian Dröge
c096b3a451 Use assert!(chunk_size != 0) instead of > 0 for usize value 2018-01-02 10:00:58 +02:00
Sebastian Dröge
9957cf6023 Consistently use chunk_size as the field name for Chunks and ChunksMut
Previously Chunks used size and ChunksMut used chunk_size
2018-01-02 10:00:58 +02:00
Esteban Küber
6c506d4c71 Address review comments: make label shorter 2018-01-01 22:10:13 -08:00