]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agorustllvm: adjust usage of createNameSpace
Tim Neumann [Fri, 21 Jul 2017 11:31:19 +0000 (13:31 +0200)]
rustllvm: adjust usage of createNameSpace

6 years agorustllvm: adjust usage of createPointerType
Tim Neumann [Fri, 21 Jul 2017 11:26:41 +0000 (13:26 +0200)]
rustllvm: adjust usage of createPointerType

6 years agorustllvm: use LLVMMetadataRef
Tim Neumann [Fri, 21 Jul 2017 11:15:36 +0000 (13:15 +0200)]
rustllvm: use LLVMMetadataRef

6 years agorustllvm: define LLVM_VERSION_LT
Tim Neumann [Fri, 21 Jul 2017 11:13:37 +0000 (13:13 +0200)]
rustllvm: define LLVM_VERSION_LT

6 years agoAuto merge of #43270 - petrochenkov:fixstab, r=alexcrichton
bors [Thu, 20 Jul 2017 09:01:58 +0000 (09:01 +0000)]
Auto merge of #43270 - petrochenkov:fixstab, r=alexcrichton

Fix checking for missing stability annotations

This was a regression from https://github.com/rust-lang/rust/pull/37676 causing "unmarked API" ICEs like https://github.com/rust-lang/rust/issues/43027.

r? @alexcrichton

6 years agoAuto merge of #43260 - zackmdavis:print_target_spec_json_unstable_options_error,...
bors [Thu, 20 Jul 2017 06:38:41 +0000 (06:38 +0000)]
Auto merge of #43260 - zackmdavis:print_target_spec_json_unstable_options_error, r=arielb1

explanatory error on `--print target-spec-json` without unstable options

![unstable_target_spec](https://user-images.githubusercontent.com/1076988/28243342-9731a45c-697a-11e7-9852-bad7ca1802b7.png)

Resolves #41683.

6 years agoAuto merge of #43251 - gaurikholkar:span_reorder, r=nikomatsakis
bors [Thu, 20 Jul 2017 03:36:14 +0000 (03:36 +0000)]
Auto merge of #43251 - gaurikholkar:span_reorder, r=nikomatsakis

Reorder span suggestions to appear below main labels

A fix to #41698

r? @nikomatsakis

6 years agoAuto merge of #43247 - est31:master, r=alexcrichton
bors [Thu, 20 Jul 2017 00:11:40 +0000 (00:11 +0000)]
Auto merge of #43247 - est31:master, r=alexcrichton

Tidy: allow common lang+lib features

This allows changes to the Rust language that have both library
and language components share one feature gate.

The feature gates need to be "about the same change", so that both
library and language components must either be both unstable, or
both stable, and share the tracking issue.

Removes the ugly "proc_macro" exception added by #40939.

Closes #43089

6 years agoexplanatory error on `--print target-spec-json` without unstable options
Zack M. Davis [Sat, 15 Jul 2017 19:32:31 +0000 (12:32 -0700)]
explanatory error on `--print target-spec-json` without unstable options

Resolves #41683.

6 years agoAuto merge of #43178 - zackmdavis:some_suggestion, r=eddyb
bors [Wed, 19 Jul 2017 20:12:56 +0000 (20:12 +0000)]
Auto merge of #43178 - zackmdavis:some_suggestion, r=eddyb

suggest one-argument enum variant to fix type mismatch when applicable

Following @est31's [suggestion](https://github.com/rust-lang/rust/issues/42764#issuecomment-309680886).

![some_suggestion](https://user-images.githubusercontent.com/1076988/28101064-ee83f51e-667a-11e7-9e4f-d8f9eb2fb6c3.png)

Resolves #42764.

6 years agoAuto merge of #42859 - eddyb:const-size-and-align-of, r=nikomatsakis
bors [Wed, 19 Jul 2017 16:58:02 +0000 (16:58 +0000)]
Auto merge of #42859 - eddyb:const-size-and-align-of, r=nikomatsakis

Implement const fn {size,align}_of.

Fixes #34078.

r? @nikomatsakis

6 years agoAuto merge of #43333 - Mark-Simulacrum:appveyor-fix, r=alexcrichton
bors [Wed, 19 Jul 2017 14:01:45 +0000 (14:01 +0000)]
Auto merge of #43333 - Mark-Simulacrum:appveyor-fix, r=alexcrichton

Attempt to fix appveyor

This will fix the problem, I think, but I don't know that this is a good idea (potentially leaving ourselves open to attackers, I guess, if a cert was revoked...). Of course, it may not. I don't actually have windows to check on..

r? @alexcrichton

6 years agoAttempt to fix appveyor
Mark Simulacrum [Wed, 19 Jul 2017 12:57:56 +0000 (06:57 -0600)]
Attempt to fix appveyor

6 years agoImplement const fn {size,align}_of.
Eduard-Mihai Burtescu [Fri, 23 Jun 2017 14:48:29 +0000 (17:48 +0300)]
Implement const fn {size,align}_of.

6 years agoAuto merge of #43170 - kyrias:full-relro, r=alexcrichton
bors [Wed, 19 Jul 2017 05:39:14 +0000 (05:39 +0000)]
Auto merge of #43170 - kyrias:full-relro, r=alexcrichton

Add support for full RELRO

This commit adds support for full RELRO, and enables it for the
platforms I know have support for it.

Full RELRO makes the PLT+GOT data read-only on startup, preventing it
from being overwritten.

http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Fixes rust-lang/rust#29877.

---

I'm not entirely certain if this is the best way to do it, but I figured mimicking the way it's done for PIE seemed like a good start at least.  I'm not sure whether we want to have it enabled by default globally and then disabling it explicitly for targets that don't support it though.  I'm also not sure whether the `full_relro` function should call `bug!()` or something like it for linkers that don't support it rather than no-opping.

6 years agoAuto merge of #43168 - pnkfelix:check-attr-gating, r=aturon
bors [Wed, 19 Jul 2017 03:06:21 +0000 (03:06 +0000)]
Auto merge of #43168 - pnkfelix:check-attr-gating, r=aturon

Slew of builtin-attribute gating tests

Slew of builtin-attribute "gating" tests for issue #43106.

Some stray observations:

 * I don't know if its a good thing that so many attributes allow inputs which are silently discarded. (I  made heavy use of that in writing my tests, but that was more out of curiosity than necessity.)
 * The difference between crate-level and non-crate-level behavior is quite significant in some cases. Definitely worth making sure one has tests for both cases. (Not as clear whether it was worthwhile trying the various other AST forms like `fn f()` vs `struct S;`)
 * `#[no_builtins]` and `#[no_mangle]` occur twice on the `BUILTIN_ATTRIBUTES` list. Thats almost certainly a bug. (Filed as #43148)
 * We are maximally liberal in what we allow for `#[test]` and `#[bench]` when one compiles without `--test`.
 * We allow `#[no_mangle]` on arbitrary AST nodes, but only warn about potential misuse on `fn`
 * We allow `#[cold]`, `#[must_use]`, `#[windows_subsystem]`, and `#[no_builtins]` on arbitrary AST nodes. I don't know off-hand what the semantics are for e.g. a `#[cold] type T = ...;`
 * We allow crate-level `#![inline]`. That's probably a bug since its otherwise restricted to `fn` items

6 years agoAuto merge of #40989 - matklad:comma-arms, r=petrochenkov
bors [Wed, 19 Jul 2017 00:35:33 +0000 (00:35 +0000)]
Auto merge of #40989 - matklad:comma-arms, r=petrochenkov

Unify rules about commas in match arms and semicolons in expressions

Original discussion: https://internals.rust-lang.org/t/syntax-of-block-like-expressions-in-match-arms/5025/7.

Currently, rust uses different rules to determine if `,` is needed after an expression in a match arm and if `;` is needed in an expression statement:

```Rust
fn stmt() {
    # no need for semicolons
    { () }
    if true { () } else { () }
    loop {}
    while true {}
}

fn match_arm(n: i32) {
    match n {
        1 => { () } # can omit comma here
        2 => if true { () } else { () }, # but all other cases do need commas.
        3 => loop { },
        4 => while true {},
        _ => ()
    }
}
```

This seems weird: why would you want to require `,` after and `if`?

This PR unifies the rules. It is backwards compatible because it allows strictly more programs.

6 years agoAuto merge of #43316 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Tue, 18 Jul 2017 21:59:01 +0000 (21:59 +0000)]
Auto merge of #43316 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 11 pull requests

- Successful merges: #42837, #43282, #43287, #43290, #43292, #43294, #43304, #43310, #43312, #43314, #43315
- Failed merges:

6 years agoRollup merge of #43315 - est31:stabilize_float_bits_conv, r=alexcrichton
Mark Simulacrum [Tue, 18 Jul 2017 15:41:38 +0000 (09:41 -0600)]
Rollup merge of #43315 - est31:stabilize_float_bits_conv, r=alexcrichton

float_bits_conv made it into 1.20

It seems that my PR to stabilize the `float_bits_conv` feature got merged before beta branched, which means I'm lucky, and the stabilization makes it into Rust 1.20. As it was against my expectations, the version number has to be corrected from 1.21 to 1.20.

Please also apply this PR to the beta branch.

6 years agoRollup merge of #43314 - alexcrichton:fail-curl, r=aidanhs
Mark Simulacrum [Tue, 18 Jul 2017 15:41:37 +0000 (09:41 -0600)]
Rollup merge of #43314 - alexcrichton:fail-curl, r=aidanhs

travis: Switch `curl -s` to `curl -f`

I seem to have been a little too tired when I fixed up the container scripts,
applying the wrong flag!

6 years agoRollup merge of #43312 - lu-zero:master, r=alexcrichton
Mark Simulacrum [Tue, 18 Jul 2017 15:41:36 +0000 (09:41 -0600)]
Rollup merge of #43312 - lu-zero:master, r=alexcrichton

powerpc: Ignore the stack-probes test

One little step further to have the test working fine on power8 :)

6 years agoRollup merge of #43310 - lynn:rc-weak-doc-fix, r=apasel422
Mark Simulacrum [Tue, 18 Jul 2017 15:41:35 +0000 (09:41 -0600)]
Rollup merge of #43310 - lynn:rc-weak-doc-fix, r=apasel422

Fix erroneous reference to Arc instead of Rc in rc::Weak documentation

The docs for `rc::Weak` refer to `Arc` in one place, where they should obviously be referring to `Rc`; presumably this was erroneously copied over from the `arc::Weak` docs.

6 years agoRollup merge of #43304 - ids1024:path2, r=aturon
Mark Simulacrum [Tue, 18 Jul 2017 15:41:34 +0000 (09:41 -0600)]
Rollup merge of #43304 - ids1024:path2, r=aturon

redox: handle multiple paths in PATH

6 years agoRollup merge of #43294 - insaneinside:std-time-duration-docs, r=aturon
Mark Simulacrum [Tue, 18 Jul 2017 15:41:33 +0000 (09:41 -0600)]
Rollup merge of #43294 - insaneinside:std-time-duration-docs, r=aturon

`std::time::Duration`: improve _precision_ of terminology in docs

Changed wording of docs on `std::time::Duration` for better clarity w.r.t. the contents of the type and the purpose of its methods.  (Specifically, removed the use of the word "precision" to describe the fractional part of the `Duration` because "precision" is more properly used to describe how _precise_ a value is, i.e. its granularity in this case.)

6 years agoRollup merge of #43292 - kennytm:fix-quasi-quoting-warning-in-rustbuild, r=alexcrichton
Mark Simulacrum [Tue, 18 Jul 2017 15:41:32 +0000 (09:41 -0600)]
Rollup merge of #43292 - kennytm:fix-quasi-quoting-warning-in-rustbuild, r=alexcrichton

Workaround "Quasi-quoting is inefficient" warning in incremental rustbuild introduced in #43252.

After #43252 is merged, building stage0 libcore with `-i` (`--incremental`) flag will cause 17 "Quasi-quoting might make incremental compilation very inefficient: NtExpr(..)" warnings, as in #40946.

```
warning: Quasi-quoting might make incremental compilation very inefficient: NtExpr(..)
   --> src/libcore/default.rs:133:21
    |
133 |             #[doc = $doc]
    |                     ^^^^
...
139 | default_impl! { (), (), "Returns the default value of `()`" }
    | ------------------------------------------------------------- in this macro invocation
(× 17)
```

True fix for #40946 will take at least 12 weeks from now to make into the next stage0, so it is quicker to workaround it in libcore instead.

cc @vbrandl @jseyfried

6 years agoRollup merge of #43290 - nodakai:fix-ref-path-new, r=Mark-Simulacrum
Mark Simulacrum [Tue, 18 Jul 2017 15:41:32 +0000 (09:41 -0600)]
Rollup merge of #43290 - nodakai:fix-ref-path-new, r=Mark-Simulacrum

libstd: remove redundant & from &Path::new(...)

```rust
fn Path::new<S: AsRef ...>(s: &S) -> &Path
```

* https://doc.rust-lang.org/std/path/struct.Path.html#method.new

6 years agoRollup merge of #43287 - kennytm:travis-ci-adjustments, r=alexcrichton
Mark Simulacrum [Tue, 18 Jul 2017 15:41:31 +0000 (09:41 -0600)]
Rollup merge of #43287 - kennytm:travis-ci-adjustments, r=alexcrichton

Change Travis CI job order.

Reorder the job matrix to take advantage of the order how Travis CI starts them in rust-lang/rust. Plus other refactoring of `.travis.yml`.

1. Move the `$ALLOW_PR` image to the top, so pull requests will start testing as immediately after the build is started. Previously the `$ALLOW_PR` image starts 6 minutes after the build was scheduled.

2. Move the slow macOS images near the top, so they share more time with the rest of the faster Linux builds, which should shorten total test time (actually not much, about 7 minutes at most if this change does work).

3. Merged the `install` section of both Linux and macOS to make the `env:` section a bit shorter, and enable change 4 below.

4. Do not download or install anything if `$SKIP_BUILD == true`, which further reduces chance of spurious failure in the PR-CI stage (avoid the red cross appearing even if CI passed).

(IMO `$SKIP_BUILD` should not even exist: those irrelevant jobs should not start at all, but that would require travis-ci/travis-ci#2778 which has been rejected)

6 years agoRollup merge of #43282 - feadoor:patch-1, r=nikomatsakis
Mark Simulacrum [Tue, 18 Jul 2017 15:41:30 +0000 (09:41 -0600)]
Rollup merge of #43282 - feadoor:patch-1, r=nikomatsakis

Update merge queue link in CONTRIBUTING.md

6 years agoRollup merge of #42837 - rthomas:29355-error, r=steveklabnik
Mark Simulacrum [Tue, 18 Jul 2017 15:41:29 +0000 (09:41 -0600)]
Rollup merge of #42837 - rthomas:29355-error, r=steveklabnik

Update docs on Error struct. #29355

This adds a pretty contrived example of the usage of fmt::Error. I am
very open to suggestions for a better one.

I have also highlighted the fmt::Error vs std::error::Error.

r? @steveklabnik

6 years agotravis: Switch `curl -s` to `curl -f`
Alex Crichton [Tue, 18 Jul 2017 14:42:32 +0000 (07:42 -0700)]
travis: Switch `curl -s` to `curl -f`

I seem to have been a little too tired when I fixed up the container scripts,
applying the wrong flag!

6 years agoIgnore pretty-test
Aleksey Kladov [Tue, 18 Jul 2017 12:21:18 +0000 (15:21 +0300)]
Ignore pretty-test

6 years agoAuto merge of #42492 - petrochenkov:methlife, r=nikomatsakis
bors [Tue, 18 Jul 2017 10:20:13 +0000 (10:20 +0000)]
Auto merge of #42492 - petrochenkov:methlife, r=nikomatsakis

Support generic lifetime arguments in method calls

Fixes https://github.com/rust-lang/rust/issues/42403
Fixes https://github.com/rust-lang/rust/issues/42115
Lifetimes in a method call `x.f::<'a, 'b, T, U>()` are treated exactly like lifetimes in the equivalent UFCS call `X::f::<'a, 'b, T, U>`.
In addition, if the method has late bound lifetime parameters (explicit or implicit), then explicitly specifying lifetime arguments is not permitted (guarded by a compatibility lint).
[breaking-change] because previously lifetimes in method calls were accepted unconditionally.

r? @eddyb

6 years agoFix erroneous reference to Arc instead of Rc
Lynn [Tue, 18 Jul 2017 09:31:07 +0000 (11:31 +0200)]
Fix erroneous reference to Arc instead of Rc

6 years agopowerpc: Ignore the stack-probes test
Luca Barbato [Tue, 18 Jul 2017 08:50:58 +0000 (08:50 +0000)]
powerpc: Ignore the stack-probes test

6 years agoChange Travis CI job order.
kennytm [Sat, 15 Jul 2017 16:10:26 +0000 (00:10 +0800)]
Change Travis CI job order.

Reorder the job matrix to take advantage of the order how Travis CI starts
them in rust-lang/rust. Plus other refactoring of `.travis.yml`.

1. Move the `$ALLOW_PR` image to the top, so users' PRs will start testing
   immediately. Previously the `$ALLOW_PR` image starts 6 minutes after the
   build was scheduled.

2. Move the slow macOS images near the top, so they share more time with
   the rest of the faster Linux builds, which should shorten total test
   time (actually not much, about 7 minutes at most if this change does
   work).

3. Merged the `install` section of both Linux and macOS to make the `env:`
   section a bit shorter, and enable change 4 below.

4. Do not download or install anything if `$SKIP_BUILD == true`, which
   further reduces chance of spurious failure in the PR-CI stage (avoid the
   red cross appearing even if CI passed).

6 years agoAuto merge of #43293 - alexcrichton:fail-curl, r=Mark-Simulacrum
bors [Tue, 18 Jul 2017 04:36:12 +0000 (04:36 +0000)]
Auto merge of #43293 - alexcrichton:fail-curl, r=Mark-Simulacrum

travis: Make a few `curl` invocations more resilient

Use the `-f` flag to indicate that, for example, a 500 response code is to be
considered a failure, triggering the normal retry logic. Also ignore errors
where we check the date from google.com, as a failure there shouldn't fail the
build.

6 years agofloat_bits_conv made it into 1.20
est31 [Tue, 18 Jul 2017 03:16:46 +0000 (05:16 +0200)]
float_bits_conv made it into 1.20

6 years agotravis: Make a few `curl` invocations more resilient
Alex Crichton [Mon, 17 Jul 2017 17:55:27 +0000 (10:55 -0700)]
travis: Make a few `curl` invocations more resilient

Use the `-f` flag to indicate that, for example, a 500 response code is to be
considered a failure, triggering the normal retry logic. Also ignore errors
where we check the date from google.com, as a failure there shouldn't fail the
build.

6 years agoredox: handle multiple paths in PATH
Ian Douglas Scott [Tue, 18 Jul 2017 01:37:54 +0000 (18:37 -0700)]
redox: handle multiple paths in PATH

6 years agoCatch expression does not require semicolon to be a statement
Aleksey Kladov [Sat, 1 Apr 2017 15:11:17 +0000 (18:11 +0300)]
Catch expression does not require semicolon to be a statement

6 years agoUnify rules about commas in match arms and semicolons in expressions
Aleksey Kladov [Sat, 1 Apr 2017 08:11:31 +0000 (11:11 +0300)]
Unify rules about commas in match arms and semicolons in expressions

6 years agoImplement FromStr for RelroLevel rather than duplicating the match
Johannes Löthberg [Mon, 17 Jul 2017 23:27:55 +0000 (01:27 +0200)]
Implement FromStr for RelroLevel rather than duplicating the match

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
6 years agoMove relro_level from CodegenOptions to DebuggingOptions
Johannes Löthberg [Mon, 17 Jul 2017 22:18:00 +0000 (00:18 +0200)]
Move relro_level from CodegenOptions to DebuggingOptions

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
6 years agoMake `late_bound_lifetime_arguments` lint warn-by-default
Vadim Petrochenkov [Mon, 17 Jul 2017 21:33:44 +0000 (00:33 +0300)]
Make `late_bound_lifetime_arguments` lint warn-by-default

6 years agoFix incorrect subst index
Vadim Petrochenkov [Tue, 11 Jul 2017 20:12:06 +0000 (23:12 +0300)]
Fix incorrect subst index

Fix treatment of lifetimes defined in nested types during detection of late bound regions in signatures.
Do not replace substs with inference variables when "cannot specify lifetime arguments explicitly..." is reported as a lint.

6 years agoDetect implicitly defined late bound lifetime parameters as well
Vadim Petrochenkov [Sat, 24 Jun 2017 20:30:05 +0000 (23:30 +0300)]
Detect implicitly defined late bound lifetime parameters as well

6 years agoProhibit lifetime arguments in path segments with late bound lifetime parameters
Vadim Petrochenkov [Fri, 23 Jun 2017 21:56:25 +0000 (00:56 +0300)]
Prohibit lifetime arguments in path segments with late bound lifetime parameters

6 years agoSupport generic lifetime arguments in method calls
Vadim Petrochenkov [Tue, 6 Jun 2017 21:17:14 +0000 (00:17 +0300)]
Support generic lifetime arguments in method calls

6 years agoreorder span labels
gaurikholkar [Wed, 5 Jul 2017 16:58:22 +0000 (09:58 -0700)]
reorder span labels

6 years ago`std::time::Duration`: improve _precision_ of terminology in docs
Collin J. Sutton [Mon, 17 Jul 2017 18:08:55 +0000 (11:08 -0700)]
`std::time::Duration`: improve _precision_ of terminology in docs

Changed wording of docs on `std::time::Duration` for better clarity
w.r.t. the contents of the type and the purpose of its methods.

6 years agoFix "Quasi-quoting is inefficient" warning in incremental rustbuild.
kennytm [Mon, 17 Jul 2017 17:49:40 +0000 (01:49 +0800)]
Fix "Quasi-quoting is inefficient" warning in incremental rustbuild.

After #43252 is merged, building stage0 libcore with -i (--incremental)
flag will cause 17 "Quasi-quoting might make incremental compilation very
inefficient: NtExpr(..)" warnings, as in #40946.

Fixing the warning in #40946 will take 12 weeks from now to make into the
next stage0, so it is quicker to workaround it in libcore instead.

6 years agoAuto merge of #42711 - Firstyear:san-on-dylib, r=alexcrichton
bors [Mon, 17 Jul 2017 17:02:18 +0000 (17:02 +0000)]
Auto merge of #42711 - Firstyear:san-on-dylib, r=alexcrichton

Add support for dylibs with Address Sanitizer

Many applications use address sanitizer to assert correct behaviour of their programs. When using Rust with C, it's much more important to assert correct programs with tools like asan/lsan due to the unsafe nature of the access across an ffi boundary. However, previously only rust bin types could use asan. This posed a challenge for existing C applications that link or dlopen .so when the C application is compiled with asan.

This PR enables asan to be linked to the dylib and cdylib crate type. We alter the test to check the proc-macro crate does not work with -Z sanitizer=address. Finally, we add a test that compiles a shared object in rust, then another rust program links it and demonstrates a crash through the call to the library.

This PR is nearly complete, but I do require advice on the change to fix the -lasan that currently exists in the dylib test. This is required because the link statement is not being added correctly to the rustc build when -Z sanitizer=address is added (and I'm not 100% sure why)

Thanks,

6 years agolibstd: remove redundant & from &Path::new(...)
NODA, Kai [Mon, 17 Jul 2017 16:04:46 +0000 (00:04 +0800)]
libstd: remove redundant & from &Path::new(...)

fn Path::new<S: AsRef ...>(s: &S) -> &Path

Signed-off-by: NODA, Kai <nodakai@gmail.com>
6 years agoAuto merge of #43266 - feadoor:issue-43253-exclusive-range-warning, r=nikomatsakis
bors [Mon, 17 Jul 2017 13:31:37 +0000 (13:31 +0000)]
Auto merge of #43266 - feadoor:issue-43253-exclusive-range-warning, r=nikomatsakis

Fix `range_covered_by_constructor` for exclusive ranges.

This resolves #43253

6 years agoAuto merge of #42033 - oli-obk:suggestions, r=petrochenkov
bors [Mon, 17 Jul 2017 10:58:08 +0000 (10:58 +0000)]
Auto merge of #42033 - oli-obk:suggestions, r=petrochenkov

Change some notes into suggestions

r? @petrochenkov since you commented on the same edits in #39458

6 years agoUpdate merge queue link
Sam Cappleman-Lynes [Mon, 17 Jul 2017 10:57:26 +0000 (11:57 +0100)]
Update merge queue link

6 years agoMove resolve diagnostic instability to compile-fail
Oliver Schneider [Mon, 17 Jul 2017 08:16:08 +0000 (10:16 +0200)]
Move resolve diagnostic instability to compile-fail

The produced paths aren't stable between builds, since
reporting paths inside resolve, before resolve is finished
might produce paths resolved to type aliases instead of
the concrete type.

Compile-fail tests can match just parts of messages, so they
don't "suffer" from this issue.

This is just a workaround, the instability should be fixed
in the future.

6 years agoChange some helps to suggestions
Oliver Schneider [Tue, 16 May 2017 13:12:24 +0000 (15:12 +0200)]
Change some helps to suggestions

6 years agoMove some tests from compile-fail to ui
Oliver Schneider [Tue, 16 May 2017 13:11:34 +0000 (15:11 +0200)]
Move some tests from compile-fail to ui

6 years agoAuto merge of #42146 - nrc:rls-rust, r=alexcrichton
bors [Mon, 17 Jul 2017 05:25:48 +0000 (05:25 +0000)]
Auto merge of #42146 - nrc:rls-rust, r=alexcrichton

More Rust/RLS integration

r? @alexcrichton

cc https://github.com/rust-lang-nursery/rls/issues/310

closes #41199
closes #41197

6 years agoRun RLS tests
Nick Cameron [Fri, 30 Jun 2017 18:58:54 +0000 (06:58 +1200)]
Run RLS tests

6 years agoRemove exception from license check for strings.rs
Nick Cameron [Mon, 22 May 2017 02:08:31 +0000 (14:08 +1200)]
Remove exception from license check for strings.rs

6 years agoAuto merge of #43258 - petrochenkov:cbabort, r=alexcrichton
bors [Mon, 17 Jul 2017 03:03:19 +0000 (03:03 +0000)]
Auto merge of #43258 - petrochenkov:cbabort, r=alexcrichton

Compile `compiler_builtins` with `abort` panic strategy

A workaround for https://github.com/rust-lang/rust/issues/43095

In case this causes unexpected consequences, I use a simpler workaround locally:
```diff
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -175,7 +175,9 @@ fn main() {
         }

         if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
-            cmd.arg("-C").arg(format!("codegen-units={}", s));
+            if crate_name != "compiler_builtins" {
+                cmd.arg("-C").arg(format!("codegen-units={}", s));
+            }
         }

         // Emit save-analysis info.
```

r? @alexcrichton

6 years agoAuto merge of #43055 - est31:stabilize_float_bits_conv, r=sfackler
bors [Mon, 17 Jul 2017 00:19:43 +0000 (00:19 +0000)]
Auto merge of #43055 - est31:stabilize_float_bits_conv, r=sfackler

Stabilize float_bits_conv for Rust 1.21

Stabilizes the `float_bits_conv` lib feature for the 1.20 release of Rust. I've initially implemented the feature in #39271 and later made PR #43025 to output quiet NaNs even on platforms with different encodings, which seems to have been the only unresolved issue of the API.

Due to PR #43025 being only applied to master this stabilisation can't happen for Rust 1.19 through the usual "stabilisation on beta" system that is being done for library APIs.

r? @BurntSushi

closes #40470.

6 years agoFix checking for missing stability annotations
Vadim Petrochenkov [Sun, 16 Jul 2017 19:11:46 +0000 (22:11 +0300)]
Fix checking for missing stability annotations

Remove couple of unnecessary `#![feature(staged_api)]`.

6 years agoUpdate function name to reflect reality
Sam Cappleman-Lynes [Sun, 16 Jul 2017 17:05:03 +0000 (18:05 +0100)]
Update function name to reflect reality

6 years agoFix `range_covered_by_constructor` for exclusive ranges.
Sam Cappleman-Lynes [Sun, 16 Jul 2017 16:34:09 +0000 (17:34 +0100)]
Fix `range_covered_by_constructor` for exclusive ranges.

This resolves #43253

6 years agoAuto merge of #43237 - zackmdavis:missing_sum_and_product_for_128_bit_integers, r...
bors [Sun, 16 Jul 2017 12:42:56 +0000 (12:42 +0000)]
Auto merge of #43237 - zackmdavis:missing_sum_and_product_for_128_bit_integers, r=nagisa

add u128/i128 to sum/product implementors

Resolves #43235.

6 years agoAuto merge of #43252 - vbrandl:doc/default-values, r=GuillaumeGomez
bors [Sun, 16 Jul 2017 10:22:00 +0000 (10:22 +0000)]
Auto merge of #43252 - vbrandl:doc/default-values, r=GuillaumeGomez

Document default values for primitive types

All primitive types implement the `Default` trait but the documentation just says `Returns the "default value" for a type.` and doesn't give a hint about the actual default value. I think it would be good to document the default values in a proper way.
I changed the `default_impl` macro to accept a doc string as a third parameter and use this string to overwrite the documentation of `default()` for each primitive type.
The generated documentation now looks like this:
![Documentation of default() on the bool primitive](https://i.imgur.com/nK6TApo.png)

6 years agoCompile `compiler_builtins` with `abort` panic strategy
Vadim Petrochenkov [Sat, 15 Jul 2017 23:02:34 +0000 (02:02 +0300)]
Compile `compiler_builtins` with `abort` panic strategy

6 years agopath, not name, in sole-argument variant type mismatch suggestion
Zack M. Davis [Sat, 15 Jul 2017 17:26:11 +0000 (10:26 -0700)]
path, not name, in sole-argument variant type mismatch suggestion

We want the suggested replacement (which IDE tooling and such might offer to
automatically swap in) to, like, actually be correct: suggesting `MyVariant(x)`
when the actual fix is `MyEnum::MyVariant(x)` might be better than nothing, but
Rust is supposed to be the future of computing: we're better than better than
nothing.

As an exceptional case, we excise the prelude path, preferring to suggest
`Some` or `Ok` rather than `std::prelude::v1::Some` and
`std::prelude::v2::Ok`. (It's not worth the effort to future-proof against
hypothetical preludes v2, v3, &c.: we trust our successors to grep—excuse me,
ripgrep—for that.)

Also, don't make this preëmpt the existing probe-for-return-type suggestions,
despite their being looked unfavorably upon, at least in this situation
(https://github.com/rust-lang/rust/issues/42764#issuecomment-311388958): Cody
Schafer pointed out that that's a separate issue
(https://github.com/rust-lang/rust/pull/43178#issuecomment-314953229).

This is in the matter of #42764.

6 years agoAuto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrc
bors [Sat, 15 Jul 2017 19:12:03 +0000 (19:12 +0000)]
Auto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrc

macros: fix regression involving identifiers in `macro_rules!` patterns.

Fixes #42019.
r? @nrc

6 years agoRephrase the doc string
Valentin Brandl [Sat, 15 Jul 2017 15:34:37 +0000 (17:34 +0200)]
Rephrase the doc string

6 years agoAuto merge of #43246 - frewsxcv:rollup, r=frewsxcv
bors [Sat, 15 Jul 2017 14:51:02 +0000 (14:51 +0000)]
Auto merge of #43246 - frewsxcv:rollup, r=frewsxcv

Rollup of 8 pull requests

- Successful merges: #43074, #43145, #43159, #43202, #43222, #43228, #43229, #43240
- Failed merges:

6 years agoDocument default values for primitive types
Valentin Brandl [Sat, 15 Jul 2017 13:35:03 +0000 (15:35 +0200)]
Document default values for primitive types

6 years agoAuto merge of #43207 - alexcrichton:update-cargo, r=nikomatsakis
bors [Sat, 15 Jul 2017 11:02:35 +0000 (11:02 +0000)]
Auto merge of #43207 - alexcrichton:update-cargo, r=nikomatsakis

Update the `cargo` submodule

Notably pull in an update to the `jobserver` crate to have Cargo set the
`CARGO_MAKEFLAGS` environment variable instead of the `MAKEFLAGS` environment
variable.

cc https://github.com/rust-lang/rust/issues/42635

6 years agoAuto merge of #43179 - oli-obk:mark_all_the_expansions, r=jseyfried
bors [Sat, 15 Jul 2017 08:36:27 +0000 (08:36 +0000)]
Auto merge of #43179 - oli-obk:mark_all_the_expansions, r=jseyfried

Reintroduce expansion info for proc macros 1.1

r? @jseyfried

6 years agoAuto merge of #43185 - durka:thread-local-pub-restricted, r=alexcrichton
bors [Sat, 15 Jul 2017 06:14:11 +0000 (06:14 +0000)]
Auto merge of #43185 - durka:thread-local-pub-restricted, r=alexcrichton

support pub(restricted) in thread_local! (round 2)

Resurrected #40984 now that the issue blocking it was fixed. Original description:

`pub(restricted)` was stabilized in #40556 so let's go!

Here is a [playground](https://play.rust-lang.org/?gist=f55f32f164a6ed18c219fec8f8293b98&version=nightly&backtrace=1).

I changed the interface of `__thread_local_inner!`, which is supposedly unstable but this is not checked for macros (#34097 cc @petrochenkov @jseyfried), so this may be an issue.

6 years agoRollup merge of #43240 - steveklabnik:update-books, r=QuietMisdreavus
Corey Farwell [Sat, 15 Jul 2017 03:57:19 +0000 (20:57 -0700)]
Rollup merge of #43240 - steveklabnik:update-books, r=QuietMisdreavus

Update the books.

`python x.py test src\doc` passes on my machine.

6 years agoRollup merge of #43229 - kennytm:return-false-if-path-is-relative-hahaha, r=steveklabnik
Corey Farwell [Sat, 15 Jul 2017 03:57:19 +0000 (20:57 -0700)]
Rollup merge of #43229 - kennytm:return-false-if-path-is-relative-hahaha, r=steveklabnik

Fix minor typo in std::path documentation.

Fix minor typo in `std::path` documentation.

Replace all `'C' as u8` with `b'C'`.

6 years agoRollup merge of #43228 - redox-os:backtrace_fix, r=alexcrichton
Corey Farwell [Sat, 15 Jul 2017 03:57:18 +0000 (20:57 -0700)]
Rollup merge of #43228 - redox-os:backtrace_fix, r=alexcrichton

Fix backtrace on Redox

This fixes sys::backtrace on Redox

6 years agoRollup merge of #43222 - RalfJung:symlink, r=sfackler
Corey Farwell [Sat, 15 Jul 2017 03:57:17 +0000 (20:57 -0700)]
Rollup merge of #43222 - RalfJung:symlink, r=sfackler

windows::fs::symlink_dir: fix example to actually use symlink_dir

I don't have a windows machine, so I couldn't test if this doctest still works -- but it looks trivial enough. (I know, famous last words.)

6 years agoRollup merge of #43202 - jackpot51:patch-1, r=sfackler
Corey Farwell [Sat, 15 Jul 2017 03:57:16 +0000 (20:57 -0700)]
Rollup merge of #43202 - jackpot51:patch-1, r=sfackler

Fix sys::redox::net::tcp

A change to the upper level API needed to be filtered down

6 years agoRollup merge of #43159 - cuviper:ptr-swap-simd, r=arielb1
Corey Farwell [Sat, 15 Jul 2017 03:57:15 +0000 (20:57 -0700)]
Rollup merge of #43159 - cuviper:ptr-swap-simd, r=arielb1

Disable big-endian simd in swap_nonoverlapping_bytes

This is a workaround for #42778, which was git-bisected to #40454's
optimizations to `mem::swap`, later moved to `ptr` in #42819.  Natively
compiled rustc couldn't even compile stage1 libcore on powerpc64 and
s390x, but they work fine without this `repr(simd)`.  Since powerpc64le
works OK, it seems probably related to being big-endian.

The underlying problem is not yet known, but this at least makes those
architectures functional again in the meantime.

cc @arielb1

6 years agoRollup merge of #43145 - GuillaumeGomez:build-error-if-nothing, r=Mark-Simulacrum
Corey Farwell [Sat, 15 Jul 2017 03:57:14 +0000 (20:57 -0700)]
Rollup merge of #43145 - GuillaumeGomez:build-error-if-nothing, r=Mark-Simulacrum

fail in case nothing to run was found

Fixes #43121.

r? @Mark-Simulacrum

6 years agoRollup merge of #43074 - SimonSapin:iter, r=aturon
Corey Farwell [Sat, 15 Jul 2017 03:57:13 +0000 (20:57 -0700)]
Rollup merge of #43074 - SimonSapin:iter, r=aturon

Forward more Iterator methods

This allows in more cases to take advantage of specific (possibly more optimized) impls of these methods, rather than the default one defined for all `Iterator`s.

I also wanted to do this for `&mut I` and `Box<I>`, but that didn’t compile for two reasons:

* To make the trait object-safe, generic methods (e.g. that take a closure parameter) have a `where Self: Sized` bound. But e.g. `Box<I>: Sized` does not imply `I: Sized`, and adding an additional bound in the impl is not allowed. Some for of specialization would be needed here.
* With e.g. a `F: FnMut(Self::Item) -> bool` bound and a `type Item = I::Item` associated types, I got errors like `F does not implement FnMut(I::Item) -> bool`. This looks like a limitation in the trait resolution system not recognizing that `Self::Item == I::Item` or "propagating" that fact to `FnMut` bounds.

6 years agoTidy: allow common lang+lib features
est31 [Sat, 15 Jul 2017 03:53:58 +0000 (05:53 +0200)]
Tidy: allow common lang+lib features

This allows changes to the Rust language that have both library
and language components share one feature gate.

The feature gates need to be "about the same change", so that both
library and language components must either be both unstable, or
both stable, and share the tracking issue.

Removes the ugly "proc_macro" exception.

Closes #43089

6 years agoAuto merge of #43184 - nikomatsakis:incr-comp-anonymize-trait-selection, r=michaelwoe...
bors [Sat, 15 Jul 2017 02:22:11 +0000 (02:22 +0000)]
Auto merge of #43184 - nikomatsakis:incr-comp-anonymize-trait-selection, r=michaelwoerister

integrate anon dep nodes into trait selection

Use anonymous nodes for trait selection. In all cases, we use the same basic "memoization" strategy:

- Store the `DepNodeIndex` in the slot along with value.
- If value is present, return it, and add a read of the dep-node-index.
- Else, start an anonymous task, and store resulting node.

We apply this strategy to a number of caches in trait selection:

- The "trans" caches of selection and projection
- The "evaluation" cache
- The "candidate selection" cache

In general, for our cache strategy to be "dep-correct", the computation of the value is permitted to rely on the *value in the key* but nothing else. The basic argument is this: in order to look something up, you have to produce the key, and to do that you must have whatever reads were needed to create the key. Then, you get whatever reads were further needed to produce the value. But if the "closure" that produced the value made use of *other* environmental data, not derivable from the key, that would be bad -- but that would **also** suggest that the cache is messed up (though it's not proof).

The structure of these caches do not obviously prove that the correctness criteria are met, and I aim to address that in further refactorings. But I *believe* it to be the case that, if we assume that the existing caches are correct, there are also no dependency failures (in other words, if there's a bug, it's a pre-existing one). Specifically:

- The trans caches: these take as input just a `tcx`, which is "by definition" not leaky, the `trait-ref` etc, which is part of the key, and sometimes a span (doesn't influence the result). So they seem fine.
- The evaluation cache:
    - This computation takes as input the "stack" and has access to the infcx.
    - The infcx is a problem -- would be better to take the tcx -- and this is exactly one of the things I plan to improve in later PRs. Let's ignore it for now. =)
    - The stack itself is also not great, in that the *key* only consists of the top-entry in the stack.
    - However, the stack can cause a problem in two ways:
        - overflow (we panic)
        - cycle check fails (we do not update the cache, I believe)
- The candidate selection cache:
    - as before, takes the "stack" and has access to the infcx.
    - here it is not as obvious that we avoid caching stack-dependent computations. However, to the extent that we do, this is a pre-existing bug, in that we are making cache entries we shouldn't.
    - I aim to resolve this by -- following the chalk-style of evaluation -- merging candidate selection and evaluation.
    - The infcx is a problem -- would be better to take the tcx -- and this is exactly one of the things I plan to improve in later PRs. Let's ignore it for now. =)
    - The stack itself is also not great, in that the *key* only consists of the top-entry in the stack.
    - Moreover, the stack would generally just introduce ambiguities and errors anyhow, so that lessens the risk.

Anyway, the existing approach to handle dependencies in the trait code carries the same risks or worse, so this seems like a strict improvement!

r? @michaelwoerister

cc @arielb1

6 years agoAuto merge of #43174 - RalfJung:refactor-ty, r=nikomatsakis
bors [Fri, 14 Jul 2017 23:29:51 +0000 (23:29 +0000)]
Auto merge of #43174 - RalfJung:refactor-ty, r=nikomatsakis

Refactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir

I am writing code that needs to call these `ty` methods while mutating MIR -- which is impossible with the current API.

Even with the refactoring the situation is not great: I am cloning the `local_decls` and then passing the clone to the `ty` methods. I have to clone because `Mir::basic_blocks_mut` borrows the entire `Mir` including the `local_decls`. But even that is better than not being able to get these types at all...

Cc @nikomatsakis

6 years agoAdd support for dylibs with Address Sanitizer. This supports cdylibs and staticlibs...
William Brown [Sat, 17 Jun 2017 03:42:56 +0000 (13:42 +1000)]
Add support for dylibs with Address Sanitizer. This supports cdylibs and staticlibs on gnu-linux targets.

6 years agoMake partial RELRO default on ppc64 due to segfault
Johannes Löthberg [Fri, 14 Jul 2017 20:06:36 +0000 (22:06 +0200)]
Make partial RELRO default on ppc64 due to segfault

On at least RHEL6 there is a segfault caused by the older ld.so version
when BIND_NOW is used, so use partial RELRO by default on ppc64
architectures for now.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
6 years agoSupport both partial and full RELRO
Johannes Löthberg [Fri, 14 Jul 2017 20:01:37 +0000 (22:01 +0200)]
Support both partial and full RELRO

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
6 years agoAuto merge of #43180 - oli-obk:compiletest, r=alexcrichton
bors [Fri, 14 Jul 2017 19:35:37 +0000 (19:35 +0000)]
Auto merge of #43180 - oli-obk:compiletest, r=alexcrichton

Reduce the usage of features in compiletest and libtest

6 years agoadd u128/i128 to sum/product implementors
Zack M. Davis [Fri, 14 Jul 2017 15:50:22 +0000 (08:50 -0700)]
add u128/i128 to sum/product implementors

Resolves #43235.

6 years agoUpdate the books.
steveklabnik [Fri, 14 Jul 2017 17:33:19 +0000 (13:33 -0400)]
Update the books.

6 years agoAuto merge of #43175 - tlively:wasm-split-bots, r=alexcrichton
bors [Fri, 14 Jul 2017 13:14:18 +0000 (13:14 +0000)]
Auto merge of #43175 - tlively:wasm-split-bots, r=alexcrichton

Split old and experimental wasm builders

#42784 introduced configuration errors in the wasm builder by mixing different versions of the tools. This PR separates the wasm32-unknown-emscripten and wasm32-experimental-emscripten builders to resolve these errors.

6 years agoAuto merge of #43026 - arielb1:llvm-next, r=alexcrichton
bors [Fri, 14 Jul 2017 09:54:13 +0000 (09:54 +0000)]
Auto merge of #43026 - arielb1:llvm-next, r=alexcrichton

[LLVM] Avoid losing the !nonnull attribute in SROA

Fixes #37945.

r? @alexcrichton

6 years agoFix backtrace on Redox
Jeremy Soller [Fri, 14 Jul 2017 02:07:37 +0000 (20:07 -0600)]
Fix backtrace on Redox

6 years agoFix minor typo in std::path documentation.
kennytm [Fri, 14 Jul 2017 01:55:39 +0000 (09:55 +0800)]
Fix minor typo in std::path documentation.

Replace all `'C' as u8` with `b'C'`.

6 years agoAuto merge of #43216 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 14 Jul 2017 00:50:33 +0000 (00:50 +0000)]
Auto merge of #43216 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #42926, #43125, #43157, #43167, #43187, #43203, #43204
- Failed merges: