]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agofix book: refer to `add_two` as "tested function"
Raphael Das Gupta [Tue, 24 Jan 2017 21:44:41 +0000 (22:44 +0100)]
fix book: refer to `add_two` as "tested function"

rather than "test function", which would be `it_works`

7 years agoAuto merge of #39222 - GuillaumeGomez:rustdoc_where, r=frewsxcv,steveklabnik,alexcric...
bors [Tue, 24 Jan 2017 15:26:20 +0000 (15:26 +0000)]
Auto merge of #39222 - GuillaumeGomez:rustdoc_where, r=frewsxcv,steveklabnik,alexcrichton,nrc

Force backline on all where in docs

Pictures are better than words in this case:

Before:

<img width="1440" alt="screen shot 2017-01-21 at 15 34 27" src="https://cloud.githubusercontent.com/assets/3050060/22175139/6e7c75d8-dfef-11e6-9904-023d63e609d2.png">

After:

<img width="1440" alt="screen shot 2017-01-21 at 15 34 32" src="https://cloud.githubusercontent.com/assets/3050060/22175140/75cc3846-dfef-11e6-9799-fffb213653e4.png">

r? @steveklabnik

cc @rust-lang/docs

7 years agoAuto merge of #39214 - estebank:fix-labels-without-msg, r=nikomatsakis
bors [Tue, 24 Jan 2017 11:51:34 +0000 (11:51 +0000)]
Auto merge of #39214 - estebank:fix-labels-without-msg, r=nikomatsakis

Fix multiple labels when some don't have message

The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ----^^^^^^^----
  |   |   |
  |   |   `b` is a good letter
  |
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ----^^^^^^^----
  |       |
  |       `b` is a good letter
```

from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
  |   |   |
  |   |
  |   `a` is a good letter
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^ `a` is a good letter
```

and from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
  |   |   |
  |   |
  |
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
```
r? @nikomatsakis
cc @jonathandturner, @GuillaumeGomez, @nrc

7 years agoAuto merge of #39173 - jseyfried:tokenstream, r=nrc
bors [Tue, 24 Jan 2017 09:29:18 +0000 (09:29 +0000)]
Auto merge of #39173 - jseyfried:tokenstream, r=nrc

Refactor `TokenStream`

r? @nrc

7 years agoAuto merge of #39145 - nrc:opt-cfg-mod, r=@jseyfried
bors [Tue, 24 Jan 2017 06:57:29 +0000 (06:57 +0000)]
Auto merge of #39145 - nrc:opt-cfg-mod, r=@jseyfried

Add an option to the parser so cfg'ed out modules can still be parsed

r? @jseyfried

cc @dtolnay, @erickt it would be great if we could get this picked up into Syntex asap - it fixes a pretty nasty bug in Rustfmt.

7 years agoAuto merge of #39227 - alexcrichton:enable-i686-musl, r=brson
bors [Tue, 24 Jan 2017 03:43:22 +0000 (03:43 +0000)]
Auto merge of #39227 - alexcrichton:enable-i686-musl, r=brson

travis: Enable testing i686 musl

This fixes the final issues with the target related to unwinding by disabling
removal of frame pointers.

7 years agoAuto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichton
bors [Tue, 24 Jan 2017 01:17:09 +0000 (01:17 +0000)]
Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichton

impl ToSocketAddrs for String

`ToSocketAddrs` is implemented for a number of different types,
including `(IpAddr, u16)`, `&str`, and various others, for the
convenience of being able to run things like
`TcpListener::bind("10.11.12.13:1415")`.  However, because this is a
generic parameter with a trait bound, if you have a `String` you cannot
pass it in, either directly as `TcpListener::bind(string)`, or the
`TcpListener::bind(&string)` as you might expect due to deref coercion;
you have to use `TcpListener::bind(&*string)`, which is noisy and hard
to discover (though #39029 suggests better error messages to make it
more discoverable).

Rather than making people stumble over this, just implement
`ToSocketAddrs` for `String`.

7 years agoAuto merge of #39260 - steveklabnik:rollup, r=steveklabnik
bors [Mon, 23 Jan 2017 22:38:33 +0000 (22:38 +0000)]
Auto merge of #39260 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #38794, #38956, #38993, #39191, #39200, #39233, #39258
- Failed merges:

7 years agoRollup merge of #39258 - jacwah:makefile-note, r=aturon
Steve Klabnik [Mon, 23 Jan 2017 21:40:53 +0000 (16:40 -0500)]
Rollup merge of #39258 - jacwah:makefile-note, r=aturon

build: Mention rustbuild in Makefile.in comments

I think this patch will help newcomers like myself with the build system. I didn't understand that the make targets listed in the Makefile.in comments only worked with the old system, until it was pointed out to me in #39256.

7 years agoRollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomez
Steve Klabnik [Mon, 23 Jan 2017 21:40:52 +0000 (16:40 -0500)]
Rollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomez

Add more references between lowercase/uppercase operations.

None

7 years agoRollup merge of #39200 - DirkyJerky:patch-1, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:50 +0000 (16:40 -0500)]
Rollup merge of #39200 - DirkyJerky:patch-1, r=steveklabnik

Docs for atomic orderings: link to the 'nomicon article for further reading

7 years agoRollup merge of #39191 - cesarb:book/trait-objects-vtable-size-and-align, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:49 +0000 (16:40 -0500)]
Rollup merge of #39191 - cesarb:book/trait-objects-vtable-size-and-align, r=steveklabnik

book: size and align in trait object vtables are used

The book currently claims that the `size` and `align` fields in the
trait object vtable are not used, but this is false. These two fields
are used by the stable `mem::size_of_val` and `mem::align_of_val`
functions.

See the `ty::TyDynamic` case of the `glue::size_and_align_of_dst`
function in librustc_trans, which is used to implement both intrinsics
in the unsized case.

r? @steveklabnik

7 years agoRollup merge of #38993 - krdln:patch-1, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:48 +0000 (16:40 -0500)]
Rollup merge of #38993 - krdln:patch-1, r=steveklabnik

Add `&mut expr` to syntax index

7 years agoRollup merge of #38956 - theduke:document-field-init-shorthand-38830, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:47 +0000 (16:40 -0500)]
Rollup merge of #38956 - theduke:document-field-init-shorthand-38830, r=steveklabnik

Update struct_expr grammar for field init shorthand.

Part of the work for #38830 .

r? @steveklabnik

7 years agoRollup merge of #38794 - ConnyOnny:master, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:46 +0000 (16:40 -0500)]
Rollup merge of #38794 - ConnyOnny:master, r=steveklabnik

book: match enum warning

Matching enums with named fields in the previous way yielded the "non_shorthand_field_patterns" warning.
The new code shows the shorthand syntax as well as field renaming, so it should be exhaustive ;-)

7 years agoAdd an option to the parser so cfg'ed out modules can still be parsed
Nick Cameron [Wed, 18 Jan 2017 00:13:36 +0000 (13:13 +1300)]
Add an option to the parser so cfg'ed out modules can still be parsed

7 years agobuild: Link to new build sys from Makefile.in
Jacob Wahlgren [Mon, 23 Jan 2017 18:56:48 +0000 (19:56 +0100)]
build: Link to new build sys from Makefile.in

7 years agoRemove `open_span` and `close_span` from `Delimited`.
Jeffrey Seyfried [Mon, 23 Jan 2017 04:58:15 +0000 (04:58 +0000)]
Remove `open_span` and `close_span` from `Delimited`.

7 years agoAuto merge of #39248 - Wilfred:patch-1, r=frewsxcv
bors [Mon, 23 Jan 2017 05:05:51 +0000 (05:05 +0000)]
Auto merge of #39248 - Wilfred:patch-1, r=frewsxcv

Adding missing URL to release notes

7 years agoAuto merge of #39242 - Eijebong:typo_fix, r=apasel422
bors [Mon, 23 Jan 2017 02:53:57 +0000 (02:53 +0000)]
Auto merge of #39242 - Eijebong:typo_fix, r=apasel422

Fix minor typo

7 years agoAuto merge of #39247 - est31:master, r=jseyfried
bors [Mon, 23 Jan 2017 00:36:00 +0000 (00:36 +0000)]
Auto merge of #39247 - est31:master, r=jseyfried

Remove proc_macro from the tidy whitelist again

PR #38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.

Part of issue #39059 .

7 years agoAdding missing URL to release notes
Wilfred Hughes [Sun, 22 Jan 2017 23:26:45 +0000 (23:26 +0000)]
Adding missing URL to release notes

7 years agoRemove proc_macro from the tidy whitelist again
est31 [Sun, 22 Jan 2017 22:05:51 +0000 (23:05 +0100)]
Remove proc_macro from the tidy whitelist again

PR #38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.

7 years agoAuto merge of #39238 - king6cong:pr, r=frewsxcv
bors [Sun, 22 Jan 2017 22:20:12 +0000 (22:20 +0000)]
Auto merge of #39238 - king6cong:pr, r=frewsxcv

better comment wording

7 years agoRemove crate `proc_macro_tokens`.
Jeffrey Seyfried [Sun, 22 Jan 2017 09:09:33 +0000 (09:09 +0000)]
Remove crate `proc_macro_tokens`.

7 years agoRefactor `TokenStream`.
Jeffrey Seyfried [Wed, 18 Jan 2017 03:27:09 +0000 (03:27 +0000)]
Refactor `TokenStream`.

7 years agoAuto merge of #39243 - cseale:issue_30924, r=est31
bors [Sun, 22 Jan 2017 19:12:59 +0000 (19:12 +0000)]
Auto merge of #39243 - cseale:issue_30924, r=est31

[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31

7 years agotravis: Enable testing i686 musl
Alex Crichton [Fri, 20 Jan 2017 23:32:47 +0000 (15:32 -0800)]
travis: Enable testing i686 musl

This fixes the final issues with the target related to unwinding by disabling
removal of frame pointers.

7 years ago[Gate Tests] - marking feature tests
Colm Seale [Sun, 22 Jan 2017 16:35:15 +0000 (16:35 +0000)]
[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31

7 years agoAuto merge of #38648 - utkarshkukreti:question-mark-in-libstd-documentation-examples...
bors [Sun, 22 Jan 2017 16:55:16 +0000 (16:55 +0000)]
Auto merge of #38648 - utkarshkukreti:question-mark-in-libstd-documentation-examples, r=pnkfelix,steveklabnik,frewsxcvx

libstd: replace all `try!` with `?` in documentation examples

See #38644.

For the record, I used the following Perl one-liner and then manually fixed a couple of things it got wrong:

    $ perl -p -i -e 's#(///.*)try!\((.*)\)#$1$2?#' src/libstd/**/*.rs

7 years agoFix minor typo
Eijebong [Sun, 22 Jan 2017 16:27:29 +0000 (17:27 +0100)]
Fix minor typo

7 years agolibstd: mention `?` operator instead of removing `try!` macro reference
Utkarsh Kukreti [Thu, 29 Dec 2016 08:42:14 +0000 (14:12 +0530)]
libstd: mention `?` operator instead of removing `try!` macro reference

7 years agolibstd: update std::io module documentation to not mention `try!`
Utkarsh Kukreti [Wed, 28 Dec 2016 09:09:41 +0000 (14:39 +0530)]
libstd: update std::io module documentation to not mention `try!`

We're not using it in the examples anymore.

7 years agolibstd: replace all `try!` with `?` in documentation examples
Utkarsh Kukreti [Wed, 28 Dec 2016 09:02:35 +0000 (14:32 +0530)]
libstd: replace all `try!` with `?` in documentation examples

See #38644.

7 years agoAuto merge of #38108 - linclark:32777-E0328, r=GuillaumeGomez
bors [Sun, 22 Jan 2017 14:38:04 +0000 (14:38 +0000)]
Auto merge of #38108 - linclark:32777-E0328, r=GuillaumeGomez

Add error explanation for E0328.

This PR adds an explanation for an error in the list in #32777.

I haven't used this feature myself, so I was piecing it together from the docs. Please let me know if any changes in wording should be made.

One problem: When I followed the instructions in CONTRIBUTING.md, it said to run `make check-stage1` before posting the PR. This reported failures, but they seemed to be intermittent. I got different numbers of failures on each run. Here's the output for the last run

```
failures:

---- [run-make] run-make/rustc-macro-dep-files stdout ----

error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
DYLD_LIBRARY_PATH="/Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin:/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib:" '/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/bin/rustc' --out-dir /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin -L /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin  foo.rs
DYLD_LIBRARY_PATH="/Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin:/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib:" '/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/bin/rustc' --out-dir /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin -L /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin  bar.rs --emit dep-info

------------------------------------------
stderr:
------------------------------------------
dyld: lazy symbol binding failed: Symbol not found: __ZN4core3fmt5write17h2f7663117dd4fb40E
  Referenced from: /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin/libfoo.dylib
  Expected in: /Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib/libstd-fdb5dc8c.dylib

dyld: Symbol not found: __ZN4core3fmt5write17h2f7663117dd4fb40E
  Referenced from: /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin/libfoo.dylib
  Expected in: /Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib/libstd-fdb5dc8c.dylib

make[1]: *** [all] Trace/BPT trap: 5

------------------------------------------

thread '[run-make] run-make/rustc-macro-dep-files' panicked at 'explicit panic', /Users/lclark/Repos/rust/src/tools/compiletest/src/runtest.rs:2407
note: Run with `RUST_BACKTRACE=1` for a backtrace.

failures:
    [run-make] run-make/rustc-macro-dep-files

test result: FAILED. 136 passed; 1 failed; 0 ignored; 0 measured

thread 'main' panicked at 'Some tests failed', /Users/lclark/Repos/rust/src/tools/compiletest/src/main.rs:302
make: *** [tmp/check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-rmake.ok] Error 101
```

r? @GuillaumeGomez

7 years agoAdd more references between lowercase/uppercase operations.
Corey Farwell [Sat, 21 Jan 2017 22:35:15 +0000 (17:35 -0500)]
Add more references between lowercase/uppercase operations.

7 years agoAuto merge of #39224 - GuillaumeGomez:os_string_urls, r=frewsxcv
bors [Sun, 22 Jan 2017 12:19:11 +0000 (12:19 +0000)]
Auto merge of #39224 - GuillaumeGomez:os_string_urls, r=frewsxcv

Add missing urls for OsStr and OsString

r? @frewsxcv

7 years agoAdd missing urls for OsStr and OsString
Guillaume Gomez [Sat, 21 Jan 2017 15:38:54 +0000 (16:38 +0100)]
Add missing urls for OsStr and OsString

7 years agoAuto merge of #39127 - canndrew:unreachable-pattern-errors-into-warnings, r=arielb1
bors [Sun, 22 Jan 2017 08:56:27 +0000 (08:56 +0000)]
Auto merge of #39127 - canndrew:unreachable-pattern-errors-into-warnings, r=arielb1

Change unreachable pattern ICEs to warnings

Allow code with unreachable `?` and `for` patterns to compile.
Add some tests.

7 years agobetter comment wording
king6cong [Sun, 22 Jan 2017 07:45:06 +0000 (15:45 +0800)]
better comment wording

7 years agoRemove duplicate `TokenStream` quoter tests (modulo imports).
Jeffrey Seyfried [Sat, 21 Jan 2017 08:32:11 +0000 (08:32 +0000)]
Remove duplicate `TokenStream` quoter tests (modulo imports).

7 years agoAuto merge of #39221 - frewsxcv:os-string-docs, r=GuillaumeGomez
bors [Sun, 22 Jan 2017 06:41:33 +0000 (06:41 +0000)]
Auto merge of #39221 - frewsxcv:os-string-docs, r=GuillaumeGomez

Add doc examples for `std::ffi::OsString` fucntions/methods.

None

7 years agoAuto merge of #39060 - jseyfried:improve_unused, r=nrc
bors [Sun, 22 Jan 2017 03:42:24 +0000 (03:42 +0000)]
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

7 years agoRemove unused `extern crate`s.
Jeffrey Seyfried [Sat, 14 Jan 2017 09:21:43 +0000 (09:21 +0000)]
Remove unused `extern crate`s.

7 years agoWarn on unused `#[macro_use]` imports.
Jeffrey Seyfried [Sat, 14 Jan 2017 08:58:50 +0000 (08:58 +0000)]
Warn on unused `#[macro_use]` imports.

7 years agoAuto merge of #39176 - CartesianDaemon:master, r=frewsxcv
bors [Sun, 22 Jan 2017 01:19:18 +0000 (01:19 +0000)]
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.

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 agoRevert "Add link to symlink_metadata in fs::Metadata doc"
Jack Vickeridge [Sat, 21 Jan 2017 19:57:57 +0000 (19:57 +0000)]
Revert "Add link to symlink_metadata in fs::Metadata doc"

This reverts commit fe9f5d52a6830991609c07455b0267852d9c3545.

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 agoAdd doc examples for `std::ffi::OsString` fucntions/methods.
Corey Farwell [Sat, 21 Jan 2017 14:26:06 +0000 (09:26 -0500)]
Add doc examples for `std::ffi::OsString` fucntions/methods.

7 years agoForce backline on all where in docs
Guillaume Gomez [Sat, 21 Jan 2017 14:34:11 +0000 (15:34 +0100)]
Force backline on all where in docs

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 agoImprove `unused_extern_crate` warnings.
Jeffrey Seyfried [Sat, 14 Jan 2017 07:35:54 +0000 (07:35 +0000)]
Improve `unused_extern_crate` warnings.

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 agoFix multiple labels when some don't have message
Esteban Küber [Sat, 21 Jan 2017 02:57:21 +0000 (18:57 -0800)]
Fix multiple labels when some don't have message

The diagnostic emitter now accounts for labels with no text message,
presenting the underline on its own, without drawing the line for the
non existing message below it. Go from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ----^^^^^^^----
  |   |   |
  |   |   `b` is a good letter
  |
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ----^^^^^^^----
  |       |
  |       `b` is a good letter
```

and from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
  |   |   |
  |   |
  |   `a` is a good letter
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^ `a` is a good letter
```

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 agoFix comment
Andrew Cann [Sat, 21 Jan 2017 02:55:30 +0000 (10:55 +0800)]
Fix comment

7 years agoFix some nits
Andrew Cann [Sat, 21 Jan 2017 02:53:16 +0000 (10:53 +0800)]
Fix some nits

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 agoAdd unreachable attribute to Err branch
Andrew Cann [Fri, 20 Jan 2017 16:08:37 +0000 (00:08 +0800)]
Add unreachable attribute to Err branch

7 years agoRemove redundant block
Andrew Cann [Fri, 20 Jan 2017 15:28:17 +0000 (23:28 +0800)]
Remove redundant block

7 years agoRevert previous commit
Geoff Yoerger [Fri, 20 Jan 2017 15:25:03 +0000 (09:25 -0600)]
Revert previous commit

7 years agoRemove attribute on match
Andrew Cann [Fri, 20 Jan 2017 14:57:38 +0000 (22:57 +0800)]
Remove attribute on match

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.