Commit Graph

60746 Commits

Author SHA1 Message Date
Michael Woerister
197f037652 incr.comp.: Make cross-crate tracking for incr. comp. opt-in. 2017-01-24 17:56:29 -05:00
bors
d2d8ae6575 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
2017-01-24 11:51:34 +00:00
bors
65b17f53ef Auto merge of #39173 - jseyfried:tokenstream, r=nrc
Refactor `TokenStream`

r? @nrc
2017-01-24 09:29:18 +00:00
bors
ae472485b7 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.
2017-01-24 06:57:29 +00:00
bors
0ba60387f2 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.
2017-01-24 03:43:22 +00:00
bors
18b6b8fb8f 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`.
2017-01-24 01:17:09 +00:00
bors
a583f6f47c Auto merge of #39260 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #38794, #38956, #38993, #39191, #39200, #39233, #39258
- Failed merges:
2017-01-23 22:38:33 +00:00
Steve Klabnik
d7c5f0d4ca 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.
2017-01-23 16:40:53 -05:00
Steve Klabnik
1b2f2bab2a Rollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomez
Add more references between lowercase/uppercase operations.

None
2017-01-23 16:40:52 -05:00
Steve Klabnik
a448532363 Rollup merge of #39200 - DirkyJerky:patch-1, r=steveklabnik
Docs for atomic orderings: link to the 'nomicon article for further reading
2017-01-23 16:40:50 -05:00
Steve Klabnik
e113038a36 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
2017-01-23 16:40:49 -05:00
Steve Klabnik
9df2daf34c Rollup merge of #38993 - krdln:patch-1, r=steveklabnik
Add `&mut expr` to syntax index
2017-01-23 16:40:48 -05:00
Steve Klabnik
fb5b0d033f 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
2017-01-23 16:40:47 -05:00
Steve Klabnik
12b46292c6 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 ;-)
2017-01-23 16:40:46 -05:00
Nick Cameron
44180c8f2b Add an option to the parser so cfg'ed out modules can still be parsed 2017-01-24 10:21:43 +13:00
Jacob Wahlgren
4d8f1c9118 build: Link to new build sys from Makefile.in 2017-01-23 19:56:48 +01:00
Jeffrey Seyfried
49f5b0a8cf Remove open_span and close_span from Delimited. 2017-01-23 06:49:06 +00:00
bors
7bfe5c0281 Auto merge of #39248 - Wilfred:patch-1, r=frewsxcv
Adding missing URL to release notes
2017-01-23 05:05:51 +00:00
bors
17cae03378 Auto merge of #39242 - Eijebong:typo_fix, r=apasel422
Fix minor typo
2017-01-23 02:53:57 +00:00
bors
7821a9b995 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 .
2017-01-23 00:36:00 +00:00
Wilfred Hughes
34a3709f74 Adding missing URL to release notes 2017-01-22 23:26:45 +00:00
est31
e3daab037d 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.
2017-01-22 23:53:13 +01:00
bors
3f261ec4fa Auto merge of #39238 - king6cong:pr, r=frewsxcv
better comment wording
2017-01-22 22:20:12 +00:00
Jeffrey Seyfried
31417efcd3 Remove crate proc_macro_tokens. 2017-01-22 21:37:40 +00:00
Jeffrey Seyfried
2dc60b1180 Refactor TokenStream. 2017-01-22 21:37:38 +00:00
bors
a8fa31029f 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
2017-01-22 19:12:59 +00:00
Alex Crichton
d56999aef9 travis: Enable testing i686 musl
This fixes the final issues with the target related to unwinding by disabling
removal of frame pointers.
2017-01-22 10:29:56 -08:00
Colm Seale
ddb6027213 [Gate Tests] - marking feature tests
Removal of the lang feature gate tests whitelist #39059

r? @est31
2017-01-22 16:58:23 +00:00
bors
b79081c2eb 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
2017-01-22 16:55:16 +00:00
Eijebong
cf4d90db52 Fix minor typo 2017-01-22 17:27:29 +01:00
Utkarsh Kukreti
19724d34d2 libstd: mention ? operator instead of removing try! macro reference 2017-01-22 21:07:38 +05:30
Utkarsh Kukreti
53106df896 libstd: update std::io module documentation to not mention try!
We're not using it in the examples anymore.
2017-01-22 21:07:38 +05:30
Utkarsh Kukreti
9d912b683a libstd: replace all try! with ? in documentation examples
See #38644.
2017-01-22 21:07:38 +05:30
bors
9f70557545 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
2017-01-22 14:38:04 +00:00
Corey Farwell
d896a0c271 Add more references between lowercase/uppercase operations. 2017-01-22 08:49:24 -05:00
bors
3ddc270252 Auto merge of #39224 - GuillaumeGomez:os_string_urls, r=frewsxcv
Add missing urls for OsStr and OsString

r? @frewsxcv
2017-01-22 12:19:11 +00:00
Guillaume Gomez
27123d1a2a Add missing urls for OsStr and OsString 2017-01-22 11:40:49 +01:00
bors
98c3128c39 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.
2017-01-22 08:56:27 +00:00
king6cong
d59a2afe58 better comment wording 2017-01-22 15:45:06 +08:00
Jeffrey Seyfried
ec29011346 Remove duplicate TokenStream quoter tests (modulo imports). 2017-01-22 07:21:14 +00: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