Commit Graph

60686 Commits

Author SHA1 Message Date
Guillaume Gomez
27123d1a2a Add missing urls for OsStr and OsString 2017-01-22 11:40:49 +01:00
bors
44858b8d46 Auto merge of #39221 - frewsxcv:os-string-docs, r=GuillaumeGomez
Add doc examples for `std::ffi::OsString` fucntions/methods.

None
2017-01-22 06:41:33 +00:00
bors
e5b0829bb0 Auto merge of #39060 - jseyfried:improve_unused, r=nrc
Improve unused `extern crate` and unused `#[macro_use]` warnings

This PR
 - adds `unused_imports` warnings for unused `#[macro_use] extern crate` macro imports,
 - improves `unused_extern_crates` warnings (avoids false negatives), and
 - removes unused `#[macro_use]` imports and unused `extern crate`s.

r? @nrc
2017-01-22 03:42:24 +00:00
Jeffrey Seyfried
191abc4264 Remove unused extern crates. 2017-01-22 01:31:02 +00:00
Jeffrey Seyfried
356fa2c5db Warn on unused #[macro_use] imports. 2017-01-22 01:31:00 +00:00
bors
1b06375034 Auto merge of #39176 - CartesianDaemon:master, r=frewsxcv
Use fs::symlink_metadata in doc for is_symlink

fs::metadata() follows symlinks so is_symlink() will always return
false. Use symlink_metadata instead in the example in the
documentation.

See issue #39088.
2017-01-22 01:19:18 +00:00
bors
9761b17d55 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.
2017-01-21 22:07:14 +00:00
Jack Vickeridge
f55bbaa634 Revert "Add link to symlink_metadata in fs::Metadata doc"
This reverts commit fe9f5d52a6.
2017-01-21 19:57:57 +00:00
bors
f5d1128a45 Auto merge of #39210 - GuillaumeGomez:GuillaumeGomez-patch-1, r=frewsxcv
Specify the result of integer cast on boolean

Fixes #39190.

r? @frewsxcv
2017-01-21 19:51:08 +00:00
bors
8ba01a1936 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).
2017-01-21 16:51:22 +00:00
Corey Farwell
47143e3f07 Add doc examples for std::ffi::OsString fucntions/methods. 2017-01-21 10:19:55 -05:00
bors
c2a0d1ba11 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 31a8638e5e.

r? @alexcrichton
2017-01-21 11:48:08 +00:00
Guillaume Gomez
b09305edb9 Specify the result of integer cast on boolean 2017-01-21 12:35:43 +01:00
bors
d8801287a3 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.
2017-01-21 08:41:40 +00:00
Jeffrey Seyfried
2efec3c180 Improve unused_extern_crate warnings. 2017-01-21 07:40:19 +00:00
Wang Xuerui
578001a3aa
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.
2017-01-21 15:05:41 +08:00
bors
b4cb1878f0 Auto merge of #39156 - GuillaumeGomez:debug_librand, r=alexcrichton
Add missing Debug implementation for librand structs

Part of #31869.
2017-01-21 05:44:21 +00:00
bors
633f38ae99 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
2017-01-21 03:26:37 +00:00
bors
aedb49cbc9 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
2017-01-21 00:56:18 +00:00
Alex Crichton
8bee3983f8 appveyor: Don't test i586 MSVC binaries yet
I was hoping
2017-01-20 16:35:58 -08:00
Alex Crichton
72c3148bb3 More test fixes from rollup 2017-01-20 13:49:16 -08:00
Matthew Dawson
4c02d9f6bf
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.
2017-01-20 11:46:51 -05:00
Alex Crichton
5e8d7a4b7c Merge branch 'older-glibc' into rollup 2017-01-20 08:36:50 -08:00
Alex Crichton
1f342a68cc Test fixes from the rollup 2017-01-20 08:35:50 -08:00
Alex Crichton
672d599806 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.
2017-01-20 08:35:50 -08:00
Alex Crichton
5a4658d72f Rollup merge of #39195 - nagisa:deny-extra-requirement-in-impl, r=eddyb
Deny extra_requirement_in_impl forward-compat lint

Part of #37166
2017-01-20 08:35:50 -08:00
Alex Crichton
c2f1b0296b 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
2017-01-20 08:35:49 -08:00
Alex Crichton
465a0d12b9 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
2017-01-20 08:35:49 -08:00
Alex Crichton
f1852650d9 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:🧵:Result;`

error: aborting due to previous error
```
2017-01-20 08:35:49 -08:00
Alex Crichton
a759406dce 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
2017-01-20 08:35:49 -08:00
Alex Crichton
d5102e48f6 Rollup merge of #39166 - glandium:master, r=brson
Update jemalloc to include various fixes for OSX 10.12
2017-01-20 08:35:49 -08:00
Alex Crichton
2fd401d38f 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
2017-01-20 08:35:49 -08:00
Alex Crichton
254380e2f3 Rollup merge of #39146 - alexcrichton:fix-osx-debug, r=michaelwoerister
travis: Fix post-failure lldb invocation

Pass an absolute path, not just the basename.
2017-01-20 08:35:48 -08:00
Alex Crichton
c6e4faa617 Rollup merge of #39143 - nikomatsakis:issue-38967, r=eddyb
check inherent impls of traits for overlap as well

Simple oversight. Fixes #38967.

r? @eddyb
2017-01-20 08:35:48 -08:00
Alex Crichton
e1129b75f8 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
2017-01-20 08:35:48 -08:00
Alex Crichton
1e1df6489c Rollup merge of #39138 - gralpli:issue-39089, r=nrc
Fix ICE when compiling fn f<T: ?for<'a> Sized>() {}

Fixes issue #39089
2017-01-20 08:35:48 -08:00
Alex Crichton
a7ac69a88e 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.
2017-01-20 08:35:48 -08:00
Alex Crichton
1054171ac2 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.
2017-01-20 08:35:47 -08:00
Alex Crichton
b174920827 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
2017-01-20 08:35:47 -08:00
Alex Crichton
17294d98b9 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
2017-01-20 08:35:47 -08:00
Alex Crichton
dd5d85ea76 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.
2017-01-20 08:35:47 -08:00
Alex Crichton
86605c4054 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
2017-01-20 08:35:47 -08:00
Alex Crichton
4a298dde72 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
2017-01-20 08:35:46 -08:00
Alex Crichton
bef5ff1121 Rollup merge of #39077 - jseyfried:crate_var_imports, r=nrc
Improve the warning cycle for `use $crate;`

Fixes #39049.
r? @nrc
2017-01-20 08:35:46 -08:00
Alex Crichton
0c7117457d 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
2017-01-20 08:35:46 -08:00
Alex Crichton
18a39ed66e 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
2017-01-20 08:35:46 -08:00
Alex Crichton
d4d276faaf 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)
2017-01-20 08:34:30 -08:00
Alex Crichton
437d2b5e28 Rollup merge of #38761 - frewsxcv:thread-sleep-formatting, r=alexcrichton
Add 'platform-specific' section to `sleep_ms` to match `sleep`.

None
2017-01-20 08:34:30 -08:00
bors
a52da95ced 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 😄
2017-01-20 13:31:10 +00:00
Guillaume Gomez
50d36fb80f Remove specialization from Debug implementations 2017-01-20 13:10:36 +01:00