bors [Sat, 6 Jan 2018 14:50:14 +0000 (14:50 +0000)]
Auto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichton
Bump to 1.25.0
* Bump the release version to 1.25
* Bump the bootstrap compiler to the recent beta
* Allow using unstable rustdoc features on beta - this fix has been applied to
the beta branch but needed to go to the master branch as well.
bors [Sat, 6 Jan 2018 09:22:16 +0000 (09:22 +0000)]
Auto merge of #47083 - CAD97:issue-46976, r=nikomatsakis
Issue 46976
ICE is due to an empty path segments, so I set the path to be the same as the in band ty params symbol. (I think this is how regular generics end up being handled?)
Pinging @cramertj, this is your code I'm editing here.
bors [Sat, 6 Jan 2018 05:20:22 +0000 (05:20 +0000)]
Auto merge of #47155 - nerd2:debuginfo_test_fix, r=alexcrichton
Restore working debuginfo tests by trimming comments from non-header directive lines
I noticed when adding a debuginfo test that nothing I did caused the test to fail. Tracing back this seems to have been caused by 3e6c83de1dc0a72df3663617d394a9e79641618d which broke parsing of the command/check lines, leaving all tests passing without any checking. This commit provides a basic (although still not very robust) restoration of tests and a should-fail test which checks the parser is running
Guillaume Gomez [Sat, 6 Jan 2018 01:13:33 +0000 (02:13 +0100)]
Rollup merge of #47165 - mbrubeck:args, r=alexcrichton
[unix] Don't clone command-line args on startup
Fixes part of #47164 and simplifies the `args` code on non-Apple Unix platforms.
Note: This could change behavior for programs that use both `std::env::args` *and* unsafe code that mutates `argv` directly. However, these programs already behave differently on different platforms. The new behavior on non-Apple platforms is closer to the existing behavior on Apple platforms.
Guillaume Gomez [Sat, 6 Jan 2018 01:13:32 +0000 (02:13 +0100)]
Rollup merge of #46987 - frewsxcv:frewsxcv-current-exe, r=QuietMisdreavus
Minor rewrite of env::current_exe docs; clarify symlinks.
- Update example in ‘security’ section to use hard links, like the
linked securityvulns.com example.
- Weaken language on symbolic links – indicate behavior is
platform-specific
Alex Crichton [Fri, 5 Jan 2018 18:07:36 +0000 (10:07 -0800)]
rustc: Don't ICE if we invalidate an invalid incr dir
This showed up on the Windows bot for testing this PR, and this pr allows
`mark_incr_comp_session_as_invalid` ok if it's already invalid, hopefully
avoiding scary ICEs and instead leaving the nicely printed errors
kennytm [Fri, 5 Jan 2018 09:22:07 +0000 (17:22 +0800)]
Rollup merge of #47149 - dtolnay:spans, r=jseyfried
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.
kennytm [Fri, 5 Jan 2018 09:22:06 +0000 (17:22 +0800)]
Rollup merge of #47110 - EdSchouten:cloudabi-tls, r=kennytm
Use the right TLS model for CloudABI.
CloudABI doesn't do dynamic linking. For this reason, there is no need
to handle any other TLS model than local-exec. CloudABI's C library
doesn't provide a __tls_get_addr() function to do Dynamic TLS.
By forcing local-exec to be used here, we ensure that we don't generate
function calls to __tls_get_addr().
kennytm [Fri, 5 Jan 2018 09:22:05 +0000 (17:22 +0800)]
Rollup merge of #47033 - EdSchouten:cloudabi-oom, r=kennytm
Disable printing of error message on file descriptor 2 on CloudABI.
As CloudABI is a capability-based runtime environment, file descriptors
are the mechanism that grants rights to a process. These file
descriptors may be passed into processes on startup using a utility
called cloudabi-run. Unlike the POSIX shell, cloudabi-run does not
follow the UNIX model where file descriptors 0, 1 and 2 represent stdin,
stdout and stderr. There can be arbitrary many (or few) file descriptors
that can be provided. For this reason, CloudABI's C library also doesn't
define STD*_FILENO. liblibc should also not declare these.
Disable the code in liballoc_system that tries to print error messages
over file descriptor 2. For now, let's keep this function quiet. We'll
see if we can think of some other way to log this in the future.
kennytm [Fri, 5 Jan 2018 09:22:04 +0000 (17:22 +0800)]
Rollup merge of #47030 - ollie27:stab, r=alexcrichton
Correct a few stability attributes
* The extra impls for `ManuallyDrop` were added in #44310 which was only stabilised in 1.22.0.
* The impls for `SliceIndex` were stabilised in #43373 but as `RangeInclusive` and `RangeToInclusive` are still unstable the impls should remain unstable.
* The `From` impls for atomic integers were added in #45610 but most atomic integers are still unstable.
* The `shared_from_slice2` impls were added in #45990 but they won't be stable until 1.24.0.
* The `Mutex` and `RwLock` impls were added in #46082 but won't be stable until 1.24.0.
bors [Fri, 5 Jan 2018 05:20:23 +0000 (05:20 +0000)]
Auto merge of #46907 - varkor:contrib-8, r=nagisa
Allow non-alphabetic underscores in camel case
Certain identifiers, such as `X86_64`, cannot currently be unambiguously represented in camel case (`X8664`, `X86_64`, `X8_664`, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under `#[forbid(non_camel_case_types)]`. Fixes #34633 and fixes #41621.
Alex Crichton [Tue, 2 Jan 2018 01:53:47 +0000 (17:53 -0800)]
Bump to 1.25.0
* Bump the release version to 1.25
* Bump the bootstrap compiler to the recent beta
* Allow using unstable rustdoc features on beta - this fix has been applied to
the beta branch but needed to go to the master branch as well.
bors [Thu, 4 Jan 2018 05:52:39 +0000 (05:52 +0000)]
Auto merge of #47124 - estebank:loan-paths, r=nikomatsakis
Reword reason for move note
On move errors, when encountering an enum variant, be more ambiguous and do not refer to the type on the cause note, to avoid referring to `(maybe as std::prelude::v1::Some).0`, and instead refer to `the value`.
Sidesteps part of the problem with #41962:
```
error[E0382]: use of partially moved value: `maybe`
--> file.rs:5:30
|
5 | if let Some(thing) = maybe {
| ----- ^^^^^ value used here after move
| |
| value moved here
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0`
--> file.rs:5:21
|
5 | if let Some(thing) = maybe {
| ^^^^^ value moved here in previous iteration of loop
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
bors [Wed, 3 Jan 2018 21:06:21 +0000 (21:06 +0000)]
Auto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakis
NLL fixes
First, introduce pre-statement effects to dataflow to fix #46875. Edge dataflow effects might make that redundant, but I'm not sure of the best way to integrate them with liveness etc., and if this is a hack, this is one of the cleanest hacks I've seen.
And I want a small fix to avoid the torrent of bug reports.
bors [Wed, 3 Jan 2018 17:00:24 +0000 (17:00 +0000)]
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.
kennytm [Wed, 3 Jan 2018 08:58:02 +0000 (16:58 +0800)]
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.
David Tolnay [Wed, 3 Jan 2018 07:29:11 +0000 (23:29 -0800)]
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.
bors [Wed, 3 Jan 2018 06:24:23 +0000 (06:24 +0000)]
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.
```
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).
Ed Schouten [Tue, 2 Jan 2018 13:22:37 +0000 (14:22 +0100)]
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.
Ed Schouten [Tue, 2 Jan 2018 13:11:41 +0000 (14:11 +0100)]
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.
bors [Tue, 2 Jan 2018 11:22:40 +0000 (11:22 +0000)]
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
David Ross [Tue, 2 Jan 2018 03:14:32 +0000 (19:14 -0800)]
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.
bors [Tue, 2 Jan 2018 08:34:27 +0000 (08:34 +0000)]
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.
bors [Tue, 2 Jan 2018 00:31:07 +0000 (00:31 +0000)]
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.
Robin Kruppe [Mon, 1 Jan 2018 20:42:12 +0000 (21:42 +0100)]
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.
Ed Schouten [Mon, 1 Jan 2018 20:46:22 +0000 (21:46 +0100)]
Use the right TLS model for CloudABI.
CloudABI doesn't do dynamic linking. For this reason, there is no need
to handle any other TLS model than local-exec. CloudABI's C library
doesn't provide a __tls_get_addr() function to do Dynamic TLS.
By forcing local-exec to be used here, we ensure that we don't generate
function calls to __tls_get_addr().