]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton
Guillaume Gomez [Sun, 21 Jan 2018 22:11:38 +0000 (23:11 +0100)]
Rollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton

Only link res_init() on GNU/*nix

To workaround a bug in glibc <= 2.26 lookup_host() calls res_init() based on the glibc version detected at runtime. While this avoids calling res_init() on platforms where it's not required we will still end up linking against the symbol.

This causes an issue on macOS where res_init() is implemented in a separate library (libresolv.9.dylib) from the main libc. While this is harmless for standalone programs it becomes a problem if Rust code is statically linked against another program. If the linked program doesn't already specify -lresolv it will cause the link to fail. This is captured in issue #46797

Fix this by hooking in to the glibc workaround in `cvt_gai` and only activating it for the "gnu" environment on Unix This should include all glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc.

This has the side benefit of removing the #[cfg] in sys_common; only unix.rs has code related to the workaround now.

Before this commit:
```shell
> cat main.rs
use std::net::ToSocketAddrs;

#[no_mangle]
pub extern "C" fn resolve_test() -> () {
    let addr_list = ("google.com.au", 0).to_socket_addrs().unwrap();
    println!("{:?}", addr_list);
}
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
Undefined symbols for architecture x86_64:
  "_res_9_init", referenced from:
      std::net::lookup_host::h93c17fe9ad38464a in libmain.a(std-826c8d3b356e180c.std0.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
```

Afterwards:
```shell
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
> ./combined
IntoIter([V4(172.217.25.131:0)])
```

Fixes  #46797

6 years agoRollup merge of #47247 - estebank:suggest-cast, r=petrochenkov
Guillaume Gomez [Sun, 21 Jan 2018 22:11:37 +0000 (23:11 +0100)]
Rollup merge of #47247 - estebank:suggest-cast, r=petrochenkov

Suggest casting on numeric type error

Re #47168.

6 years agoAuto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov
bors [Sun, 21 Jan 2018 16:52:09 +0000 (16:52 +0000)]
Auto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov

Tweaks to invalid ctor messages

 - Do not suggest using a constructor that isn't accessible
 - Suggest the appropriate syntax (`()`/`{}` as appropriate)
 - Add note when trying to use `Self` as a ctor

CC #22488, fix #47085.

6 years agoAuto merge of #47001 - arielb1:private-match, r=nikomatsakis
bors [Sun, 21 Jan 2018 12:05:49 +0000 (12:05 +0000)]
Auto merge of #47001 - arielb1:private-match, r=nikomatsakis

check_match: fix handling of privately uninhabited types

the match-checking code used to use TyErr for signaling "unknown,
inhabited" types for a long time. It had been switched to using the
exact type in #38069, to handle uninhabited types.

However, in #39980, we discovered that we still needed the "unknown
inhabited" logic, but I used `()` instead of `TyErr` to handle that.
Revert to using `TyErr` to fix that problem.

Fixes #46964.

r? @nikomatsakis

6 years agoAuto merge of #45684 - bjorn3:runtime_choose_trans2, r=eddyb
bors [Sun, 21 Jan 2018 09:17:26 +0000 (09:17 +0000)]
Auto merge of #45684 - bjorn3:runtime_choose_trans2, r=eddyb

Allow runtime switching between trans backends

The driver callback after_llvm has been removed as it doesnt work with multiple backends.

r? @eddyb

6 years agoAuto merge of #47622 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 21 Jan 2018 06:32:03 +0000 (06:32 +0000)]
Auto merge of #47622 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 10 pull requests

- Successful merges: #46938, #47193, #47508, #47510, #47532, #47535, #47559, #47568, #47573, #47578
- Failed merges:

6 years agoAuto merge of #47495 - nikomatsakis:nll-issue-47153, r=pnkfelix
bors [Sun, 21 Jan 2018 03:38:34 +0000 (03:38 +0000)]
Auto merge of #47495 - nikomatsakis:nll-issue-47153, r=pnkfelix

remove bogus assertion and comments

The code (incorrectly) assumed that constants could not have generics
in scope, but it's not really a problem if they do.

Fixes #47153

r? @pnkfelix

6 years agoRollup merge of #47578 - arthurprs:btree-doc, r=alexcrichton
Guillaume Gomez [Sat, 20 Jan 2018 21:32:50 +0000 (22:32 +0100)]
Rollup merge of #47578 - arthurprs:btree-doc, r=alexcrichton

Update BTreeMap recommendation

Focus on the ordering / range(instead of all) benefit as it's the most important feature.

6 years agoRollup merge of #47573 - estebank:closures, r=nikomatsakis
Guillaume Gomez [Sat, 20 Jan 2018 21:32:49 +0000 (22:32 +0100)]
Rollup merge of #47573 - estebank:closures, r=nikomatsakis

Closure argument mismatch tweaks

 - use consistent phrasing for expected and found arguments
 - suggest changing arguments to tuple if possible
 - suggest changing single tuple argument to arguments if possible

Fix #44150.

6 years agoRollup merge of #47568 - EdSchouten:cloudabi-linker, r=alexcrichton
Guillaume Gomez [Sat, 20 Jan 2018 21:32:48 +0000 (22:32 +0100)]
Rollup merge of #47568 - EdSchouten:cloudabi-linker, r=alexcrichton

Give TargetOptions::linker a sane default value for CloudABI.

Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo
seems to make use of the TargetOptions::linker property. Make the out of
the box experience for CloudABI a bit better by using the same compiler
name as cc-rs.

6 years agoRollup merge of #47559 - walinga:pr-link-fix, r=kennytm
Guillaume Gomez [Sat, 20 Jan 2018 21:32:47 +0000 (22:32 +0100)]
Rollup merge of #47559 - walinga:pr-link-fix, r=kennytm

Fix the "Github - About Pull Requests" link in CONTRIBUTING.md

Previously the text that is supposed to link to the Github Pull Requests page, instead linked to the same file (CONTRIBUTING.md).

6 years agoRollup merge of #47535 - Manishearth:ignore-target, r=kennytm
Guillaume Gomez [Sat, 20 Jan 2018 21:32:46 +0000 (22:32 +0100)]
Rollup merge of #47535 - Manishearth:ignore-target, r=kennytm

add target/ to ignored tidy dirs

Sometimes you get a target directory from running cargo in the rust repo (the root is `src/`), and it contains generated files. Just whitelist it since it causes tidy to spew warnings uncontrollably.

6 years agoRollup merge of #47532 - tbu-:pr_path_oddities, r=TimNN
Guillaume Gomez [Sat, 20 Jan 2018 21:32:45 +0000 (22:32 +0100)]
Rollup merge of #47532 - tbu-:pr_path_oddities, r=TimNN

Add some edge cases to the documentation of `Path`

Affected methods are `starts_with` and `strip_prefix`.

6 years agoRollup merge of #47510 - sfackler:deprecate-dns, r=alexcrichton
Guillaume Gomez [Sat, 20 Jan 2018 21:32:44 +0000 (22:32 +0100)]
Rollup merge of #47510 - sfackler:deprecate-dns, r=alexcrichton

Deprecate std::net::lookup_host

We intended to do this quite a while ago but it snuck through.

r? @alexcrichton

6 years agoRollup merge of #47508 - QuietMisdreavus:rbe-bookshelf, r=steveklabnik
Guillaume Gomez [Sat, 20 Jan 2018 21:32:43 +0000 (22:32 +0100)]
Rollup merge of #47508 - QuietMisdreavus:rbe-bookshelf, r=steveklabnik

add Rust By Example to the bookshelf

cc #46194

With #46196 freshly merged, we should add a link to the main docs distribution so people can find it! We discussed this at the docs team meeting today and decided to go ahead with adding it to the bookshelf.

6 years agoRollup merge of #47193 - cramertj:result-opts, r=TimNN
Guillaume Gomez [Sat, 20 Jan 2018 21:32:42 +0000 (22:32 +0100)]
Rollup merge of #47193 - cramertj:result-opts, r=TimNN

Add transpose conversions for nested Option and Result

These impls are useful when working with combinator
methods that expect an option or a result, but you
have a `Result<Option<T>, E>` instead of an `Option<Result<T, E>>`
or vice versa.

6 years agoRollup merge of #46938 - hellow554:rustdoc-kbd-style, r=GuillaumeGomez
Guillaume Gomez [Sat, 20 Jan 2018 21:32:41 +0000 (22:32 +0100)]
Rollup merge of #46938 - hellow554:rustdoc-kbd-style, r=GuillaumeGomez

add kbd style tag to main.css in rustdoc

Added css style for kbd tags so they actually look like keys.
Result preview and discussion was going on in #46900 .

6 years agoFix tests by keepeing needed suggestions
Esteban Küber [Sat, 20 Jan 2018 20:02:40 +0000 (12:02 -0800)]
Fix tests by keepeing needed suggestions

6 years agoRemove the 'extern "C"' in the right place
bjorn3 [Sat, 20 Jan 2018 16:27:00 +0000 (17:27 +0100)]
Remove the 'extern "C"' in the right place

6 years agoAuto merge of #46980 - zackmdavis:and_the_case_of_the_needlessly_parenthesized_argume...
bors [Sat, 20 Jan 2018 15:06:41 +0000 (15:06 +0000)]
Auto merge of #46980 - zackmdavis:and_the_case_of_the_needlessly_parenthesized_arguments, r=petrochenkov

in which the unused-parens lint comes to cover function and method args

Resolves #46137.

6 years agoAuto merge of #46952 - SimonSapin:nonnull, r=alexcrichton
bors [Sat, 20 Jan 2018 12:28:13 +0000 (12:28 +0000)]
Auto merge of #46952 - SimonSapin:nonnull, r=alexcrichton

Rename std::ptr::Shared to NonNull and stabilize it

This implements the changes proposed at https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629:

> * Rename `Shared<T>` to `NonNull<T>` and stabilize it. (Being in the `ptr` module is enough to say that it’s a pointer. I’m not very attached to this specific name though.)
> * Rename `Box<T>` methods ~~`from_unique`~~/`into_unique` to ~~`from_nonnull`~~/`into_nonnull` (or whatever names are deemed appropriate), replace `Unique<T>` with `NonNull<T>` in their signatures, and stabilize them.
> *  Replace `Unique<T>` with `NonNull<T>` in the signatures of methods of the `Alloc` trait.
> * Mark `Unique` “permanently-unstable” by replacing remaining occurrences of `#[unstable(feature = "unique", issue = "27730")]` with:
>
>   ```rust
>   #[unstable(feature = "ptr_internals", issue = "0", reason = "\
>       use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), \
>       Send, and/or Sync")]
>   ```
>
>   (Maybe the `reason` string is only useful on the struct definition.) Ideally it would be made private to some crate instead, but it needs to be used in both liballoc and libstd.
> * (Leave `NonZero` and `Zeroable` unstable for now, and subject to future bikeshedding.)

6 years agoFix ICE
bjorn3 [Sat, 20 Jan 2018 10:55:55 +0000 (11:55 +0100)]
Fix ICE

6 years agoAssign its own tracking issue to Box::into_raw_non_null
Simon Sapin [Wed, 10 Jan 2018 20:11:55 +0000 (21:11 +0100)]
Assign its own tracking issue to Box::into_raw_non_null

https://github.com/rust-lang/rust/issues/47336

6 years agoRename NonNull::empty to dangling.
Simon Sapin [Wed, 10 Jan 2018 08:30:04 +0000 (09:30 +0100)]
Rename NonNull::empty to dangling.

6 years agoRevert Box::into_raw_non_null to unstable
Simon Sapin [Wed, 10 Jan 2018 08:25:11 +0000 (09:25 +0100)]
Revert Box::into_raw_non_null to unstable

6 years agoPreserve formatting options in Debug for NonNull/Unique
Simon Sapin [Wed, 10 Jan 2018 08:21:15 +0000 (09:21 +0100)]
Preserve formatting options in Debug for NonNull/Unique

6 years agoFix some doc-comment examples for earlier API refactor
Simon Sapin [Tue, 9 Jan 2018 10:25:22 +0000 (11:25 +0100)]
Fix some doc-comment examples for earlier API refactor

https://github.com/rust-lang/rust/pull/41064

6 years agoRename Box::into_non_null_raw to Box::into_raw_non_null
Simon Sapin [Wed, 27 Dec 2017 21:56:06 +0000 (22:56 +0100)]
Rename Box::into_non_null_raw to Box::into_raw_non_null

6 years agoRemove `Box::from_non_null_raw`
Simon Sapin [Wed, 27 Dec 2017 21:53:27 +0000 (22:53 +0100)]
Remove `Box::from_non_null_raw`

Per https://github.com/rust-lang/rust/pull/46952#issuecomment-353956225

6 years agoRename Box::*_nonnull_raw to *_non_null_raw
Simon Sapin [Fri, 22 Dec 2017 22:46:52 +0000 (23:46 +0100)]
Rename Box::*_nonnull_raw to *_non_null_raw

6 years agoStabilize std::ptr::NonNull
Simon Sapin [Fri, 22 Dec 2017 18:50:21 +0000 (19:50 +0100)]
Stabilize std::ptr::NonNull

6 years agoRemove a deprecated (renamed) and unstable method of NonNull
Simon Sapin [Fri, 22 Dec 2017 18:47:27 +0000 (19:47 +0100)]
Remove a deprecated (renamed) and unstable method of NonNull

6 years agoMark Unique as perma-unstable, with the feature renamed to ptr_internals.
Simon Sapin [Fri, 22 Dec 2017 18:29:16 +0000 (19:29 +0100)]
Mark Unique as perma-unstable, with the feature renamed to ptr_internals.

6 years agoReplace Box::{from,into}_unique with {from,into}_nonnull_raw
Simon Sapin [Fri, 22 Dec 2017 18:24:07 +0000 (19:24 +0100)]
Replace Box::{from,into}_unique with {from,into}_nonnull_raw

Thew `_raw` prefix is included because the fact that `Box`’s ownership
semantics are "dissolved" or recreated seem more important than the exact
parameter type or return type.

6 years agoReplace Unique<T> with NonZero<T> in Alloc trait
Simon Sapin [Fri, 22 Dec 2017 18:12:22 +0000 (19:12 +0100)]
Replace Unique<T> with NonZero<T> in Alloc trait

6 years agoRename std::ptr::Shared to NonNull
Simon Sapin [Fri, 22 Dec 2017 17:58:39 +0000 (18:58 +0100)]
Rename std::ptr::Shared to NonNull

`Shared` is now a deprecated `type` alias.

CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629

6 years agoImplement Debug for ptr::Shared and ptr::Unique.
Corey Farwell [Sun, 17 Dec 2017 22:28:01 +0000 (17:28 -0500)]
Implement Debug for ptr::Shared and ptr::Unique.

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

6 years agoClosure argument mismatch tweaks
Esteban Küber [Fri, 19 Jan 2018 09:28:20 +0000 (01:28 -0800)]
Closure argument mismatch tweaks

 - use consistent phrasing for expected and found arguments
 - suggest changing arugments to tuple if possible
 - suggest changing single tuple argument to arguments if possible

6 years agoAuto merge of #46919 - michaelwoerister:new-leb128, r=sfackler
bors [Sat, 20 Jan 2018 02:00:13 +0000 (02:00 +0000)]
Auto merge of #46919 - michaelwoerister:new-leb128, r=sfackler

Speed up leb128 encoding and decoding for unsigned values.

Make the implementation for some leb128 functions potentially faster.

@Mark-Simulacrum, could you please trigger a perf.rlo run?

6 years agoHopefully fix the 32bit SEGV
bjorn3 [Fri, 19 Jan 2018 19:24:42 +0000 (20:24 +0100)]
Hopefully fix the 32bit SEGV

6 years agoJust forget the DynamicLibrary after getting a hot plugged backend
bjorn3 [Fri, 12 Jan 2018 17:57:00 +0000 (18:57 +0100)]
Just forget the DynamicLibrary after getting a hot plugged backend

6 years agoRemove accidential libloading dependency
bjorn3 [Fri, 12 Jan 2018 07:17:34 +0000 (08:17 +0100)]
Remove accidential libloading dependency

6 years agoFix ICE
bjorn3 [Wed, 10 Jan 2018 14:20:54 +0000 (15:20 +0100)]
Fix ICE

6 years agoRemove use of RUSTC_COMPILETEST env var
bjorn3 [Tue, 9 Jan 2018 17:37:33 +0000 (18:37 +0100)]
Remove use of RUSTC_COMPILETEST env var

6 years agoAdd missing licenses
bjorn3 [Thu, 4 Jan 2018 17:26:34 +0000 (18:26 +0100)]
Add missing licenses

6 years agoFix hotplug backend and add test
bjorn3 [Thu, 4 Jan 2018 17:15:40 +0000 (18:15 +0100)]
Fix hotplug backend and add test

6 years agoFix review comments
bjorn3 [Thu, 4 Jan 2018 11:40:11 +0000 (12:40 +0100)]
Fix review comments

6 years agoCleanup hot plug codegen backend code
bjorn3 [Wed, 3 Jan 2018 13:36:52 +0000 (14:36 +0100)]
Cleanup hot plug codegen backend code

6 years agoHot plug rustc_trans
bjorn3 [Mon, 1 Jan 2018 11:17:07 +0000 (12:17 +0100)]
Hot plug rustc_trans

6 years agoHide even more of rustc_trans
bjorn3 [Thu, 28 Dec 2017 09:11:26 +0000 (10:11 +0100)]
Hide even more of rustc_trans

6 years agoFix rustc_driver test.rs
bjorn3 [Thu, 28 Dec 2017 08:33:53 +0000 (09:33 +0100)]
Fix rustc_driver test.rs

6 years agoHide more stuff from rustc_trans
bjorn3 [Wed, 27 Dec 2017 18:03:48 +0000 (19:03 +0100)]
Hide more stuff from rustc_trans

6 years agoFix rustc_driver test.rs
bjorn3 [Wed, 27 Dec 2017 17:54:07 +0000 (18:54 +0100)]
Fix rustc_driver test.rs

6 years agoAllow runtime switching between trans backends
bjorn3 [Mon, 30 Oct 2017 17:42:21 +0000 (18:42 +0100)]
Allow runtime switching between trans backends

6 years agoUpdate BTreeMap recommendation
Arthur Silva [Fri, 19 Jan 2018 14:40:02 +0000 (15:40 +0100)]
Update BTreeMap recommendation

Focus on the ordering/range benefit.

6 years agoAuto merge of #47503 - arielb1:check-size, r=eddyb
bors [Fri, 19 Jan 2018 10:18:52 +0000 (10:18 +0000)]
Auto merge of #47503 - arielb1:check-size, r=eddyb

avoid double-unsizing arrays in bytestring match lowering

The match lowering code, when lowering matches against bytestrings,
works by coercing both the scrutinee and the pattern to `&[u8]` and
then comparing them using `<[u8] as Eq>::eq`.

If the scrutinee is already of type `&[u8]`, then unsizing it is both
unneccessary and a trait error caught by the new and updated MIR typeck,
so this PR changes lowering to avoid doing that (match lowering tried to
avoid that before, but that attempt was quite broken).

Fixes #46920.

r? @eddyb

6 years agoGive TargetOptions::linker a sane default value.
Ed Schouten [Fri, 19 Jan 2018 08:29:58 +0000 (09:29 +0100)]
Give TargetOptions::linker a sane default value.

Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo
seems to make use of the TargetOptions::linker property. Make the out of
the box experience for CloudABI a bit better by using the same compiler
name as cc-rs.

6 years agoAuto merge of #47454 - topecongiro:update-rustfmt, r=nrc
bors [Fri, 19 Jan 2018 07:35:18 +0000 (07:35 +0000)]
Auto merge of #47454 - topecongiro:update-rustfmt, r=nrc

Update rustfmt to 0.3.6

r? @nrc

6 years agoAuto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakis
bors [Fri, 19 Jan 2018 04:45:22 +0000 (04:45 +0000)]
Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakis

Don't include DefIndex in proc-macro registrar function symbol.

There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions.

This should fix issue #47292.

6 years agoAuto merge of #47401 - rkruppe:issue-47278, r=eddyb
bors [Fri, 19 Jan 2018 01:58:30 +0000 (01:58 +0000)]
Auto merge of #47401 - rkruppe:issue-47278, r=eddyb

Compute LLVM argument indices correctly in face of padding

Closes #47278

r? @eddyb

6 years agoUpdate CONTRIBUTING.md
Matthew Walinga [Thu, 18 Jan 2018 23:05:33 +0000 (18:05 -0500)]
Update CONTRIBUTING.md

6 years agoin which the unused-parens lint comes to cover function and method args
Zack M. Davis [Sun, 24 Dec 2017 03:28:33 +0000 (19:28 -0800)]
in which the unused-parens lint comes to cover function and method args

Resolves #46137.

6 years agoUpdate rustfmt to 0.3.6
topecongiro [Thu, 18 Jan 2018 14:40:37 +0000 (23:40 +0900)]
Update rustfmt to 0.3.6

6 years agoAuto merge of #47528 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 18 Jan 2018 14:03:12 +0000 (14:03 +0000)]
Auto merge of #47528 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #47250, #47313, #47398, #47468, #47471, #47520
- Failed merges:

6 years agoAuto merge of #47280 - alexcrichton:update-cargo, r=kennytm
bors [Thu, 18 Jan 2018 11:10:14 +0000 (11:10 +0000)]
Auto merge of #47280 - alexcrichton:update-cargo, r=kennytm

Update Cargo and its dependencies

This'll probably have a bunch of build errors, so let's try and head those off
and find them sooner rather than later!

6 years agoadd target/ to ignored tidy dirs
Manish Goregaokar [Thu, 18 Jan 2018 05:32:32 +0000 (11:02 +0530)]
add target/ to ignored tidy dirs

6 years agoconverted space to tab in css files
Marcel Hellwig [Thu, 18 Jan 2018 08:06:55 +0000 (09:06 +0100)]
converted space to tab in css files

6 years agoUpdate Cargo and its dependencies
Alex Crichton [Mon, 8 Jan 2018 21:56:22 +0000 (13:56 -0800)]
Update Cargo and its dependencies

This'll probably have a bunch of build errors, so let's try and head those off
and find them sooner rather than later!

6 years agoDeprecate std::net::lookup_host
Steven Fackler [Wed, 17 Jan 2018 04:54:48 +0000 (20:54 -0800)]
Deprecate std::net::lookup_host

We intended to do this quite a while ago but it snuck through.

6 years agoAdd some edge cases to the documentation of `Path`
Tobias Bucher [Thu, 18 Jan 2018 00:22:20 +0000 (01:22 +0100)]
Add some edge cases to the documentation of `Path`

Affected methods are `starts_with` and `strip_prefix`.

6 years agoRollup merge of #47520 - mbrubeck:fstat, r=Mark-Simulacrum
Guillaume Gomez [Wed, 17 Jan 2018 22:43:31 +0000 (23:43 +0100)]
Rollup merge of #47520 - mbrubeck:fstat, r=Mark-Simulacrum

Use File::metadata instead of fs::metadata to choose buffer size

This replaces a `stat` syscall with `fstat` or similar, which can be faster.  Fixes #47519.

6 years agoRollup merge of #47471 - estebank:point-to-method-e0283, r=pnkfelix
Guillaume Gomez [Wed, 17 Jan 2018 22:43:30 +0000 (23:43 +0100)]
Rollup merge of #47471 - estebank:point-to-method-e0283, r=pnkfelix

On E0283, point at method with the requirements

On required type annotation diagnostic error, point at method with the
requirements if the span is available.

CC #45453.

6 years agoRollup merge of #47468 - estebank:closure-mut-mut, r=pnkfelix
Guillaume Gomez [Wed, 17 Jan 2018 22:43:29 +0000 (23:43 +0100)]
Rollup merge of #47468 - estebank:closure-mut-mut, r=pnkfelix

Do not suggest to make `mut` binding external to `Fn` closure

Re #46834.

6 years agoRollup merge of #47398 - GuillaumeGomez:pulldown-warnings, r=QuietMisdreavus
Guillaume Gomez [Wed, 17 Jan 2018 22:43:28 +0000 (23:43 +0100)]
Rollup merge of #47398 - GuillaumeGomez:pulldown-warnings, r=QuietMisdreavus

Switch to pulldown as default markdown renderer

r? @QuietMisdreavus

6 years agoRollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=QuietMisdreavus
Guillaume Gomez [Wed, 17 Jan 2018 22:43:27 +0000 (23:43 +0100)]
Rollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=QuietMisdreavus

rustdoc: Populate external_traits with traits only seen in impls

This means default methods can always be found and "Important traits" will include all spotlight traits.

6 years agoRollup merge of #47250 - GuillaumeGomez:test-rustdoc-js, r=Mark-Simulacrum
Guillaume Gomez [Wed, 17 Jan 2018 22:43:26 +0000 (23:43 +0100)]
Rollup merge of #47250 - GuillaumeGomez:test-rustdoc-js, r=Mark-Simulacrum

Test rustdoc js

Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).

6 years agoAuto merge of #47522 - kennytm:rollup, r=kennytm
bors [Wed, 17 Jan 2018 18:38:34 +0000 (18:38 +0000)]
Auto merge of #47522 - kennytm:rollup, r=kennytm

Rollup of 21 pull requests

- Successful merges: #47302, #47333, #47387, #47404, #47407, #47426, #47427, #47436, #47444, #47456, #47458, #47467, #47479, #47481, #47483, #47487, #47497, #47498, #47505, #47509, #47514
- Failed merges:

6 years agoRollup merge of #47514 - gnzlbg:whitelist_x86_fxsr, r=rkruppe
kennytm [Wed, 17 Jan 2018 17:57:32 +0000 (01:57 +0800)]
Rollup merge of #47514 - gnzlbg:whitelist_x86_fxsr, r=rkruppe

whitelist x86 fxsr feature

https://github.com/rust-lang/rust/pull/47223 properly checks that only white-listed features are allowed in combination with `target_feature`, but the `fxsr` feature used by `stdsimd` was not white-listed.

r? @alexcrichton

6 years agoRollup merge of #47509 - cuviper:rayon-rust-installer, r=Mark-Simulacrum
kennytm [Wed, 17 Jan 2018 17:57:31 +0000 (01:57 +0800)]
Rollup merge of #47509 - cuviper:rayon-rust-installer, r=Mark-Simulacrum

Update rust-installer for streaming parallelism

Pull in rust-lang/rust-installer#76 to get streamed tarball generation,
rather than batching it all in memory, while still getting the benefit
of compressing in parallel.

6 years agoRollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:30 +0000 (01:57 +0800)]
Rollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=estebank

rustc: Spawn `cmd /c` for `.bat` scripts

This fixes an accidental regression #46335 where the behavior of
`Path::ends_with` is different from `str::ends_with` (paths operate over
components, strs operate over chars).

6 years agoRollup merge of #47498 - dominikWin:missing-module-name, r=petrochenkov
kennytm [Wed, 17 Jan 2018 17:57:29 +0000 (01:57 +0800)]
Rollup merge of #47498 - dominikWin:missing-module-name, r=petrochenkov

Make non-found module name optional

No longer uses a magic string for missing or root module.

6 years agoRollup merge of #47497 - goffrie:patch-1, r=dtolnay
kennytm [Wed, 17 Jan 2018 17:57:28 +0000 (01:57 +0800)]
Rollup merge of #47497 - goffrie:patch-1, r=dtolnay

Remove incorrect `Default::default` links, add a new one

`map_or` and `map_or_else` don't use `Default::default`, but `unwrap_or_default` does.

6 years agoRollup merge of #47487 - Pulkit07:foo, r=kennytm
kennytm [Wed, 17 Jan 2018 17:57:27 +0000 (01:57 +0800)]
Rollup merge of #47487 - Pulkit07:foo, r=kennytm

implement "only-<platforms>" for test headers

This patch implements "only-<platforms>" for tests headers using which one can
specify just the platforms on which the test should run rather than listing all
the platforms to ignore using "ignore-<platforms>".

This fixes #33581 and fixes #47459.

6 years agoRollup merge of #47483 - segevfiner:mingw64-build-hack, r=alexcrichton
kennytm [Wed, 17 Jan 2018 17:57:26 +0000 (01:57 +0800)]
Rollup merge of #47483 - segevfiner:mingw64-build-hack, r=alexcrichton

Add "-lmsvcrt" twice to get rustc to build with the latest mingw64

After updating mingw-w64 in Msys2, I started getting this when doing `./x.py build --stage 1 src/libtest`:
```
error: linking with `gcc` failed: exit code: 1
  |
  = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.rustc0-833528dbd46ff06c3b1f5154abdef2ed.rs.rcgu.o" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.rustc1-833528dbd46ff06c3b1f5154abdef2ed.rs.rcgu.o" "-o" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.exe" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\release\\deps" "-L" "...\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\dbghelp-sys-0.2.0/x86_64" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\miniz-sys-98d83a845f69b3ab\\out" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_binaryen-f106436b515711ff\\out/build/lib" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_binaryen-f106436b515711ff\\out" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_llvm-9a040fa1f1937a67\\out" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\llvm/lib" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_driver-224d9efe142c632e" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_trans-767a58ff60ff6a03" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_resolve-bcc2d91b756552d1" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_incremental-e93e816231352cc9" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_plugin-8273bd6d564e8657" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_metadata-5537b9a8ab6e6015" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_lint-796681662b9ad8e1" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_passes-9ef6de765e132a7c" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_privacy-2289da126d06c49e" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_llvm-893cdac51017c26f" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_borrowck-ac2009fc1ce58d88" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_mir-d4ce85a1cded4423" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_const_eval-a4e766ec47afde96" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_save_analysis-66d4c41e75392976" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_typeck-4e21db5573af1446" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_platform_intrinsics-f40c4b99b60d15e9" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_allocator-86ef12c8efbcf068" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_trans_utils-8199c3d0e673bb7b" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc-8f435ca07f1a04ff" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-l" "test-8abb197945b79a6a" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_const_math-fa724350247d1ae6" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_back-838b735c189dd798" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "graphviz-42c69c0ff2aacc5b" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "arena-454325a3f2773bc8" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "syntax_ext-7880c41067f1be05" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "proc_macro-f609718c6b927026" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "syntax-3d2aaf6e201abcfe" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_errors-2c007ffe6a847ed7" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "syntax_pos-067e758dda669d03" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_data_structures-50e5e6db2f34c196" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-l" "term-9d9f4c10ffba6dd6" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "serialize-e55b4fb27a4d08bf" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_cratesio_shim-baed94e463835a87" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "fmt_macros-3c2cdca7d2f8dd09" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-l" "std-b1b09a5d7798628b" "-Wl,-Bstatic" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-69f85297d9318c97.rlib" "-Wl,-Bdynamic" "-l" "advapi32" "-l" "ole32" "-l" "oleaut32" "-l" "psapi" "-l" "shell32" "-l" "ole32" "-l" "uuid" "-l" "stdc++" "-l" "gcc_eh" "-l" "pthread" "-l" "psapi" "-l" "dbghelp" "-l" "kernel32" "-l" "advapi32" "-l" "kernel32" "-l" "advapi32" "-l" "ws2_32" "-l" "userenv" "-l" "shell32" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: rust/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmsvcrt.a(lib64_libmsvcrt_os_a-__p__fmode.o):__p__fmode.c:(.rdata$.refptr.__imp__fmode[.refptr.__imp__fmode]+0x0): undefined reference to `__imp__fmode'
          collect2.exe: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile `rustc-main`.

Caused by:
  process didn't exit successfully: `rust\msys64\home\...\rust\build\bootstrap/debug/rustc --crate-name rustc rustc\rustc.rs --error-format json --crate-type bin --emit=dep-info,link -C opt-level=2 --cfg feature="jemalloc" --cfg feature="llvm" --cfg feature="rustc_back" --cfg feature="rustc_driver" -C metadata=b67a4fe646fd8794 -C extra-filename=-b67a4fe646fd8794 --out-dir rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps --target x86_64-pc-windows-gnu -L dependency=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps -L dependency=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\release\deps --extern rustc_back=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps\rustc_back-838b735c189dd798.dll --extern rustc_driver=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps\rustc_driver-224d9efe142c632e.dll -L native=...\.cargo\registry\src\github.com-1ecc6299db9ec823\dbghelp-sys-0.2.0/x86_64 -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\miniz-sys-98d83a845f69b3ab\out -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\rustc_binaryen-f106436b515711ff\out/build/lib -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\rustc_binaryen-f106436b515711ff\out -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\rustc_llvm-9a040fa1f1937a67\out -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\llvm/lib` (exit code: 101)
thread 'main' panicked at 'command did not execute successfully: "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0/bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-gnu" "-j" "4" "--release" "--features" " jemalloc llvm" "--manifest-path" "rust/msys64/home/.../rust\\src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap\compile.rs:886:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: rust/msys64/home/.../rust/build/bootstrap/debug/bootstrap build --stage 1 src/libtest
Build completed unsuccessfully in 0:00:25
```

The code that uses `__p__fmode` was added in https://github.com/mirror/mingw-w64/commit/2e64b9e4537d564478f17b873b2f655f518325ed, apparently in x86_64, it uses its own implementation of it. libmsvcrt.a is kind of a weird beast, it's both an import library for the system msvcrt.dll, but it also is a library that includes compiled code.

For some reason it fails to find the reference for the import symbol that is found in the very same archive as the function that uses it. I don't know what in the Rust code base triggers this. i.e. Create an MWE that can show why this PR is required.

This probably *shouldn't be merged* without understanding why this is necessary or not.

To successfully bootstrap rustc and show that this does make the build work (On latest mingw-w64 x86_64 on Msys2):
```sh
$ RUSTFLAGS="-C link-arg=-lmsvcrt" ./x.py build --stage 1 src/libtest
$ ./x.py build --keep-stage 1 --stage 2 src/libtest # Should work with the patch, and fail without it
```

Issue https://github.com/rust-lang/rust/issues/47265

6 years agoRollup merge of #47481 - estebank:unused-args, r=arielb1
kennytm [Wed, 17 Jan 2018 17:57:25 +0000 (01:57 +0800)]
Rollup merge of #47481 - estebank:unused-args, r=arielb1

Point at unused arguments for format string

Avoid overlapping spans by only pointing at the arguments that are not
being used in the argument string. Enable libsyntax to have diagnostics
with multiple primary spans by accepting `Into<MultiSpan>` instead of
`Span`.

Partially addresses #41850.

6 years agoRollup merge of #47479 - zackmdavis:and_the_case_of_the_suggested_double-pub, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:24 +0000 (01:57 +0800)]
Rollup merge of #47479 - zackmdavis:and_the_case_of_the_suggested_double-pub, r=estebank

private no-mangle lints: only suggest `pub` if it doesn't already exist

Fixes #47383 (function or static can be `pub` but unreachable because it's in a private module; adding another `pub` is nonsensical).

r? @estebank

6 years agoRollup merge of #47467 - arielb1:cleanup-shims, r=eddyb
kennytm [Wed, 17 Jan 2018 17:57:23 +0000 (01:57 +0800)]
Rollup merge of #47467 - arielb1:cleanup-shims, r=eddyb

remove noop landing pads in cleanup shims

No-op landing pads are already removed in the normal optimization pipeline - so also removing them on the shim pipeline should slightly improve codegen performance, as these cleanup blocks are known to hurt LLVM.

This un-regresses and is therefore a fix for #47442. However, the reporter of that issue should try using `-C panic=abort` instead of carefully avoiding panics.

r? @eddyb

6 years agoRollup merge of #47458 - mark-i-m:lint_array_comma, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:22 +0000 (01:57 +0800)]
Rollup merge of #47458 - mark-i-m:lint_array_comma, r=estebank

Allow a trailing comma in lint_array

fix #47428

6 years agoRollup merge of #47456 - chrisvittal:nll-tests, r=nikomatsakis
kennytm [Wed, 17 Jan 2018 17:57:21 +0000 (01:57 +0800)]
Rollup merge of #47456 - chrisvittal:nll-tests, r=nikomatsakis

Add NLL test for #45045

cc #45045
Part of #47366

r? @nikomatsakis

6 years agoRollup merge of #47444 - etaoins:dont-include-bang-in-macro-suggestion, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:20 +0000 (01:57 +0800)]
Rollup merge of #47444 - etaoins:dont-include-bang-in-macro-suggestion, r=estebank

Don't include bang in macro replacement suggestion

When we suggest the replacement for a macro we include the "!" in the suggested replacement but the span only contains the name of the macro itself. Using that replacement would cause a duplicate "!" in the resulting code.

I originally tried to extend the span to be replaced by 1 byte in rust-lang/rust#47424. However, @zackmdavis pointed out that there can be whitespace between the macro name and the bang.

Instead, just remove the bang from the suggested replacement.

Fixes #47418

r? @estebank

6 years agoRollup merge of #47436 - GuillaumeGomez:up-html-diff, r=QuietMisdreavus
kennytm [Wed, 17 Jan 2018 17:57:19 +0000 (01:57 +0800)]
Rollup merge of #47436 - GuillaumeGomez:up-html-diff, r=QuietMisdreavus

Update html-diff crate => fix unicode parsing and invalid paths

r? @QuietMisdreavus

6 years agoRollup merge of #47427 - EdSchouten:cloudabi-ci, r=alexcrichton
kennytm [Wed, 17 Jan 2018 17:57:18 +0000 (01:57 +0800)]
Rollup merge of #47427 - EdSchouten:cloudabi-ci, r=alexcrichton

Add a Docker container for doing automated builds for CloudABI.

Setting up a cross compilation toolchain for CloudABI is relatively
easy. It's just a matter of installing a somewhat recent version of
Clang (5.0 preferred) and installing the corresponding
`${target}-cxx-runtime` package, containing a set of core C/C++ libraries
(libc, libc++, libunwind, etc).

Eventually it would be nice if we could also run `x.py test`. That,
however still requires some more work. Both libtest and compiletest
would need to be adjusted to deal with CloudABI's requirement of having
all of an application's dependencies injected. Let's settle for just
doing `x.py dist` for now.

6 years agoRollup merge of #47426 - varkor:default-mir-dump-dir, r=nikomatsakis
kennytm [Wed, 17 Jan 2018 17:57:17 +0000 (01:57 +0800)]
Rollup merge of #47426 - varkor:default-mir-dump-dir, r=nikomatsakis

Add a default directory for -Zmir-dump-dir

The current behaviour of dumping in the current directory is rarely
desirable: a sensible default directory for dumping is much more
convenient. This makes sets the default value for `-Zmir-dump-dir`
to `mir_dump/`.

r? @eddyb

6 years agoRollup merge of #47407 - gaurikholkar:master, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:16 +0000 (01:57 +0800)]
Rollup merge of #47407 - gaurikholkar:master, r=estebank

fix mispositioned span

This fixes #47377

The output now looks like this
```
error[E0369]: binary operation `+` cannot be applied to type `&str`
 --> h.rs:3:11
  |
3 |     let _a = b + ", World!";
  |              ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
  |
3 |     let _a = b.to_owned() + ", World!";
  |              ^^^^^^^^^

error: aborting due to previous error
```
For the case when emojis are involved,  it gives the new output for proper indentation.
But for an indentation as follows,
```
fn main() {
let b = "hello";
    let _a = b + ", World!";
}
```
it still mispositions the span
```
3 |     println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
  |                                           ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
  |
3 |     println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
  |                                           ^^^^^^^
error: aborting due to previous erro
```

cc @estebank  @est31

6 years agoRollup merge of #47404 - integer32llc:reexport-to-re-export, r=steveklabnik
kennytm [Wed, 17 Jan 2018 17:57:15 +0000 (01:57 +0800)]
Rollup merge of #47404 - integer32llc:reexport-to-re-export, r=steveklabnik

Standardize on "re-export" rather than "reexport"

While working on the book with our editors, it was brought to our attention that we're not consistent with when we use "re-export" versus "reexport". For the book, we've decided (with our editors) to go with "re-export"; in prose, I think that looks better. In code, I'm fine with "reexport".

However, the rustdoc generated section is currently "Reexports", so when we have a screenshot of generated documentation with the prose where we use "re-export", it's inconsistent.

It's too late to fix this for the book because we're using 1.21.0 for the output in the book, and it's really only one spot so it's not a huge deal, but I'd like to advocate for changing the documentation header so that a future edition of the book can be consistent.

The first commit here only changes the documentation section heading text and rustdoc documentation that references it. This is the commit that's most important to me.

The second commit changes error messages and associated tests to also be consistent with the use of re-export. This is the next most important commit to me, but I could be argued out of this one because then it won't match code like the `macro_reexports` feature name, which ostensibly should change to `macro_re_exports` to be most consistent but I didn't want to change code.

The last commit changes re-export anywhere else in prose: either in documentation comments or regular comments. This is least important as most of them aren't user-visible. Instances like these will likely sneak back in over time. I'm totally fine dropping this commit if anyone wants, but [the hobgoblins made me do it](http://www.bartleby.com/100/420.47.html) and it sets a good example.

r? @steveklabnik

6 years agoRollup merge of #47387 - Rantanen:linkchecker-error-msg, r=steveklabnik
kennytm [Wed, 17 Jan 2018 17:57:14 +0000 (01:57 +0800)]
Rollup merge of #47387 - Rantanen:linkchecker-error-msg, r=steveklabnik

Report errors instead of panic!() when linkcheck encounters absolute paths

The RBE contained some absolute links that failed the link check in #46196. Diagnosing these issues was needlessly complicated, thanks to the linkchecker just panicing instead of reporting proper errors.

This PR replaces the panic with a proper `*errors = true` + error message handling.

The linkchecker itself doesn't have any tests so I intentionally didn't touch anything else than the code that previously did the `panic!()`. A small code quality improvement might be made by binding the `Path::new(base).join(url)` into a variable before the for-loop and using this resolved url in both the for loop and the error message.

r? @steveklabnik

(If not for any other reason than having r on the #46196.)

6 years agoRollup merge of #47333 - arthurprs:iter-position-bounds-check, r=dtolnay
kennytm [Wed, 17 Jan 2018 17:57:13 +0000 (01:57 +0800)]
Rollup merge of #47333 - arthurprs:iter-position-bounds-check, r=dtolnay

Optimize slice.{r}position result bounds check

Second attempt of https://github.com/rust-lang/rust/pull/45501
Fixes https://github.com/rust-lang/rust/issues/45964

Demo: https://godbolt.org/g/N4mBHp

6 years agoRollup merge of #47302 - andjo403:commentfix, r=michaelwoerister
kennytm [Wed, 17 Jan 2018 17:57:12 +0000 (01:57 +0800)]
Rollup merge of #47302 - andjo403:commentfix, r=michaelwoerister

fix faulty comment

after #43506 there is no fixed number of request sent.

6 years agoUse File::metadata instead of fs::metadata to choose buffer size
Matt Brubeck [Wed, 17 Jan 2018 16:37:03 +0000 (08:37 -0800)]
Use File::metadata instead of fs::metadata to choose buffer size

This replaces a `stat` syscall with `fstat` or similar, which can be
faster.  Fixes #47519.

6 years agowhitelist x86 fxsr feature
gnzlbg [Wed, 17 Jan 2018 11:21:14 +0000 (12:21 +0100)]
whitelist x86 fxsr feature