]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoFix panic strings.
Dan Robertson [Wed, 10 Jan 2018 03:07:33 +0000 (03:07 +0000)]
Fix panic strings.

 - Fix panic string in `check_ast_crate`.

6 years agoAuto merge of #47269 - michaelwoerister:mangled-cgu-names, r=alexcrichton
bors [Tue, 9 Jan 2018 16:04:21 +0000 (16:04 +0000)]
Auto merge of #47269 - michaelwoerister:mangled-cgu-names, r=alexcrichton

Shorten names of some compiler generated artifacts.

This PR makes the compiler mangle codegen unit names by default. The name of every codegen unit name will now be a random string of 16 characters. It also makes the file extensions of some intermediate compiler products shorter. Hopefully, these changes will reduce the pressure on tools with path length restrictions like buildbot. The change should also solve problems with case-insensitive file system.

cc #47186 and #47222

r? @alexcrichton

6 years agoAuto merge of #47231 - ereslibre:clean-emitted-diagnostics, r=nrc
bors [Tue, 9 Jan 2018 07:12:08 +0000 (07:12 +0000)]
Auto merge of #47231 - ereslibre:clean-emitted-diagnostics, r=nrc

Clean emitted diagnostics when `reset_err_count` is called.

When external tools like `rustfmt` calls to `reset_err_count` for handler
reusing, it will set the error count on the handler to 0, but since
https://github.com/rust-lang/rust/pull/47146 the handler will contain
status that will prevent the error count to be bumped if this handler is
reused.

This caused `rustfmt` idempotency tests to fail:
https://github.com/rust-lang-nursery/rustfmt/issues/2338

Fixes: https://github.com/rust-lang-nursery/rustfmt/issues/2338
6 years agoAuto merge of #47276 - kennytm:rollup, r=kennytm
bors [Tue, 9 Jan 2018 04:22:50 +0000 (04:22 +0000)]
Auto merge of #47276 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #47210, #47233, #47246, #47254, #47256, #47258, #47259, #47263, #47270, #47272
- Failed merges: #47248

6 years agoRollup merge of #47272 - GuillaumeGomez:missing-links, r=QuietMisdreavus
kennytm [Mon, 8 Jan 2018 17:58:55 +0000 (01:58 +0800)]
Rollup merge of #47272 - GuillaumeGomez:missing-links, r=QuietMisdreavus

Add missing links

r? @QuietMisdreavus

(please wait for CI, I have a few doubts about the `Write` trait links...)

6 years agoRollup merge of #47270 - Zoxc:gen-layout-fix, r=eddyb
kennytm [Mon, 8 Jan 2018 17:58:54 +0000 (01:58 +0800)]
Rollup merge of #47270 - Zoxc:gen-layout-fix, r=eddyb

Don't look for niches inside generator types. Fixes #47253

r? @eddyb

6 years agoRollup merge of #47263 - ollie27:rustdoc_private_macro_import, r=GuillaumeGomez
kennytm [Mon, 8 Jan 2018 17:58:53 +0000 (01:58 +0800)]
Rollup merge of #47263 - ollie27:rustdoc_private_macro_import, r=GuillaumeGomez

rustdoc: Don't import macros from private imports

Fixes #47038

6 years agoRollup merge of #47259 - sfackler:map-remove-entry, r=dtolnay
kennytm [Mon, 8 Jan 2018 17:58:52 +0000 (01:58 +0800)]
Rollup merge of #47259 - sfackler:map-remove-entry, r=dtolnay

Add HashMap::remove_entry

Implements #46344

r? @dtolnay

6 years agoRollup merge of #47258 - rkruppe:struct-assert, r=eddyb
kennytm [Mon, 8 Jan 2018 17:58:51 +0000 (01:58 +0800)]
Rollup merge of #47258 - rkruppe:struct-assert, r=eddyb

rustc::ty: Rename struct_variant to non_enum_variant

r? @eddyb

6 years agoRollup merge of #47256 - rkruppe:misc-cleanup, r=eddyb
kennytm [Mon, 8 Jan 2018 17:58:50 +0000 (01:58 +0800)]
Rollup merge of #47256 - rkruppe:misc-cleanup, r=eddyb

Rename ReprExtern to ReprC

… and similarily rename a few other field and locals that mentioned "extern repr".

6 years agoRollup merge of #47254 - rkruppe:no-more-align-hack, r=alexcrichton
kennytm [Mon, 8 Jan 2018 17:58:49 +0000 (01:58 +0800)]
Rollup merge of #47254 - rkruppe:no-more-align-hack, r=alexcrichton

Replace empty array hack with repr(align)

As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since #47111 (see also: #47103)

r? @alexcrichton

6 years agoRollup merge of #47246 - aidanhs:aphs-wasm-backtrace-feature, r=KodrAus
kennytm [Mon, 8 Jan 2018 17:58:47 +0000 (01:58 +0800)]
Rollup merge of #47246 - aidanhs:aphs-wasm-backtrace-feature, r=KodrAus

Make wasm obey backtrace feature, like other targets

E.g. https://github.com/rust-lang/rust/blob/6828cf90146c7fefc4ba4f16dffe75f763f2d910/src/libstd/sys/unix/mod.rs#L40-L41

6 years agoRollup merge of #47233 - dotdash:cleanup_llvm, r=alexcrichton
kennytm [Mon, 8 Jan 2018 17:58:46 +0000 (01:58 +0800)]
Rollup merge of #47233 - dotdash:cleanup_llvm, r=alexcrichton

Remove unused LLVM related code

Ticks a few more boxes on #46437

6 years agoRollup merge of #47210 - zackmdavis:the_3rd_of_2_hardest_problems_in_computer_science...
kennytm [Mon, 8 Jan 2018 17:58:45 +0000 (01:58 +0800)]
Rollup merge of #47210 - zackmdavis:the_3rd_of_2_hardest_problems_in_computer_science, r=QuietMisdreavus

fix the doc-comment-decoration-trimming edge-case rustdoc ICE

This `horizontal_trim` function strips the leading whitespace from
doc-comments that have a left-asterisk-margin:

```
  /**
   * You know what I mean—
   *
   * comments like this!
   */
```

The index of the column of asterisks is `i`, and if trimming is deemed
possible, we slice each line from `i+1` to the end of the line. But if, in
particular, `i` was 0 _and_ there was an empty line (as in the example
given in the reporting issue), we ended up panicking trying to slice an
empty string from 0+1 (== 1).

Let's tighten our check to say that we can't trim when `i` is even the same
as the length of the line, not just when it's greater. (Any such cases
would panic trying to slice `line` from `line.len()+1`.)

Resolves #47197.

6 years agoClean emitted diagnostics when `reset_err_count` is called.
Rafael Fernández López [Sat, 6 Jan 2018 12:33:20 +0000 (13:33 +0100)]
Clean emitted diagnostics when `reset_err_count` is called.

When external tools like `rustfmt` calls to `reset_err_count` for handler
reusing, it will set the error count on the handler to 0, but since
https://github.com/rust-lang/rust/pull/47146 the handler will contain
status that will prevent the error count to be bumped if this handler is
reused.

This caused `rustfmt` idempotency tests to fail:
https://github.com/rust-lang-nursery/rustfmt/issues/2338

Fixes: https://github.com/rust-lang-nursery/rustfmt/issues/2338
6 years agoAuto merge of #47208 - Manishearth:double-ended-searcher, r=pnkfelix
bors [Mon, 8 Jan 2018 14:32:25 +0000 (14:32 +0000)]
Auto merge of #47208 - Manishearth:double-ended-searcher, r=pnkfelix

Make double ended searchers use dependent fingers

(fixes #47175)

r? @burntsushi @alexcrichton

needs uplift to beta

6 years agoAdd missing links
Guillaume Gomez [Mon, 8 Jan 2018 13:16:16 +0000 (14:16 +0100)]
Add missing links

6 years agoDon't look for niches inside generator types. Fixes #47253
John Kåre Alsaker [Mon, 8 Jan 2018 12:18:50 +0000 (13:18 +0100)]
Don't look for niches inside generator types. Fixes #47253

6 years agoShorten names of some compiler generated artifacts.
Michael Woerister [Mon, 8 Jan 2018 11:30:52 +0000 (12:30 +0100)]
Shorten names of some compiler generated artifacts.

6 years agoAuto merge of #47232 - keatinge:master, r=petrochenkov
bors [Mon, 8 Jan 2018 07:11:47 +0000 (07:11 +0000)]
Auto merge of #47232 - keatinge:master, r=petrochenkov

Add help message for incorrect pattern syntax

When I was getting started with rust I often made the mistake of using `||` instead of `|` to match multiple patterns and spent a long time staring at my code wondering what was wrong.

for example:

```
fn main() {
    let x = 1;

    match x {
        1 || 2 => println!("1 or 2"),
        _ => println!("Something else"),
    }
}

```

If you compile this with current rustc you will see

```
error: expected one of `...`, `..=`, `..`, `=>`, `if`, or `|`, found `||`
 --> test.rs:5:11
  |
5 |         1 || 2 => println!("1 or 2"),
  |          -^^ unexpected token
  |          |
  |          expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` here

error: aborting due to previous error
```

With my proposed change it will show:
```
error: unexpected token `||` after pattern
 --> test.rs:5:11
  |
5 |         1 || 2 => println!("1 or 2"),
  |           ^^
  |
  = help: did you mean to use `|` to specify multiple patterns instead?

error: aborting due to previous error
```

6 years agoAuto merge of #47200 - BurntPizza:query-snatp, r=nikomatsakis
bors [Mon, 8 Jan 2018 04:31:18 +0000 (04:31 +0000)]
Auto merge of #47200 - BurntPizza:query-snatp, r=nikomatsakis

Make normalize_and_test_predicates into a query

From #44891.

I'm not real solid on how `dep_graph` stuff works, but if a node is going to have a key (again, not sure how important that is), then the key needs to be `Copy`. So since `normalize_and_test_predicates` only had one out-of-module use, I changed that call site to use a new function, `substitute_normalize_and_test_predicates` which is the query and enables having the arguments be `Copy`. Hopefully this makes sense.

r? @nikomatsakis
and/or @michaelwoerister

6 years agorustdoc: Don't import macros from private imports
Oliver Middleton [Mon, 8 Jan 2018 03:39:25 +0000 (03:39 +0000)]
rustdoc: Don't import macros from private imports

6 years agorustc::ty: Rename `struct_variant` to `non_enum_variant`
Robin Kruppe [Sun, 7 Jan 2018 21:41:41 +0000 (22:41 +0100)]
rustc::ty: Rename `struct_variant` to `non_enum_variant`

It is also intended for use with unions.

6 years agoAuto merge of #47171 - estebank:numeric-literal-suggestion, r=nikomatsakis
bors [Sun, 7 Jan 2018 22:48:16 +0000 (22:48 +0000)]
Auto merge of #47171 - estebank:numeric-literal-suggestion, r=nikomatsakis

Provide suggestion when trying to use method on numeric literal

New output:

```
error[E0688]: can't call method `powi` on ambiguous numeric type `{float}`
  --> $DIR/method-on-ambiguous-numeric-type.rs:12:17
   |
12 |     let x = 2.0.powi(2);
   |                 ^^^^
help: you must specify a concrete type for this numeric value, like `f32`
   |
12 |     let x = 2.0_f32.powi(2);
   |             ^^^^^^^
```

Previous output:

```
error[E0599]: no method named `powi` found for type `{float}` in the current scope
  --> src/main.rs:12:17
   |
12 |     let x = 2.0.powi(2);
   |                 ^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
   |
11 | use core::num::Float;
   |
```

Fix #40985.

6 years agoAdd HashMap::remove_entry
Steven Fackler [Sun, 7 Jan 2018 22:17:37 +0000 (14:17 -0800)]
Add HashMap::remove_entry

Implements #46344

6 years agoRename ReprExtern to ReprC, and similarily rename a few other fields and locals that...
Robin Kruppe [Sun, 7 Jan 2018 21:05:32 +0000 (22:05 +0100)]
Rename ReprExtern to ReprC, and similarily rename a few other fields and locals that mentioned "extern repr"

6 years agoReplace empty array hack with repr(align)
Robin Kruppe [Sun, 7 Jan 2018 19:19:51 +0000 (20:19 +0100)]
Replace empty array hack with repr(align)

As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since #47111 (see also: #47103)

6 years agoAuto merge of #47161 - MaloJaffre:compiler-docs-regression, r=alexcrichton
bors [Sun, 7 Jan 2018 18:50:30 +0000 (18:50 +0000)]
Auto merge of #47161 - MaloJaffre:compiler-docs-regression, r=alexcrichton

Try to fix a perf regression by updating log

Upgrade `log` to `0.4` in multiple crates ~and `cargo`~.
Cc: #47154.
6 years agoTry to fix a perf regression by updating log
Malo Jaffré [Sun, 7 Jan 2018 15:54:05 +0000 (16:54 +0100)]
Try to fix a perf regression by updating log

Upgrade `log` to `0.4` in multiple crates.

6 years agoAuto merge of #47039 - ollie27:rustdoc_trait_impl_src, r=GuillaumeGomez
bors [Sun, 7 Jan 2018 13:12:15 +0000 (13:12 +0000)]
Auto merge of #47039 - ollie27:rustdoc_trait_impl_src, r=GuillaumeGomez

rustdoc: Add missing src links for generic impls on trait pages

`implementor2item` would return `None` for generic impls so instead this clones the entire `clean::Item` into the `implementors` map which simplifies some code.

6 years agoAuto merge of #47177 - michaelwoerister:erase-invalid-spans-during-metadata-encoding...
bors [Sun, 7 Jan 2018 09:23:33 +0000 (09:23 +0000)]
Auto merge of #47177 - michaelwoerister:erase-invalid-spans-during-metadata-encoding, r=alexcrichton

Map invalid Spans to DUMMY_SP during crate metadata encoding.

This mirrors what we do for stabilizing the incr. comp. cache and is necessary for reproducible builds. For the incr. comp. cache, we *have* to do this because the encoding there cannot represent broken Spans. Metadata encoding has to be in sync with that as not to get unexpected interactions when compiling incrementally.

This should help with fixing issue https://github.com/rust-lang/rust/issues/47066.

r? @alexcrichton

6 years agoAuto merge of #47157 - malbarbo:shared-build-musl, r=alexcrichton
bors [Sun, 7 Jan 2018 03:41:00 +0000 (03:41 +0000)]
Auto merge of #47157 - malbarbo:shared-build-musl, r=alexcrichton

ci: use a shared script to build musl

The dist-x86_64-musl, dist-various-1 and dist-i586-gnu-i686-musl builders had different scripts to build musl. This PR creates an unified script, which makes it easier to add new musl targets and update musl and libunwind (used in the musl targets).

The libunwind is update from 3.7 to 3.9 for dist-x86_64-musl and dist-i586-gnu-i686-musl (dist-various-1 already used 3.9 version).

6 years agoRemove unused LLVMRustJITMemoryManagerRef typedef
Björn Steinbrink [Sat, 6 Jan 2018 11:38:52 +0000 (12:38 +0100)]
Remove unused LLVMRustJITMemoryManagerRef typedef

6 years agoRemove dead function rustc_llvm::debug_loc_to_string()
Björn Steinbrink [Fri, 5 Jan 2018 14:22:35 +0000 (15:22 +0100)]
Remove dead function rustc_llvm::debug_loc_to_string()

Refs #46437 as it also removes LLVMRustWriteDebugLocToString()

6 years agoRemove dead function LLVMRustLinkInParsedExternalBitcode()
Björn Steinbrink [Fri, 5 Jan 2018 13:28:50 +0000 (14:28 +0100)]
Remove dead function LLVMRustLinkInParsedExternalBitcode()

Refs #46437

6 years agoRemove redundant -Zdebug-llvm option
Björn Steinbrink [Fri, 5 Jan 2018 13:27:20 +0000 (14:27 +0100)]
Remove redundant -Zdebug-llvm option

The same effect can be achieved using -Cllvm-args=-debug

Refs #46437 as it removes LLVMRustSetDebug()

6 years agoMake wasm obey backtrace feature, like other targets
Aidan Hobson Sayers [Sun, 7 Jan 2018 02:54:02 +0000 (02:54 +0000)]
Make wasm obey backtrace feature, like other targets

6 years agoAuto merge of #47156 - petrochenkov:extpath, r=nikomatsakis
bors [Sun, 7 Jan 2018 00:51:42 +0000 (00:51 +0000)]
Auto merge of #47156 - petrochenkov:extpath, r=nikomatsakis

Support `extern` in paths

Implement the primary alternative to https://github.com/rust-lang/rust/pull/46613 + https://github.com/rust-lang/rust/pull/45771, achieving the same effect without requiring changes to other imports.
Both need to be experimentally evaluated before making further progress.

The PR also adds docs for all these related features into the unstable book.

cc https://github.com/rust-lang/rust/issues/44660
r? @nikomatsakis

6 years agoAuto merge of #47235 - kennytm:rollup, r=kennytm
bors [Sat, 6 Jan 2018 20:41:33 +0000 (20:41 +0000)]
Auto merge of #47235 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

- Successful merges: #46947, #47170, #47190, #47205, #47217, #47220, #47230
- Failed merges: #47233

6 years agoFix tidy error
keatinge [Sat, 6 Jan 2018 20:29:08 +0000 (15:29 -0500)]
Fix tidy error

6 years agoUse span_suggestion instead of span_err_help
keatinge [Sat, 6 Jan 2018 20:22:29 +0000 (15:22 -0500)]
Use span_suggestion instead of span_err_help

6 years agowherein careful doc-decoration arithmetic proves quite the ICE-breaker
Zack M. Davis [Fri, 5 Jan 2018 07:09:02 +0000 (23:09 -0800)]
wherein careful doc-decoration arithmetic proves quite the ICE-breaker

This `horizontal_trim` function strips the leading whitespace from
doc-comments that have a left-asterisk-margin:

  /**
   * You know what I mean—
   *
   * comments like this!
   */

The index of the column of asterisks is `i`, and if trimming is deemed
possible, we slice each line from `i+1` to the end of the line. But if, in
particular, `i` was 0 _and_ there was an empty line (as in the example
given in the reporting issue), we ended up panicking trying to slice an
empty string from 0+1 (== 1).

Let's tighten our check to say that we can't trim when `i` is even the same
as the length of the line, not just when it's greater. (Any such cases
would panic trying to slice `line` from `line.len()+1`.)

Resolves #47197.

6 years agoRollup merge of #47230 - nerd2:debuginfo_shadow, r=alexcrichton
kennytm [Sat, 6 Jan 2018 18:36:07 +0000 (02:36 +0800)]
Rollup merge of #47230 - nerd2:debuginfo_shadow, r=alexcrichton

Debuginfo Shadowed Variable test: fix check numbering

Appears to be a simple fix to restore this test. Ref issue #47163, CC @arielb1

6 years agoRollup merge of #47220 - nagisa:nonamellvm, r=rkruppe
kennytm [Sat, 6 Jan 2018 18:36:06 +0000 (02:36 +0800)]
Rollup merge of #47220 - nagisa:nonamellvm, r=rkruppe

Use name-discarding LLVM context

This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not
requested.

In case either of these outputs are wanted, but the benefits of such context are
desired as well, -Zfewer_names option provides the same functionality regardless
of the outputs requested.

Should be a viable fix for https://github.com/rust-lang/rust/issues/46449

6 years agoRollup merge of #47217 - stjepang:set-examples, r=frewsxcv
kennytm [Sat, 6 Jan 2018 18:36:05 +0000 (02:36 +0800)]
Rollup merge of #47217 - stjepang:set-examples, r=frewsxcv

Write examples for {BTree,Hash}Set::{get,replace,take}

6 years agoRollup merge of #47205 - eddyb:alloc-id, r=oli-obk
kennytm [Sat, 6 Jan 2018 18:36:04 +0000 (02:36 +0800)]
Rollup merge of #47205 - eddyb:alloc-id, r=oli-obk

miri: use AllocId instead of u64.

This makes @alexreg's miri allocation -> LLVM global translation more straight-forward.

r? @oli-obk

6 years agoRollup merge of #47190 - EdSchouten:cloudabi-libpanic, r=alexcrichton
kennytm [Sat, 6 Jan 2018 18:36:03 +0000 (02:36 +0800)]
Rollup merge of #47190 - EdSchouten:cloudabi-libpanic, r=alexcrichton

Port libpanic_abort and libpanic_unwind to CloudABI

This change ports both the libpanic* libraries to CloudABI.

The most interesting part of this pull request, however, is that it imports the CloudABI system call API into the Rust tree through a Git submodule. These will also be used by my port of libstd to CloudABI extensively, as that library obviously needs to invoke system calls to implement its primitives.

I have taken the same approach as libc: `src/libcloudabi` + `src/rustc/cloudabi_shim`. If some other naming scheme is preferred, feel free to let me know! As `libcloudabi` is pretty small, maybe it makes sense to copy, instead of using a submodule?

6 years agoRollup merge of #47170 - eddyb:us-vs-usize, r=nikomatsakis
kennytm [Sat, 6 Jan 2018 18:36:02 +0000 (02:36 +0800)]
Rollup merge of #47170 - eddyb:us-vs-usize, r=nikomatsakis

rustc: use {U,I}size instead of {U,I}s shorthands.

`Us`/`Is` come from a time when `us` and `is` were the literal suffixes that are now `usize` / `isize`.

r? @nikomatsakis

6 years agoRollup merge of #46947 - tspiteri:checked-div-rem-none, r=frewsxcv
kennytm [Sat, 6 Jan 2018 18:36:01 +0000 (02:36 +0800)]
Rollup merge of #46947 - tspiteri:checked-div-rem-none, r=frewsxcv

doc: improve None condition doc for `checked_div` and `checked_rem`

This commit improves the condition mentioned in the docs for which `checked_div` and `checked_rem` return `None`.

For signed division, the commit changes "the operation results in overflow" to "the division results in overflow", otherwise there is room for misinterpretation for `checked_rem`: Without considering overflow, `MIN % -1` would be simply zero, allowing the misinterpretation that "the operation" does not result in overflow in this case. This ambiguity is removed using "when the division results in overflow".

For unsigned division, the condition for `None` should be simply when `rhs == 0`, as no other overflow is possible.

6 years agoAdd tests for error message for pattern matching typo
keatinge [Sat, 6 Jan 2018 17:34:19 +0000 (12:34 -0500)]
Add tests for error message for pattern matching typo

6 years agofix style
keatinge [Sat, 6 Jan 2018 15:05:02 +0000 (10:05 -0500)]
fix style

6 years agoEmit non-fatal error instead
keatinge [Sat, 6 Jan 2018 15:01:54 +0000 (10:01 -0500)]
Emit non-fatal error instead

6 years agoAuto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichton
bors [Sat, 6 Jan 2018 14:50:14 +0000 (14:50 +0000)]
Auto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichton

Bump to 1.25.0

* Bump the release version to 1.25
* Bump the bootstrap compiler to the recent beta
* Allow using unstable rustdoc features on beta - this fix has been applied to
  the beta branch but needed to go to the master branch as well.

6 years agofix capitalization
keatinge [Sat, 6 Jan 2018 13:37:01 +0000 (08:37 -0500)]
fix capitalization

6 years agoAdd help message for incorrect pattern syntax
keatinge [Sat, 6 Jan 2018 12:41:36 +0000 (07:41 -0500)]
Add help message for incorrect pattern syntax

6 years agoAuto merge of #47099 - SergioBenitez:master, r=jseyfried
bors [Sat, 6 Jan 2018 12:02:36 +0000 (12:02 +0000)]
Auto merge of #47099 - SergioBenitez:master, r=jseyfried

Add 'Span::parent()' and 'Span::source()' to proc_macro API.

As the title suggests: a couple of useful methods for `proc_macro`.

6 years agoDebuginfo Shadowed Variable test: fix check numbering
Sam [Sat, 6 Jan 2018 11:05:31 +0000 (11:05 +0000)]
Debuginfo Shadowed Variable test: fix check numbering

6 years agoAuto merge of #47083 - CAD97:issue-46976, r=nikomatsakis
bors [Sat, 6 Jan 2018 09:22:16 +0000 (09:22 +0000)]
Auto merge of #47083 - CAD97:issue-46976, r=nikomatsakis

Issue 46976

ICE is due to an empty path segments, so I set the path to be the same as the in band ty params symbol. (I think this is how regular generics end up being handled?)

Pinging @cramertj, this is your code I'm editing here.

6 years agoRegression tests for #47175
Manish Goregaokar [Fri, 5 Jan 2018 05:41:39 +0000 (11:11 +0530)]
Regression tests for #47175

6 years agoMake double ended string searchers use dependent fingers (fixes #47175)
Manish Goregaokar [Fri, 5 Jan 2018 05:41:30 +0000 (11:11 +0530)]
Make double ended string searchers use dependent fingers (fixes #47175)

6 years agoAuto merge of #47155 - nerd2:debuginfo_test_fix, r=alexcrichton
bors [Sat, 6 Jan 2018 05:20:22 +0000 (05:20 +0000)]
Auto merge of #47155 - nerd2:debuginfo_test_fix, r=alexcrichton

Restore working debuginfo tests by trimming comments from non-header directive lines

I noticed when adding a debuginfo test that nothing I did caused the test to fail. Tracing back this seems to have been caused by 3e6c83de1dc0a72df3663617d394a9e79641618d which broke parsing of the command/check lines, leaving all tests passing without any checking. This commit provides a basic (although still not very robust) restoration of tests and a should-fail test which checks the parser is running

6 years agoAuto merge of #47225 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sat, 6 Jan 2018 02:36:41 +0000 (02:36 +0000)]
Auto merge of #47225 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

- Successful merges: #46987, #47165, #47173, #47202, #47216
- Failed merges:

6 years agoRollup merge of #47216 - SergioBenitez:doc-fix, r=Mark-Simulacrum
Guillaume Gomez [Sat, 6 Jan 2018 01:13:36 +0000 (02:13 +0100)]
Rollup merge of #47216 - SergioBenitez:doc-fix, r=Mark-Simulacrum

Clarify appending behavior of 'io::Read::read_to_string()'.

A simple doc clarification.

6 years agoRollup merge of #47202 - GuillaumeGomez:fix-defocus, r=QuietMisdreavus
Guillaume Gomez [Sat, 6 Jan 2018 01:13:35 +0000 (02:13 +0100)]
Rollup merge of #47202 - GuillaumeGomez:fix-defocus, r=QuietMisdreavus

Fix search bar defocus

Fixes #47134.

r? @QuietMisdreavus

6 years agoRollup merge of #47173 - dotdash:cleanup, r=michaelwoerister
Guillaume Gomez [Sat, 6 Jan 2018 01:13:34 +0000 (02:13 +0100)]
Rollup merge of #47173 - dotdash:cleanup, r=michaelwoerister

Remove some outdated LLVM-related code

Ticks two boxes on #46437

6 years agoRollup merge of #47165 - mbrubeck:args, r=alexcrichton
Guillaume Gomez [Sat, 6 Jan 2018 01:13:33 +0000 (02:13 +0100)]
Rollup merge of #47165 - mbrubeck:args, r=alexcrichton

[unix] Don't clone command-line args on startup

Fixes part of #47164 and simplifies the `args` code on non-Apple Unix platforms.

Note: This could change behavior for programs that use both `std::env::args` *and* unsafe code that mutates `argv` directly.  However, these programs already behave differently on different platforms.  The new behavior on non-Apple platforms is closer to the existing behavior on Apple platforms.

6 years agoRollup merge of #46987 - frewsxcv:frewsxcv-current-exe, r=QuietMisdreavus
Guillaume Gomez [Sat, 6 Jan 2018 01:13:32 +0000 (02:13 +0100)]
Rollup merge of #46987 - frewsxcv:frewsxcv-current-exe, r=QuietMisdreavus

Minor rewrite of env::current_exe docs; clarify symlinks.

- Update example in ‘security’ section to use hard links, like the
  linked securityvulns.com example.
- Weaken language on symbolic links – indicate behavior is
  platform-specific

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

6 years agoLet libpanic_abort call into libc's abort() on CloudABI.
Ed Schouten [Fri, 5 Jan 2018 21:16:54 +0000 (22:16 +0100)]
Let libpanic_abort call into libc's abort() on CloudABI.

Ideally, we should make use of CloudABI's internal proc_raise(SIGABRT)
system call. POSIX abort() requires things like flushing of stdios,
which may not be what we want under panic conditions. Invoking the raw
CloudABI system call would have prevented that.

Unfortunately, we have to make use of the "cloudabi" crate to invoke raw
CloudABI system calls. This is undesired, as discussed in the pull
request (#47190).

6 years agorustc: Don't ICE if we invalidate an invalid incr dir
Alex Crichton [Fri, 5 Jan 2018 18:07:36 +0000 (10:07 -0800)]
rustc: Don't ICE if we invalidate an invalid incr dir

This showed up on the Windows bot for testing this PR, and this pr allows
`mark_incr_comp_session_as_invalid` ok if it's already invalid, hopefully
avoiding scary ICEs and instead leaving the nicely printed errors

6 years agoUse name-discarding LLVM context
Simonas Kazlauskas [Thu, 4 Jan 2018 20:19:23 +0000 (22:19 +0200)]
Use name-discarding LLVM context

This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not
requested.

In case either of these outputs are wanted, but the benefits of such context are
desired as well, -Zfewer_names option provides the same functionality regardless
of the outputs requested.

6 years agoAuto merge of #47142 - sdroege:trusted-random-access-chunks, r=kennytm
bors [Fri, 5 Jan 2018 14:17:04 +0000 (14:17 +0000)]
Auto merge of #47142 - sdroege:trusted-random-access-chunks, r=kennytm

Implement TrustedRandomAccess for slice::{Chunks, ChunksMut, Windows}

As suggested by @bluss in https://github.com/rust-lang/rust/issues/47115#issuecomment-354888334

6 years agoWrite examples for {BTree,Hash}Set::{get,replace,take}
Stjepan Glavina [Fri, 5 Jan 2018 14:02:10 +0000 (15:02 +0100)]
Write examples for {BTree,Hash}Set::{get,replace,take}

6 years agoClarify appending behavior of 'io::Read::read_to_string()'.
Sergio Benitez [Fri, 5 Jan 2018 12:24:12 +0000 (04:24 -0800)]
Clarify appending behavior of 'io::Read::read_to_string()'.

6 years agoDisable failing tests temporarily
Sam [Wed, 3 Jan 2018 18:24:25 +0000 (18:24 +0000)]
Disable failing tests temporarily

6 years agoAuto merge of #47214 - kennytm:rollup, r=kennytm
bors [Fri, 5 Jan 2018 10:07:47 +0000 (10:07 +0000)]
Auto merge of #47214 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #47030, #47033, #47110, #47149, #47150, #47160, #47162, #47182, #47198, #47199
- Failed merges:

6 years agoRollup merge of #47199 - alexcrichton:stable-no-dev, r=kennytm
kennytm [Fri, 5 Jan 2018 09:22:13 +0000 (17:22 +0800)]
Rollup merge of #47199 - alexcrichton:stable-no-dev, r=kennytm

rustbuild: Don't allow stable bootstrap from dev

I forgot to update the bootstrap compiler for the 1.23.0 release so let's make
sure it doesn't happen again!

6 years agoRollup merge of #47198 - dzamlo:patch-2, r=frewsxcv
kennytm [Fri, 5 Jan 2018 09:22:12 +0000 (17:22 +0800)]
Rollup merge of #47198 - dzamlo:patch-2, r=frewsxcv

Fix an error in std::process documentation

6 years agoRollup merge of #47182 - aheart:master, r=steveklabnik
kennytm [Fri, 5 Jan 2018 09:22:11 +0000 (17:22 +0800)]
Rollup merge of #47182 - aheart:master, r=steveklabnik

Equivalent example for ? operator

The example with the ? operator in the documentation for try! macro was missing file.write_all.
Now all three examples are consistent.

6 years agoRollup merge of #47162 - stjepang:cleanup-btreeset, r=alexcrichton
kennytm [Fri, 5 Jan 2018 09:22:10 +0000 (17:22 +0800)]
Rollup merge of #47162 - stjepang:cleanup-btreeset, r=alexcrichton

Remove `T: Ord` bound from `BTreeSet::{is_empty, len}`

This change makes the API for `BTreeSet` more consistent with `BTreeMap`, where `BTreeMap::{is_empty, len}` don't require `T: Ord` either.

Also, it reduces the number of `impl`s for `BTreeSet`, making the generated documentation look much cleaner. Closes #47138.

cc @rust-lang/libs

6 years agoRollup merge of #47160 - rust-lang:steveklabnik-patch-1, r=alexcrichton
kennytm [Fri, 5 Jan 2018 09:22:09 +0000 (17:22 +0800)]
Rollup merge of #47160 - rust-lang:steveklabnik-patch-1, r=alexcrichton

This isn't in Rust 1.23

r? @alexcrichton

6 years agoRollup merge of #47150 - dtolnay:join, r=jseyfried
kennytm [Fri, 5 Jan 2018 09:22:08 +0000 (17:22 +0800)]
Rollup merge of #47150 - dtolnay:join, r=jseyfried

Return None from Span::join if in different files

Fixes #47148. r? @abonander

6 years agoRollup merge of #47149 - dtolnay:spans, r=jseyfried
kennytm [Fri, 5 Jan 2018 09:22:07 +0000 (17:22 +0800)]
Rollup merge of #47149 - dtolnay:spans, r=jseyfried

Span::resolved_at and Span::located_at to combine behavior of two spans

Proc macro spans serve two mostly unrelated purposes: controlling name resolution and controlling error messages. It can be useful to mix the name resolution behavior of one span with the line/column error message locations of a different span.

In particular, consider the case of a trait brought into scope within the def_site of a custom derive. I want to invoke trait methods on the fields of the user's struct. If the field type does not implement the right trait, I want the error message to underline the corresponding struct field.

Generating the method call with the def_site span is not ideal -- it compiles and runs but error messages sadly always point to the derive attribute like we saw with Macros 1.1.

```
  |
4 | #[derive(HeapSize)]
  |          ^^^^^^^^
```

Generating the method call with the same span as the struct field's ident or type is not correct -- it shows the right underlines but fails to resolve to the trait in scope at the def_site.

```
  |
7 |     bad: std::thread::Thread,
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
```

The correct span for the method call is one that combines the def_site's name resolution with the struct field's line/column.

```rust
field.span.resolved_at(Span::def_site())

// equivalently
Span::def_site().located_at(field.span)
```

Adding both because which one is more natural will depend on context.

Addresses https://github.com/rust-lang/rust/issues/38356#issuecomment-354947143. r? @jseyfried

6 years agoRollup merge of #47110 - EdSchouten:cloudabi-tls, r=kennytm
kennytm [Fri, 5 Jan 2018 09:22:06 +0000 (17:22 +0800)]
Rollup merge of #47110 - EdSchouten:cloudabi-tls, r=kennytm

Use the right TLS model for CloudABI.

CloudABI doesn't do dynamic linking. For this reason, there is no need
to handle any other TLS model than local-exec. CloudABI's C library
doesn't provide a __tls_get_addr() function to do Dynamic TLS.

By forcing local-exec to be used here, we ensure that we don't generate
function calls to __tls_get_addr().

6 years agoRollup merge of #47033 - EdSchouten:cloudabi-oom, r=kennytm
kennytm [Fri, 5 Jan 2018 09:22:05 +0000 (17:22 +0800)]
Rollup merge of #47033 - EdSchouten:cloudabi-oom, r=kennytm

Disable printing of error message on file descriptor 2 on CloudABI.

As CloudABI is a capability-based runtime environment, file descriptors
are the mechanism that grants rights to a process. These file
descriptors may be passed into processes on startup using a utility
called cloudabi-run. Unlike the POSIX shell, cloudabi-run does not
follow the UNIX model where file descriptors 0, 1 and 2 represent stdin,
stdout and stderr. There can be arbitrary many (or few) file descriptors
that can be provided. For this reason, CloudABI's C library also doesn't
define STD*_FILENO. liblibc should also not declare these.

Disable the code in liballoc_system that tries to print error messages
over file descriptor 2. For now, let's keep this function quiet. We'll
see if we can think of some other way to log this in the future.

6 years agoRollup merge of #47030 - ollie27:stab, r=alexcrichton
kennytm [Fri, 5 Jan 2018 09:22:04 +0000 (17:22 +0800)]
Rollup merge of #47030 - ollie27:stab, r=alexcrichton

Correct a few stability attributes

* The extra impls for `ManuallyDrop` were added in #44310 which was only stabilised in 1.22.0.
* The impls for `SliceIndex` were stabilised in #43373 but as `RangeInclusive` and `RangeToInclusive` are still unstable the impls should remain unstable.
* The `From` impls for atomic integers were added in #45610 but most atomic integers are still unstable.
* The `shared_from_slice2` impls were added in #45990 but they won't be stable until 1.24.0.
* The `Mutex` and `RwLock` impls were added in #46082 but won't be stable until 1.24.0.

6 years agoAuto merge of #46907 - varkor:contrib-8, r=nagisa
bors [Fri, 5 Jan 2018 05:20:23 +0000 (05:20 +0000)]
Auto merge of #46907 - varkor:contrib-8, r=nagisa

Allow non-alphabetic underscores in camel case

Certain identifiers, such as `X86_64`, cannot currently be unambiguously represented in camel case (`X8664`, `X86_64`, `X8_664`, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under `#[forbid(non_camel_case_types)]`. Fixes #34633 and fixes #41621.

6 years agomiri: use AllocId instead of u64.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 03:12:38 +0000 (05:12 +0200)]
miri: use AllocId instead of u64.

6 years agoAuto merge of #46739 - arielb1:simple-loops, r=nikomatsakis
bors [Fri, 5 Jan 2018 02:31:19 +0000 (02:31 +0000)]
Auto merge of #46739 - arielb1:simple-loops, r=nikomatsakis

[needs perf run] Try to improve LLVM pass ordering

Fixes #45466

6 years agoFix search bar defocus
Guillaume Gomez [Fri, 5 Jan 2018 00:14:10 +0000 (01:14 +0100)]
Fix search bar defocus

6 years agoDo not use casting for suggestion to add type to numeric literal
Esteban Küber [Thu, 4 Jan 2018 20:23:14 +0000 (12:23 -0800)]
Do not use casting for suggestion to add type to numeric literal

6 years ago[unix] Don't clone command-line args on startup
Matt Brubeck [Wed, 3 Jan 2018 20:09:22 +0000 (12:09 -0800)]
[unix] Don't clone command-line args on startup

6 years agorustbuild: Don't allow stable bootstrap from dev
Alex Crichton [Thu, 4 Jan 2018 21:14:15 +0000 (13:14 -0800)]
rustbuild: Don't allow stable bootstrap from dev

I forgot to update the bootstrap compiler for the 1.23.0 release so let's make
sure it doesn't happen again!

6 years agoFix an error in std::process documentation
Loïc Damien [Thu, 4 Jan 2018 21:01:57 +0000 (22:01 +0100)]
Fix an error in std::process documentation

6 years agoMake libpanic_unwind build on CloudABI.
Ed Schouten [Thu, 4 Jan 2018 16:55:44 +0000 (17:55 +0100)]
Make libpanic_unwind build on CloudABI.

CloudABI uses LLVM's libunwind for stack unwinding. There was a small
bug that went by unnoticed, namely that it was not built with -fno-rtti.
This caused it to (indirectly) depend on the entire C++ runtime.

Now that that issue has been resolved, it is also perfectly fine to make
use of this library for programming languages other than C++.

6 years agorustc: Don't use relative paths for extended errors
Alex Crichton [Wed, 3 Jan 2018 00:21:35 +0000 (16:21 -0800)]
rustc: Don't use relative paths for extended errors

These no longer work now that Cargo changes the cwd of rustc while it's running.
Instead use an absolute path that's set by rustbuild.

6 years agoBump to 1.25.0
Alex Crichton [Tue, 2 Jan 2018 01:53:47 +0000 (17:53 -0800)]
Bump to 1.25.0

* Bump the release version to 1.25
* Bump the bootstrap compiler to the recent beta
* Allow using unstable rustdoc features on beta - this fix has been applied to
  the beta branch but needed to go to the master branch as well.

6 years agoAuto merge of #46916 - michaelwoerister:generate-dead-code-plz, r=alexcrichton
bors [Thu, 4 Jan 2018 14:04:27 +0000 (14:04 +0000)]
Auto merge of #46916 - michaelwoerister:generate-dead-code-plz, r=alexcrichton

Generate code for unused const- and inline-fns if -Clink-dead-code is specified.

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

r? @alexcrichton

6 years agoMake examples equivalent
aheart [Thu, 4 Jan 2018 13:55:01 +0000 (15:55 +0200)]
Make examples equivalent

The example with the ? operator was missing file.write_all

6 years agoSpan Encoding: Replace if with debug_assertion() and add some comments.
Michael Woerister [Thu, 4 Jan 2018 12:13:32 +0000 (13:13 +0100)]
Span Encoding: Replace if with debug_assertion() and add some comments.

6 years agoMap invalid Spans to DUMMY_SP during crate metadata encoding.
Michael Woerister [Thu, 4 Jan 2018 10:26:47 +0000 (11:26 +0100)]
Map invalid Spans to DUMMY_SP during crate metadata encoding.

This mirrors what we for stabilizing the incr. comp. cache and is
necessary for reproducible builds.