]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #39218 - xen0n:syntax-warts, r=alexcrichton
bors [Sat, 21 Jan 2017 22:07:14 +0000 (22:07 +0000)]
Auto merge of #39218 - xen0n:syntax-warts, r=alexcrichton

syntax: remove abi::Os and abi::Architecture

They're long dead since the switch to flexible targets, but was not removed like their consumers were. Interesting they even got maintained by various porters out there!

Technically [syntax-breaking] as they're public API, but since they're unused in the compiler, the potential breakage IMO should be minimal.

7 years agoAuto merge of #39210 - GuillaumeGomez:GuillaumeGomez-patch-1, r=frewsxcv
bors [Sat, 21 Jan 2017 19:51:08 +0000 (19:51 +0000)]
Auto merge of #39210 - GuillaumeGomez:GuillaumeGomez-patch-1, r=frewsxcv

Specify the result of integer cast on boolean

Fixes #39190.

r? @frewsxcv

7 years agoAuto merge of #39203 - ranma42:doc_metadata, r=BurntSushi
bors [Sat, 21 Jan 2017 16:51:22 +0000 (16:51 +0000)]
Auto merge of #39203 - ranma42:doc_metadata, r=BurntSushi

Document that `Metadata` can be obtained from `symlink_metadata`

When retrieving the information about a syslink (specifically, when invoking `Metadata::is_symlink`) you generally want the `syslink_metadata`. It would be natural to point at both options to retrieve a `Metadata` value, as they are both appropriate (for different use cases).

7 years agoAuto merge of #39204 - ollie27:linkchecker_fragment, r=alexcrichton
bors [Sat, 21 Jan 2017 11:48:08 +0000 (11:48 +0000)]
Auto merge of #39204 - ollie27:linkchecker_fragment, r=alexcrichton

linkchecker: Fix checking links which are just fragments

Also fix a typo which linkchecker should have caught.

It was broken by 31a8638e5e716bec90f4398a57c58fb34e492667.

r? @alexcrichton

7 years agoSpecify the result of integer cast on boolean
Guillaume Gomez [Fri, 20 Jan 2017 21:32:12 +0000 (22:32 +0100)]
Specify the result of integer cast on boolean

7 years agoAuto merge of #39206 - MJDSys:fix_rustbuild_libdir, r=alexcrichton
bors [Sat, 21 Jan 2017 08:41:40 +0000 (08:41 +0000)]
Auto merge of #39206 - MJDSys:fix_rustbuild_libdir, r=alexcrichton

Fix rustbuild to work with --libdir.

Similar to the makefiles, pass CFG_LIBDIR_RELATIVE to cargo when building
rustc in stages > 0.  This tells rustc to check the different directory.

I'm not sure how you want this handled in the toml system (my distribution, Gentoo, uses configure still).  I have a feeling the system needs a rework anyways for rustbuild.  If there is some discussion that needs to happen, could you merge this in the mean time?  I'd be happy to help transition this to a better method.

7 years agosyntax: remove abi::Os and abi::Architecture
Wang Xuerui [Sat, 21 Jan 2017 07:05:41 +0000 (15:05 +0800)]
syntax: remove abi::Os and abi::Architecture

They're long dead since the switch to flexible targets, but was not
removed like their consumers were. Interesting they even got maintained
by various porters out there!

Technically [syntax-breaking] as they're public API, but since they're
unused in the compiler, the potential breakage IMO should be minimal.

7 years agoAuto merge of #39156 - GuillaumeGomez:debug_librand, r=alexcrichton
bors [Sat, 21 Jan 2017 05:44:21 +0000 (05:44 +0000)]
Auto merge of #39156 - GuillaumeGomez:debug_librand, r=alexcrichton

Add missing Debug implementation for librand structs

Part of #31869.

7 years agoAuto merge of #39086 - aidanhs:aphs-local-rebuild-no-jemalloc, r=alexcrichton
bors [Sat, 21 Jan 2017 03:26:37 +0000 (03:26 +0000)]
Auto merge of #39086 - aidanhs:aphs-local-rebuild-no-jemalloc, r=alexcrichton

Make rustbuild force_alloc_system rather than relying on stage0

This 'fixes' jemalloc-less local rebuilds, where we tell cargo that we're actually stage1 (this only fixes the rustbuild path, since I wasn't enthusiastic to dive into the makefiles).

There should be one effect from this PR: `--enable-local-rebuild --disable-jemalloc` will successfully build a stage0 std (rather than erroring). Ideally I think it'd be nice to specify an allocator preference in Cargo.toml/cargo command line (used when an allocator must be picked i.e. dylibs, not rlibs), but since that's not possible we can make do with a force_alloc_system feature. Sadly this locks you into a single allocator in the build libstd, making any eventual implementation of #38575 not quite right in this edge case, but clearly not many people exercise the combination of these two flags.

This PR is also a substitute for #37975 I think. The crucial difference is that the feature name here is distinct from the jemalloc feature (reused in the previous PR) - we don't want someone to be forced into alloc_system just for disabling jemalloc!

Fixes #39054

r? @alexcrichton

7 years agoAuto merge of #39199 - alexcrichton:rollup, r=alexcrichton
bors [Sat, 21 Jan 2017 00:56:18 +0000 (00:56 +0000)]
Auto merge of #39199 - alexcrichton:rollup, r=alexcrichton

Rollup of 28 pull requests

- Successful merges: #38603, #38761, #38842, #38847, #38955, #38966, #39062, #39068, #39077, #39111, #39112, #39114, #39118, #39120, #39132, #39135, #39138, #39142, #39143, #39146, #39157, #39166, #39167, #39168, #39179, #39184, #39195, #39197
- Failed merges: #39060, #39145

7 years agoappveyor: Don't test i586 MSVC binaries yet
Alex Crichton [Sat, 21 Jan 2017 00:31:36 +0000 (16:31 -0800)]
appveyor: Don't test i586 MSVC binaries yet

I was hoping

7 years agoMore test fixes from rollup
Alex Crichton [Fri, 20 Jan 2017 01:18:12 +0000 (17:18 -0800)]
More test fixes from rollup

7 years agoFix rustbuild to work with --libdir.
Matthew Dawson [Fri, 20 Jan 2017 14:22:16 +0000 (09:22 -0500)]
Fix rustbuild to work with --libdir.

Similar to the makefiles, pass CFG_LIBDIR_RELATIVE to cargo when building
rustc in stages > 0.  This tells rustc to check the different directory.

7 years agoMerge branch 'older-glibc' into rollup
Alex Crichton [Fri, 20 Jan 2017 16:36:50 +0000 (08:36 -0800)]
Merge branch 'older-glibc' into rollup

7 years agoTest fixes from the rollup
Alex Crichton [Fri, 20 Jan 2017 00:38:38 +0000 (16:38 -0800)]
Test fixes from the rollup

7 years agoRollup merge of #39197 - michaelwoerister:test-38942, r=alexcrichton
Alex Crichton [Thu, 19 Jan 2017 23:49:53 +0000 (15:49 -0800)]
Rollup merge of #39197 - michaelwoerister:test-38942, r=alexcrichton

Add regression test for issue #38942

Closes #38942.

Kudos to @pnkfelix and @nagisa, who did all the hard work of creating a reduced test case.

7 years agoRollup merge of #39195 - nagisa:deny-extra-requirement-in-impl, r=eddyb
Alex Crichton [Thu, 19 Jan 2017 23:49:51 +0000 (15:49 -0800)]
Rollup merge of #39195 - nagisa:deny-extra-requirement-in-impl, r=eddyb

Deny extra_requirement_in_impl forward-compat lint

Part of #37166

7 years agoRollup merge of #39184 - michaelwoerister:no-trans-items-for-meta-crates, r=eddyb
Alex Crichton [Thu, 19 Jan 2017 23:49:50 +0000 (15:49 -0800)]
Rollup merge of #39184 - michaelwoerister:no-trans-items-for-meta-crates, r=eddyb

trans: Exit earlier from base::trans_crate() when compiling rmeta crates.

Fixes https://github.com/rust-lang/rust/issues/38964.
r? @eddyb
cc @nrc

7 years agoRollup merge of #39179 - petrochenkov:objparen, r=eddyb
Alex Crichton [Thu, 19 Jan 2017 23:49:49 +0000 (15:49 -0800)]
Rollup merge of #39179 - petrochenkov:objparen, r=eddyb

Fix regression in parsing of trait object types

Fixes https://github.com/rust-lang/rust/issues/39169

Accepting parens in this position is a regression itself, introduced in Rust 1.6 by https://github.com/rust-lang/rust/pull/29870, so I hope to revert this in my next bounds refactoring patch (possibly with a warning,  crater run, etc).

r? @eddyb

7 years agoRollup merge of #39168 - estebank:multiline-candidate, r=petrochenkov
Alex Crichton [Thu, 19 Jan 2017 23:49:47 +0000 (15:49 -0800)]
Rollup merge of #39168 - estebank:multiline-candidate, r=petrochenkov

Use multiline Diagnostic for candidate in other module

```
error[E0574]: expected struct, variant or union type, found enum `Result`
  --> $DIR/issue-16058.rs:19:9
   |
19 |         Result {
   |         ^^^^^^ not a struct, variant or union type
   |
   = help: possible better candidates are found in other modules, you can import them into scope:
             `use std::fmt::Result;`
             `use std::io::Result;`
             `use std::thread::Result;`

error: aborting due to previous error
```

7 years agoRollup merge of #39167 - alexcrichton:no-more-sha, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:46 +0000 (15:49 -0800)]
Rollup merge of #39167 - alexcrichton:no-more-sha, r=brson

travis: Stop uploading sha256 files

We'll generate these later in the build process and otherwise they could just
cause spurious failures with files overwriting one another.

cc #38531

7 years agoRollup merge of #39166 - glandium:master, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:45 +0000 (15:49 -0800)]
Rollup merge of #39166 - glandium:master, r=brson

Update jemalloc to include various fixes for OSX 10.12

7 years agoRollup merge of #39157 - michaelwoerister:debug-lto, r=alexcrichton
Alex Crichton [Thu, 19 Jan 2017 23:49:43 +0000 (15:49 -0800)]
Rollup merge of #39157 - michaelwoerister:debug-lto, r=alexcrichton

Add regression test for debuginfo + LTO

Fixes #25270, which cannot be reproduced with the current nightly version of the compiler anymore (due to various fixes to debuginfo generation in the past).

Should we run into the "possible ODR violation" again, the test added by this PR can be extend with the new case.

r? @alexcrichton

7 years agoRollup merge of #39146 - alexcrichton:fix-osx-debug, r=michaelwoerister
Alex Crichton [Thu, 19 Jan 2017 23:49:42 +0000 (15:49 -0800)]
Rollup merge of #39146 - alexcrichton:fix-osx-debug, r=michaelwoerister

travis: Fix post-failure lldb invocation

Pass an absolute path, not just the basename.

7 years agoRollup merge of #39143 - nikomatsakis:issue-38967, r=eddyb
Alex Crichton [Thu, 19 Jan 2017 23:49:41 +0000 (15:49 -0800)]
Rollup merge of #39143 - nikomatsakis:issue-38967, r=eddyb

check inherent impls of traits for overlap as well

Simple oversight. Fixes #38967.

r? @eddyb

7 years agoRollup merge of #39142 - nikomatsakis:issue-38973, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:40 +0000 (15:49 -0800)]
Rollup merge of #39142 - nikomatsakis:issue-38973, r=brson

run rustdoc tests in the same sort of thread rustc runs in

Not sure yet if this is the problem in #38973 but seems like an improvement regardless.

r? @brson

7 years agoRollup merge of #39138 - gralpli:issue-39089, r=nrc
Alex Crichton [Thu, 19 Jan 2017 23:49:39 +0000 (15:49 -0800)]
Rollup merge of #39138 - gralpli:issue-39089, r=nrc

Fix ICE when compiling fn f<T: ?for<'a> Sized>() {}

Fixes issue #39089

7 years agoRollup merge of #39135 - TheCycoONE:vec_drain_doc, r=alexcrichton
Alex Crichton [Thu, 19 Jan 2017 23:49:38 +0000 (15:49 -0800)]
Rollup merge of #39135 - TheCycoONE:vec_drain_doc, r=alexcrichton

Clarify when range is removed by drain

Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.

7 years agoRollup merge of #39132 - alexcrichton:static-libstdcpp, r=japaric
Alex Crichton [Thu, 19 Jan 2017 23:49:37 +0000 (15:49 -0800)]
Rollup merge of #39132 - alexcrichton:static-libstdcpp, r=japaric

travis: Pass --enable-llvm-static-stdcpp

All our releases are compiled with this, so let's be sure to do so whenever
`DEPLOY` is set. This'll ensure that we don't have dynamic dependencies on
libstdc++ which LLVM depends on, but instead we link it all statically to have
more portable binaries.

7 years agoRollup merge of #39120 - alexcrichton:emscripten-tests, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:36 +0000 (15:49 -0800)]
Rollup merge of #39120 - alexcrichton:emscripten-tests, r=brson

travis: Get an emscripten builder online

This commit adds a new entry to the Travis matrix which will execute emscripten
test suites. Along the way it updates a few bits of the test suite to continue
passing on emscripten, such as:

* Ignoring i128/u128 tests as they're presumably just not working (didn't
  investigate as to why)
* Disabling a few process tests (not working on emscripten)
* Ignore some num tests in libstd (#39119)
* Fix some warnings when compiling

7 years agoRollup merge of #39118 - jseyfried:token_tree_based_parser, r=nrc
Alex Crichton [Thu, 19 Jan 2017 23:49:34 +0000 (15:49 -0800)]
Rollup merge of #39118 - jseyfried:token_tree_based_parser, r=nrc

Refactor the parser to consume token trees

This is groundwork for efficiently parsing attribute proc macro invocations, bang macro invocations, and `TokenStream`-based attributes and fragment matchers.

This improves parsing performance by 8-15% and expansion performance by 0-5% on a sampling of the compiler's crates.

r? @nrc

7 years agoRollup merge of #39114 - alexcrichton:fix-osx-image, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:33 +0000 (15:49 -0800)]
Rollup merge of #39114 - alexcrichton:fix-osx-image, r=brson

travis: Tweak OSX image configuration

Somewhere between https://travis-ci.org/rust-lang/rust/jobs/192352185 and
https://travis-ci.org/rust-lang/rust/jobs/192440181 it looks like our
configuration for a newer OSX image was lost as LLDB has reverted itself back to
350. This fix appeared to work for the libc crate so let's see if we can
configure it to work for the rust repo as well.

7 years agoRollup merge of #39112 - alexcrichton:i586-msvc, r=nikomatsakis
Alex Crichton [Thu, 19 Jan 2017 23:49:32 +0000 (15:49 -0800)]
Rollup merge of #39112 - alexcrichton:i586-msvc, r=nikomatsakis

appveyor: Test/Dist i586 MSVC

This is a target that we're shipping today, so this commit adds this matrix
entry to AppVeyor. This reuses the existing i686 MSVC matrix entry as it's
currently finishing about a half hour under two hours, which should hopefully
give it enough extra time to run this test suite.

cc #38531

7 years agoRollup merge of #39111 - alexcrichton:more-cross-targets, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:31 +0000 (15:49 -0800)]
Rollup merge of #39111 - alexcrichton:more-cross-targets, r=brson

travis: Expand the `cross` linux image

This expands the `cross` travis matrix entry with a few more targets that our
nightlies are building:

* x86_64-rumprun-netbsd
* arm-unknown-linux-musleabi
* arm-unknown-linux-musleabihf
* armv7-unknown-linux-musleabihf
* mips-unknown-linux-musl
* mipsel-unknown-linux-musl

This commit doesn't compile custom toolchains like our current cross-image does,
but instead compiles musl manually and then compiles libunwind manually (like
x86_64) for use for the ARM targets and just uses openwrt toolchains for the
mips targets.

cc #38531

7 years agoRollup merge of #39077 - jseyfried:crate_var_imports, r=nrc
Alex Crichton [Thu, 19 Jan 2017 23:49:30 +0000 (15:49 -0800)]
Rollup merge of #39077 - jseyfried:crate_var_imports, r=nrc

Improve the warning cycle for `use $crate;`

Fixes #39049.
r? @nrc

7 years agoRollup merge of #39068 - alexcrichton:more-small-tests, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:29 +0000 (15:49 -0800)]
Rollup merge of #39068 - alexcrichton:more-small-tests, r=brson

travis: Add i586 linux and i686 musl

This commit expands the existing x86_64-musl entry in the Travis matrix to also
build/test i586-unknown-linux-gnu and i686-unknown-linux-musl.

cc #38531
Closes #35599
Closes #39053

7 years agoRollup merge of #38966 - brson:relnotes, r=brson
Alex Crichton [Thu, 19 Jan 2017 23:49:26 +0000 (15:49 -0800)]
Rollup merge of #38966 - brson:relnotes, r=brson

1.15 release notes

[Rundered](https://github.com/brson/rust/blob/relnotes/RELEASES.md#version-1150-2017-02-02).

Lots of good stuff this release!

Perf graphs: https://goo.gl/KSVFvF, https://goo.gl/K98g8M, https://goo.gl/H1gSoz, https://goo.gl/yZBV2p, https://goo.gl/ltURbb. Not much change 😿

r? @steveklabnik

7 years agoRollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried
Alex Crichton [Thu, 19 Jan 2017 23:49:23 +0000 (15:49 -0800)]
Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried

Implement `#[proc_macro_attribute]`

This implements `#[proc_macro_attribute]` as described in https://github.com/rust-lang/rfcs/pull/1566

The following major (hopefully non-breaking) changes are included:

* Refactor `proc_macro::TokenStream` to use `syntax::tokenstream::TokenStream`.
    * `proc_macro::tokenstream::TokenStream` no longer emits newlines between items, this can be trivially restored if desired
    * `proc_macro::TokenStream::from_str` does not try to parse an item anymore, moved to `impl MultiItemModifier for CustomDerive` with more informative error message

* Implement `#[proc_macro_attribute]`, which expects functions of the kind `fn(TokenStream, TokenStream) -> TokenStream`
    * Reactivated `#![feature(proc_macro)]` and gated `#[proc_macro_attribute]` under it
    * `#![feature(proc_macro)]` and `#![feature(custom_attribute)]` are mutually exclusive
    * adding `#![feature(proc_macro)]` makes the expansion pass assume that any attributes that are not built-in, or introduced by existing syntax extensions, are proc-macro attributes

* Fix `feature_gate::find_lang_feature_issue()` to not use `unwrap()`

    * This change wasn't necessary for this PR, but it helped debugging a problem where I was using the wrong feature string.

* Move "completed feature gate checking" pass to after "name resolution" pass

    * This was necessary for proper feature-gating of `#[proc_macro_attribute]` invocations when the `proc_macro` feature flag isn't set.

Prototype/Litmus Test: [Implementation](https://github.com/abonander/anterofit/blob/proc_macro/service-attr/src/lib.rs#L13) -- [Usage](https://github.com/abonander/anterofit/blob/proc_macro/service-attr/examples/post_service.rs#L35)

7 years agoRollup merge of #38761 - frewsxcv:thread-sleep-formatting, r=alexcrichton
Alex Crichton [Thu, 19 Jan 2017 23:49:22 +0000 (15:49 -0800)]
Rollup merge of #38761 - frewsxcv:thread-sleep-formatting, r=alexcrichton

Add 'platform-specific' section to `sleep_ms` to match `sleep`.

None

7 years agoAuto merge of #39062 - martinhath:placement-in-binaryheap, r=nagisa
bors [Fri, 20 Jan 2017 13:31:10 +0000 (13:31 +0000)]
Auto merge of #39062 - martinhath:placement-in-binaryheap, r=nagisa

Implement placement-in protocol for `BinaryHeap`

Related to #30172, and loosley based on #38551.

At the moment, this PR is in a pretty rough state, but I wanted to get some feedback to see if I'm going in the right direction.

I hope the Mentor label of #30172 is still applicable, even though it's a year old 😄

7 years agoRemove specialization from Debug implementations
Guillaume Gomez [Fri, 20 Jan 2017 12:09:19 +0000 (13:09 +0100)]
Remove specialization from Debug implementations

7 years agoAuto merge of #38955 - estebank:highlighted-diags, r=nikomatsakis
bors [Fri, 20 Jan 2017 09:33:10 +0000 (09:33 +0000)]
Auto merge of #38955 - estebank:highlighted-diags, r=nikomatsakis

Teach Diagnostics to highlight text

Support styled `Diagnostic` output:

<img width="469" alt="mismatched types error with colorized types in the note" src="https://cloud.githubusercontent.com/assets/1606434/21871227/93a84198-d815-11e6-88b1-0ede3c7e28ef.png">

Closes #37532 and #38901.

r? @nikomatsakis CC @jonathandturner @nagisa @nrc

7 years agolinkchecker: Fix checking links which are just fragments
Oliver Middleton [Fri, 20 Jan 2017 08:36:09 +0000 (08:36 +0000)]
linkchecker: Fix checking links which are just fragments

Also fix a typo which linkchecker should have caught.

7 years agoDocument that `Metadata` can be obtained from `symlink_metadata`
Andrea Canciani [Fri, 20 Jan 2017 08:31:06 +0000 (09:31 +0100)]
Document that `Metadata` can be obtained from `symlink_metadata`

7 years agoAuto merge of #38603 - arielb1:supertrait-self-3, r=nikomatsakis
bors [Fri, 20 Jan 2017 04:55:01 +0000 (04:55 +0000)]
Auto merge of #38603 - arielb1:supertrait-self-3, r=nikomatsakis

traits with self-containing supertraits are not object safe

This should be the last time I fix this function.

Fixes #38404.

7 years agoAdd regression test for issue #38942
Michael Woerister [Thu, 19 Jan 2017 23:22:46 +0000 (18:22 -0500)]
Add regression test for issue #38942

7 years agoDeny extra_requirement_in_impl forward-compat lint
Simonas Kazlauskas [Thu, 19 Jan 2017 23:05:54 +0000 (01:05 +0200)]
Deny extra_requirement_in_impl forward-compat lint

Part of #37166

7 years agotrans: Exit earlier from base::trans_crate() when compiling rmeta crates.
Michael Woerister [Thu, 19 Jan 2017 16:32:55 +0000 (11:32 -0500)]
trans: Exit earlier from base::trans_crate() when compiling rmeta crates.

7 years agotravis: Move glibc backwards in time
Alex Crichton [Thu, 19 Jan 2017 00:04:22 +0000 (16:04 -0800)]
travis: Move glibc backwards in time

This commit updates the compilers for many of the artifacts that we're producing
on Travis. These compilers are all compiled by crosstool-ng as they're currently
done for the images in which we're building all our cross compiled compilers.

The purpose of this commit is that when we ship binaries the artifacts won't
require a newer glibc, but rather be as compatible as possible with Linux
distributions by working with a very old version of glibc.

This commit always allocates a new matrix entry for the i686/x86_64 builder.
This builder is dedicated to just producing artifacts and eventually we'll
expand it to building other tools like Cargo and the RLS. The other builders
testing i686 and x86_64 won't use these historical toolchains.

7 years agotravis: Get an emscripten builder online
Alex Crichton [Tue, 17 Jan 2017 07:10:00 +0000 (23:10 -0800)]
travis: Get an emscripten builder online

This commit adds a new entry to the Travis matrix which will execute emscripten
test suites. Along the way it updates a few bits of the test suite to continue
passing on emscripten, such as:

* Ignoring i128/u128 tests as they're presumably just not working (didn't
  investigate as to why)
* Disabling a few process tests (not working on emscripten)
* Ignore some num tests in libstd (#39119)
* Fix some warnings when compiling

7 years agoAuto merge of #39136 - keeperofdakeys:proc-macro-doc-test, r=alexcrichton
bors [Thu, 19 Jan 2017 21:15:12 +0000 (21:15 +0000)]
Auto merge of #39136 - keeperofdakeys:proc-macro-doc-test, r=alexcrichton

Stop warning when doc testing proc macro crates

Fixes #39064

Add the test option to the session struct that is passed
to phase_2_configure_and_expand function inside the
rustdoc test module.

This prevents the warning code from triggering when
parsing proc_macro_derive attributes, just like when
`--test` is normally invoked.

This change makes the warning disappear, but I'm not sure what else it might change. So this early PR is mainly to run the test suite, and to get feedback.

7 years agoAuto merge of #38465 - japaric:msp430-interrupt, r=eddyb
bors [Thu, 19 Jan 2017 18:32:12 +0000 (18:32 +0000)]
Auto merge of #38465 - japaric:msp430-interrupt, r=eddyb

calling convention for MSP430 interrupts

This calling convention is used to define interrup handlers on MSP430 microcontrollers. Usage looks like this:

``` rust
#[no_mangle]
#[link_section = "__interrupt_vector_10"]
pub static TIM0_VECTOR: unsafe extern "msp430-interrupt" fn() = tim0;

unsafe extern "msp430-interrupt" fn tim0() {
  P1OUT.write(0x00);
}
```

which generates the following assembly:

``` asm
Disassembly of section __interrupt_vector_10:

0000fff2 <TIM0_VECTOR>:
    fff2:       10 c0           interrupt service routine at 0xc010

Disassembly of section .text:

0000c010 <_ZN3msp4tim017h3193b957fd6a4fd4E>:
    c010:       c2 43 21 00     mov.b   #0,     &0x0021 ;r3 As==00
    c014:       00 13           reti
        ...
```

7 years agoAuto merge of #39180 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 19 Jan 2017 16:09:42 +0000 (16:09 +0000)]
Auto merge of #39180 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 11 pull requests

- Successful merges: #38457, #38922, #38970, #39039, #39091, #39115, #39121, #39149, #39150, #39151, #39165
- Failed merges:

7 years agoadd cfail test for the new feature gate
Jorge Aparicio [Thu, 19 Jan 2017 13:15:05 +0000 (08:15 -0500)]
add cfail test for the new feature gate

7 years agoRollup merge of #39165 - frewsxcv:slice, r=GuillaumeGomez
Guillaume Gomez [Thu, 19 Jan 2017 10:56:12 +0000 (11:56 +0100)]
Rollup merge of #39165 - frewsxcv:slice, r=GuillaumeGomez

A few improvements to the slice docs.

* Simplify `Option::iter_mut` doc example.
* Document 'empty' corner-cases for `slice::{starts_with, ends_with}`.
* Indicate 'true' as code-like.

7 years agoRollup merge of #39151 - canndrew:feature-gate-uninhabited-references, r=brson
Guillaume Gomez [Thu, 19 Jan 2017 10:56:11 +0000 (11:56 +0100)]
Rollup merge of #39151 - canndrew:feature-gate-uninhabited-references, r=brson

Feature gate `&Void`'s uninhabitedness.

Here's a totally crazy PR which should never be merged.

7 years agoRollup merge of #39150 - birkenfeld:slice-doc, r=GuillaumeGomez
Guillaume Gomez [Thu, 19 Jan 2017 10:56:09 +0000 (11:56 +0100)]
Rollup merge of #39150 - birkenfeld:slice-doc, r=GuillaumeGomez

collections: update docs of slice get() and friends

Resubmit of #38216.

r? @GuillaumeGomez

BTW, instead of closing a PR just because it is old and the team member who offered to fix it up did not have the time to do so, why not ping them instead? (cc @alexcrichton)

7 years agoRollup merge of #39149 - circuitfox:E0122-type-def-trait-bounds-where-clause, r=arielb1
Guillaume Gomez [Thu, 19 Jan 2017 10:56:08 +0000 (11:56 +0100)]
Rollup merge of #39149 - circuitfox:E0122-type-def-trait-bounds-where-clause, r=arielb1

E0122 should apply with where clauses

Fixes #39122

7 years agoRollup merge of #39121 - grimreaper:eax/thethe, r=apasel422
Guillaume Gomez [Thu, 19 Jan 2017 10:56:06 +0000 (11:56 +0100)]
Rollup merge of #39121 - grimreaper:eax/thethe, r=apasel422

minor typo fix

None

7 years agoRollup merge of #39115 - king6cong:master, r=nikomatsakis
Guillaume Gomez [Thu, 19 Jan 2017 10:56:06 +0000 (11:56 +0100)]
Rollup merge of #39115 - king6cong:master, r=nikomatsakis

consistent doc wording

7 years agoRollup merge of #39091 - richard-imaoka:E0491-long-explanation, r=GuillaumeGomez
Guillaume Gomez [Thu, 19 Jan 2017 10:56:04 +0000 (11:56 +0100)]
Rollup merge of #39091 - richard-imaoka:E0491-long-explanation, r=GuillaumeGomez

Add error explanation for E0491

Refs #32777

Please let me know if any question or anything doesn't look right about this.

7 years agoRollup merge of #39039 - michaelwoerister:ignore-gdb-version, r=nrc
Guillaume Gomez [Thu, 19 Jan 2017 10:56:03 +0000 (11:56 +0100)]
Rollup merge of #39039 - michaelwoerister:ignore-gdb-version, r=nrc

debuginfo: Ignore optimized enum tests for GDB versions that can't handle them.

Fixes https://github.com/rust-lang/rust/issues/38948.

r? @nrc
cc @Manishearth

7 years agoRollup merge of #38970 - apasel422:may-dangle, r=pnkfelix
Guillaume Gomez [Thu, 19 Jan 2017 10:56:02 +0000 (11:56 +0100)]
Rollup merge of #38970 - apasel422:may-dangle, r=pnkfelix

Deprecate `#[unsafe_destructor_blind_to_params]`

CC #34761

r? @pnkfelix

7 years agoRollup merge of #38922 - chris-morgan:fs-markdown-link-fix, r=steveklabnik
Guillaume Gomez [Thu, 19 Jan 2017 10:56:01 +0000 (11:56 +0100)]
Rollup merge of #38922 - chris-morgan:fs-markdown-link-fix, r=steveklabnik

Fix a couple of bad Markdown links

7 years agoRollup merge of #38457 - frewsxcv:include, r=GuillaumeGomez
Guillaume Gomez [Thu, 19 Jan 2017 10:56:00 +0000 (11:56 +0100)]
Rollup merge of #38457 - frewsxcv:include, r=GuillaumeGomez

Improvements to 'include' macro documentation.

None

7 years agoFix regression in parsing of trait object types
Vadim Petrochenkov [Thu, 19 Jan 2017 10:28:45 +0000 (13:28 +0300)]
Fix regression in parsing of trait object types

7 years agoAuto merge of #38464 - clarcharr:ip_cmp, r=sfackler
bors [Thu, 19 Jan 2017 03:34:05 +0000 (03:34 +0000)]
Auto merge of #38464 - clarcharr:ip_cmp, r=sfackler

PartialEq and PartialOrd between IpAddr and Ipv[46]Addr.

PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.

7 years agocalling convention for MSP430 interrupts
Jorge Aparicio [Mon, 19 Dec 2016 04:45:20 +0000 (23:45 -0500)]
calling convention for MSP430 interrupts

This calling convention is used to define interrup handlers on MSP430
microcontrollers. Usage looks like this:

``` rust
#[no_mangle]
#[link_section = "__interrupt_vector_10"]
pub static TIM0_VECTOR: unsafe extern "msp430-interrupt" fn() = tim0;

unsafe extern "msp430-interrupt" fn tim0() {
  P1OUT.write(0x00);
}
```

which generates the following assembly:

``` asm
Disassembly of section __interrupt_vector_10:

0000fff2 <TIM0_VECTOR>:
    fff2:       10 c0           interrupt service routine at 0xc010

Disassembly of section .text:

0000c010 <_ZN3msp4tim017h3193b957fd6a4fd4E>:
    c010:       c2 43 21 00     mov.b   #0,     &0x0021 ;r3 As==00
    c014:       00 13           reti
        ...
```

7 years agoAuto merge of #38712 - clarcharr:duration_sum, r=sfackler
bors [Thu, 19 Jan 2017 01:09:46 +0000 (01:09 +0000)]
Auto merge of #38712 - clarcharr:duration_sum, r=sfackler

Sum for Duration

Implemented the `Sum` trait for `Duration`. Seems reasonable.

7 years agoUse multiline Diagnostic for candidate in other module
Esteban Küber [Thu, 19 Jan 2017 00:33:25 +0000 (16:33 -0800)]
Use multiline Diagnostic for candidate in other module

7 years agotravis: Stop uploading sha256 files
Alex Crichton [Thu, 19 Jan 2017 00:10:05 +0000 (16:10 -0800)]
travis: Stop uploading sha256 files

We'll generate these later in the build process and otherwise they could just
cause spurious failures with files overwriting one another.

7 years agoA few improvements to the slice docs.
Corey Farwell [Wed, 18 Jan 2017 02:59:26 +0000 (21:59 -0500)]
A few improvements to the slice docs.

* Simplify `Option::iter_mut` doc example.
* Document 'empty' corner-cases for `slice::{starts_with, ends_with}`.
* Indicate 'true' as code-like.

7 years agoUpdate jemalloc to include various fixes for OSX 10.12
Mike Hommey [Thu, 19 Jan 2017 00:01:52 +0000 (09:01 +0900)]
Update jemalloc to include various fixes for OSX 10.12

7 years agoAdd doctest to the proc-macro derive-test
Josh [Wed, 18 Jan 2017 22:31:55 +0000 (09:31 +1100)]
Add doctest to the proc-macro derive-test

7 years agoStop warning when doc testing proc macro crates
Josh [Wed, 18 Jan 2017 21:31:29 +0000 (08:31 +1100)]
Stop warning when doc testing proc macro crates

Add the actually_rustdoc option to the session that
is passed  to phase_2_configure_and_expand function
inside the rustdoc test module.

This prevents the warning code from triggering when
parsing proc_macro_derive attributes, just like when
`--test` is normally invoked.

7 years agoAdd regression test for debuginfo + LTO
Michael Woerister [Wed, 18 Jan 2017 16:24:43 +0000 (11:24 -0500)]
Add regression test for debuginfo + LTO

7 years agoAdd missing Debug implementation for librand structs
Guillaume Gomez [Wed, 18 Jan 2017 16:13:47 +0000 (17:13 +0100)]
Add missing Debug implementation for librand structs

7 years agoFeature gate `&Void`'s uninhabitedness.
Andrew Cann [Wed, 18 Jan 2017 07:05:28 +0000 (15:05 +0800)]
Feature gate `&Void`'s uninhabitedness.

References to empty types are only considered empty if feature(never_type) is
enabled.

7 years agocollections: update docs of slice get() and friends
Georg Brandl [Wed, 7 Dec 2016 09:14:46 +0000 (10:14 +0100)]
collections: update docs of slice get() and friends

for the new SliceIndex trait.  Also made the docs of the unchecked
versions a bit clearer; they return a reference, not an "unsafe
pointer".

7 years agoE0122 should apply with where clauses
Chris Stankus [Wed, 18 Jan 2017 06:16:19 +0000 (00:16 -0600)]
E0122 should apply with where clauses

7 years agoAuto merge of #38168 - estebank:help-E0034, r=nrc
bors [Wed, 18 Jan 2017 04:45:25 +0000 (04:45 +0000)]
Auto merge of #38168 - estebank:help-E0034, r=nrc

E0034: provide disambiguated syntax for candidates

For a given file

```rust
trait A { fn foo(&self) {} }
trait B : A { fn foo(&self) {} }

fn bar<T: B>(a: &T) {
  a.foo()
}
```

provide the following output

```
error[E0034]: multiple applicable items in scope
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^ multiple `foo` found
  |
note: candidate #1 is defined in the trait `A`
 --> file.rs:2:11
  |
2 | trait A { fn foo(&self, a: usize) {} }
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to use it here write `A::foo(&a, 1)` instead
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^
note: candidate #2 is defined in the trait `B`
 --> file.rs:3:15
  |
3 | trait B : A { fn foo(&self, a: usize) {} }
  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to use it here write `B::foo(&a, 1)` instead
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^
```

Fix #37767.

7 years agotravis: Fix post-failure lldb invocation
Alex Crichton [Wed, 18 Jan 2017 02:55:24 +0000 (18:55 -0800)]
travis: Fix post-failure lldb invocation

Pass an absolute path, not just the basename.

7 years agoAuto merge of #39019 - nikomatsakis:issue-38919, r=eddyb
bors [Wed, 18 Jan 2017 02:20:03 +0000 (02:20 +0000)]
Auto merge of #39019 - nikomatsakis:issue-38919, r=eddyb

only consider value items when searching for methods, not types

Fixes #38919

r? @eddyb

7 years agocheck inherent impls of traits for overlap as well
Niko Matsakis [Tue, 17 Jan 2017 23:29:55 +0000 (18:29 -0500)]
check inherent impls of traits for overlap as well

7 years agorun rustdoc tests in the same sort of thread rustc runs in
Niko Matsakis [Tue, 17 Jan 2017 23:15:08 +0000 (18:15 -0500)]
run rustdoc tests in the same sort of thread rustc runs in

7 years agotolerate `None` return from `get_line`
Niko Matsakis [Tue, 17 Jan 2017 22:56:03 +0000 (17:56 -0500)]
tolerate `None` return from `get_line`

7 years agomore complete error message
Niko Matsakis [Tue, 17 Jan 2017 22:55:49 +0000 (17:55 -0500)]
more complete error message

7 years agoTeach Diagnostics to highlight text
Esteban Küber [Wed, 11 Jan 2017 21:55:41 +0000 (13:55 -0800)]
Teach Diagnostics to highlight text

7 years ago1.15 release notes
Brian Anderson [Tue, 10 Jan 2017 00:44:02 +0000 (00:44 +0000)]
1.15 release notes

7 years agoFix ICE when compiling fn f<T: ?for<'a> Sized>() {}
gralpli [Tue, 17 Jan 2017 21:52:43 +0000 (22:52 +0100)]
Fix ICE when compiling fn f<T: ?for<'a> Sized>() {}

7 years agoAuto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfackler
bors [Tue, 17 Jan 2017 21:52:03 +0000 (21:52 +0000)]
Auto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfackler

Improve the slice iterator's searching methods

Improve all, any, find, position, rposition by explicitly unrolling the loop for the slice iterators.

- Introduce a few extension methods and functions for raw pointers make the new code easy to express
- Introduce helper methods `search_while, rsearch_while` that generalize all the searching methods

LLVM doesn't unroll the loop in `.find()` by default (clang is the same), so performance benefits a lot from explicit unrolling here. An iterator method without conditional exits (like `.fold()`) does not need this on the other hand.

One of the raw pointer extension methods is `fn post_inc(&mut self) -> Self` which is the rustic equivalent of “`ptr++`”, and it is a nice way to express the raw pointer loop (see commit 3).

Specific development notes about `search_while`: I tried both computing an end pointer "rounded" to 4, as well as the `ptrdistance >= 4` loop condition, ptrdistance was better. I tried handling the last 0-3 elements unrolled or with a while loop, the loop was better.

7 years agoFix fallout in `rustdoc`.
Jeffrey Seyfried [Tue, 17 Jan 2017 04:50:46 +0000 (04:50 +0000)]
Fix fallout in `rustdoc`.

7 years agoRemove the lookahead buffer.
Jeffrey Seyfried [Sat, 14 Jan 2017 11:13:45 +0000 (11:13 +0000)]
Remove the lookahead buffer.

7 years agoClarify when range is removed by drain
Stephen E. Baker [Tue, 17 Jan 2017 19:39:16 +0000 (14:39 -0500)]
Clarify when range is removed by drain

Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.

7 years agoFix BinaryHeap place by only constructing vec::PlaceBack once
Martin Hafskjold Thoresen [Tue, 17 Jan 2017 17:58:49 +0000 (18:58 +0100)]
Fix BinaryHeap place by only constructing vec::PlaceBack once

7 years agoAuto merge of #39109 - michaelwoerister:incr-comp-cache-cleanup, r=nikomatsakis
bors [Tue, 17 Jan 2017 18:22:20 +0000 (18:22 +0000)]
Auto merge of #39109 - michaelwoerister:incr-comp-cache-cleanup, r=nikomatsakis

incr.comp.: Delete orphaned work-products.

The new partitioning scheme uncovered a hole in our incr. comp. cache directory garbage collection. So far, we relied on unneeded work products being deleted during the initial cache invalidation phase. However, we the new scheme, we get object files/work products that only contain code from upstream crates. Sometimes this code is not needed anymore (because all callers have been removed from the source) but because nothing that actually influences the contents of these work products had changed, we never deleted them from disk.

r? @nikomatsakis

7 years agotravis: Pass --enable-llvm-static-stdcpp
Alex Crichton [Mon, 16 Jan 2017 02:50:22 +0000 (18:50 -0800)]
travis: Pass --enable-llvm-static-stdcpp

All our releases are compiled with this, so let's be sure to do so whenever
`DEPLOY` is set. This'll ensure that we don't have dynamic dependencies on
libstdc++ which LLVM depends on, but instead we link it all statically to have
more portable binaries.

7 years agoAuto merge of #39100 - Mark-Simulacrum:fix-stage1, r=eddyb
bors [Tue, 17 Jan 2017 14:38:29 +0000 (14:38 +0000)]
Auto merge of #39100 - Mark-Simulacrum:fix-stage1, r=eddyb

Fix stage 1 tests broken because i128 doesn't work in stage 1

Broken by https://github.com/rust-lang/rust/pull/38992.

7 years agoAdd error explanation for E0491
Richard S. Imaoka [Mon, 16 Jan 2017 00:32:09 +0000 (09:32 +0900)]
Add error explanation for E0491

7 years agoAuto merge of #39110 - petrochenkov:sum, r=eddyb
bors [Tue, 17 Jan 2017 12:31:15 +0000 (12:31 +0000)]
Auto merge of #39110 - petrochenkov:sum, r=eddyb

Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring

`ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them.

The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality.

The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided.

The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`.

This is the first part of https://github.com/rust-lang/rust/issues/39085#issuecomment-272743755 and https://github.com/rust-lang/rust/issues/39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later.

r? @eddyb