]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRemove `with_legacy_ctxt`
Matthew Jasper [Sat, 14 Sep 2019 20:17:11 +0000 (21:17 +0100)]
Remove `with_legacy_ctxt`

4 years agoGive more `Idents` spans
Matthew Jasper [Sat, 14 Sep 2019 20:16:51 +0000 (21:16 +0100)]
Give more `Idents` spans

4 years agoAvoid some unnecessary `&str` to `Ident` conversions
Matthew Jasper [Sat, 14 Sep 2019 20:14:03 +0000 (21:14 +0100)]
Avoid some unnecessary `&str` to `Ident` conversions

4 years agoPrefer `Symbol` to `Ident` when there's no sensible `Span`
Matthew Jasper [Sat, 14 Sep 2019 20:10:12 +0000 (21:10 +0100)]
Prefer `Symbol` to `Ident` when there's no sensible `Span`

4 years agoAuto merge of #64456 - Centril:rollup-ytqdwaq, r=Centril
bors [Sat, 14 Sep 2019 14:43:32 +0000 (14:43 +0000)]
Auto merge of #64456 - Centril:rollup-ytqdwaq, r=Centril

Rollup of 17 pull requests

Successful merges:

 - #63846 (Added table containing the system calls used by Instant and SystemTime.)
 - #64116 (Fix minor typo in docs.)
 - #64203 (A few cosmetic improvements to code & comments in liballoc and libcore)
 - #64302 (Shrink `ObligationCauseCode`)
 - #64372 (use randSecure and randABytes)
 - #64374 (Box `DiagnosticBuilder`.)
 - #64375 (Fast path for vec.clear/truncate )
 - #64378 (Fix inconsistent link formatting.)
 - #64384 (Trim rustc-workspace-hack)
 - #64393 ( declare EnvKey before use to fix build error)
 - #64420 (Inline `mark_neighbours_as_waiting_from`.)
 - #64422 (Remove raw string literal quotes from error index descriptions)
 - #64423 (Add self to .mailmap)
 - #64425 (typo fix)
 - #64431 (fn ptr is structural match)
 - #64435 (codegen: use "_N" (like for other locals) instead of "argN", for argument names.)
 - #64439 (fix #64430, confusing `owned_box` error message in no_std build)

Failed merges:

r? @ghost

4 years agoRollup merge of #64439 - 12101111:fix-owned-box, r=Centril
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:42 +0000 (16:42 +0200)]
Rollup merge of #64439 - 12101111:fix-owned-box, r=Centril

fix #64430, confusing `owned_box` error message in no_std build

Fixes #64430

4 years agoRollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppe
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:40 +0000 (16:42 +0200)]
Rollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppe

codegen: use "_N" (like for other locals) instead of "argN", for argument names.

Based on #64408 (second commit is new), fixing something I mentioned in #64408 (which turned to be an immediate blocker for unifying relevant codepaths).

Closes #64408 (by containing it).

r? @rkruppe

4 years agoRollup merge of #64431 - pnkfelix:issue-63479-fnptr-is-structural-match, r=varkor
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:39 +0000 (16:42 +0200)]
Rollup merge of #64431 - pnkfelix:issue-63479-fnptr-is-structural-match, r=varkor

fn ptr is structural match

Make fn ptr always structural match, regardless of whether the formal parameter types or return type are.

Fix #63479.

4 years agoRollup merge of #64425 - guanqun:typo-fix, r=matthewjasper
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:38 +0000 (16:42 +0200)]
Rollup merge of #64425 - guanqun:typo-fix, r=matthewjasper

typo fix

4 years agoRollup merge of #64423 - ollie27:mailmap, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:36 +0000 (16:42 +0200)]
Rollup merge of #64423 - ollie27:mailmap, r=Mark-Simulacrum

Add self to .mailmap

4 years agoRollup merge of #64422 - ollie27:error_index_generator_stringify, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:35 +0000 (16:42 +0200)]
Rollup merge of #64422 - ollie27:error_index_generator_stringify, r=Mark-Simulacrum

Remove raw string literal quotes from error index descriptions

The error index has unnecessary `r##"` and `"##` around the descriptions from #63721. Removing the `stringify` call removes them.

r? @Mark-Simulacrum

4 years agoRollup merge of #64420 - nnethercote:inline-mark_neighbours_as_waiting_from, r=Mark...
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:33 +0000 (16:42 +0200)]
Rollup merge of #64420 - nnethercote:inline-mark_neighbours_as_waiting_from, r=Mark-Simulacrum

Inline `mark_neighbours_as_waiting_from`.

This function is very hot, doesn't get inlined because it's recursive,
and the function calls are significant.

This commit splits it into inlined and uninlined variants, and uses the
inlined variant for the hot call site. This wins several percent on a
few benchmarks.

r? @nikomatsakis

4 years agoRollup merge of #64393 - Wind-River:master_002_envKey, r=alexcrichton
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:32 +0000 (16:42 +0200)]
Rollup merge of #64393 - Wind-River:master_002_envKey, r=alexcrichton

 declare EnvKey before use to fix build error

r? @alexcrichton

4 years agoRollup merge of #64384 - mati865:tools_hack, r=alexcrichton
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:31 +0000 (16:42 +0200)]
Rollup merge of #64384 - mati865:tools_hack, r=alexcrichton

Trim rustc-workspace-hack

Those dependencies seem no longer necessary.
`./x.py test` and `x86_64-gnu-tools` container passed locally so I think this won't hurt.

4 years agoRollup merge of #64378 - Rosto75:master, r=jonas-schievink
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:29 +0000 (16:42 +0200)]
Rollup merge of #64378 - Rosto75:master, r=jonas-schievink

Fix inconsistent link formatting.

4 years agoRollup merge of #64375 - kornelski:vecdrop, r=rkruppe
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:28 +0000 (16:42 +0200)]
Rollup merge of #64375 - kornelski:vecdrop, r=rkruppe

Fast path for vec.clear/truncate

For trivial types like `u8`, `vec.truncate()`/`vec.clear()` relies on the optimizer to remove the loop. This means more work in debug builds, and more work for the optimizer.

Avoiding this busywork is exactly what `mem::needs_drop::<T>()` is for.

4 years agoRollup merge of #64374 - nnethercote:box-DiagnosticBuilder, r=zackmdavis
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:26 +0000 (16:42 +0200)]
Rollup merge of #64374 - nnethercote:box-DiagnosticBuilder, r=zackmdavis

Box `DiagnosticBuilder`.

It's a large type -- 176 bytes on 64-bit. And it's passed around and
returned from a lot of functions, including within `PResult`.

This commit boxes it, which reduces memory traffic. In particular,
`PResult` shrinks to 16 bytes in the best case; this reduces instruction
counts by up to 2% on various workloads. The commit touches a lot of
lines but it's almost all trivial plumbing changes.

4 years agoRollup merge of #64372 - Wind-River:master, r=alexcrichton
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:25 +0000 (16:42 +0200)]
Rollup merge of #64372 - Wind-River:master, r=alexcrichton

use randSecure and randABytes

r? @alexcrichton

cc @n-salim

4 years agoRollup merge of #64302 - nnethercote:shrink-ObligationCauseCode, r=zackmdavis
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:23 +0000 (16:42 +0200)]
Rollup merge of #64302 - nnethercote:shrink-ObligationCauseCode, r=zackmdavis

Shrink `ObligationCauseCode`

These commits reduce the size of `ObligationCauseCode` from 56 bytes to 32 bytes on 64-bit. This reduces instruction counts on various benchmarks by up to 1%, due to less `memcpy`ing.

4 years agoRollup merge of #64203 - alexreg:rush-pr-2, r=centril
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:22 +0000 (16:42 +0200)]
Rollup merge of #64203 - alexreg:rush-pr-2, r=centril

A few cosmetic improvements to code & comments in liballoc and libcore

Factored out from hacking on rustc for work on the REPL.

r? @Centril

4 years agoRollup merge of #64116 - ZeGentzy:patch-1, r=oli-obk
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:20 +0000 (16:42 +0200)]
Rollup merge of #64116 - ZeGentzy:patch-1, r=oli-obk

Fix minor typo in docs.

This comment is prolly refering to the comment in [const_eval_raw_provider](https://github.com/rust-lang/rust/pull/64116/files#diff-e0b58bb6712edaa8595ad7237542c958R616), not itself.

4 years agoRollup merge of #63846 - DevQps:32626-document-time-system-calls, r=rkruppe
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:19 +0000 (16:42 +0200)]
Rollup merge of #63846 - DevQps:32626-document-time-system-calls, r=rkruppe

Added table containing the system calls used by Instant and SystemTime.

# Description
See #32626 for a discussion on documenting system calls used by Instant and SystemTime.

## Changes
- Added a table containing the system calls used by each platform.

EDIT: If I can format this table better (due to the large links) please let me know.
I'd also be happy to learn a quick command to generate the docs on my host machine! Currently I am using: `python x.py doc --stage 0 src/libstd` but that gives me some `unrecognized intrinsic` errors. Advice is always welcome :)

closes #32626

4 years agoUpdate src/liballoc/raw_vec.rs
Alexander Regueiro [Sat, 14 Sep 2019 14:26:50 +0000 (15:26 +0100)]
Update src/liballoc/raw_vec.rs

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoAuto merge of #64080 - estebank:parse-format-comma, r=zackmdavis
bors [Sat, 14 Sep 2019 06:10:08 +0000 (06:10 +0000)]
Auto merge of #64080 - estebank:parse-format-comma, r=zackmdavis

Be accurate on `format!` parse error expectations

Fix https://github.com/rust-lang/rust/issues/57277.

4 years agoUpdate value.rs
Hal Gentz [Sat, 14 Sep 2019 02:37:38 +0000 (20:37 -0600)]
Update value.rs

4 years agoadd trailing newline
12101111 [Fri, 13 Sep 2019 19:23:58 +0000 (03:23 +0800)]
add trailing newline

4 years agoadd ui test for #64430
12101111 [Fri, 13 Sep 2019 19:13:51 +0000 (03:13 +0800)]
add ui test for #64430

4 years agofix #64430
12101111 [Fri, 13 Sep 2019 18:40:20 +0000 (02:40 +0800)]
fix #64430

4 years agocodegen: use "_N" (like for other locals) instead of "argN", for argument names.
Eduard-Mihai Burtescu [Fri, 13 Sep 2019 16:25:05 +0000 (19:25 +0300)]
codegen: use "_N" (like for other locals) instead of "argN", for argument names.

4 years agoAuto merge of #63420 - spastorino:place2_5, r=oli-obk
bors [Fri, 13 Sep 2019 15:37:15 +0000 (15:37 +0000)]
Auto merge of #63420 - spastorino:place2_5, r=oli-obk

[Place 2.0] Convert Place's projection to a boxed slice

This is still work in progress, it's not compiling right now I need to review a bit more to see what's going on but wanted to open the PR to start discussing it.

r? @oli-obk

4 years agoRegression tests for fn ptr and `#[structural_match]` as discussed in #63479.
Felix S. Klock II [Fri, 13 Sep 2019 15:08:01 +0000 (17:08 +0200)]
Regression tests for fn ptr and `#[structural_match]` as discussed in #63479.

4 years agoMake fn ptr always structural match, regardless of whether formal types are.
Felix S. Klock II [Fri, 13 Sep 2019 15:06:09 +0000 (17:06 +0200)]
Make fn ptr always structural match, regardless of whether formal types are.

Fix #63479.

4 years agoUpdate src/libstd/time.rs
Christian Veenman [Fri, 13 Sep 2019 14:29:06 +0000 (16:29 +0200)]
Update src/libstd/time.rs

Co-Authored-By: Robin Kruppe <robin.kruppe@gmail.com>
4 years agoMake all projection base names be proj_base
Santiago Pastorino [Thu, 12 Sep 2019 20:33:38 +0000 (17:33 -0300)]
Make all projection base names be proj_base

4 years agoUse if let here
Santiago Pastorino [Thu, 12 Sep 2019 19:21:47 +0000 (16:21 -0300)]
Use if let here

4 years agoFix style in comments
Santiago Pastorino [Thu, 12 Sep 2019 19:20:20 +0000 (16:20 -0300)]
Fix style in comments

4 years agoAvoid math and use patterns to grab projection base
Santiago Pastorino [Thu, 12 Sep 2019 19:16:43 +0000 (16:16 -0300)]
Avoid math and use patterns to grab projection base

4 years agoAdd self to .mailmap
Oliver Middleton [Fri, 13 Sep 2019 10:42:31 +0000 (11:42 +0100)]
Add self to .mailmap

4 years agoRemove raw string literal quotes from error index descriptions
Oliver Middleton [Fri, 13 Sep 2019 10:37:29 +0000 (11:37 +0100)]
Remove raw string literal quotes from error index descriptions

4 years agotypo fix
Guanqun Lu [Mon, 9 Sep 2019 15:44:11 +0000 (23:44 +0800)]
typo fix

4 years agoAuto merge of #64254 - aleksijuvani:fix-macos-sysroot, r=alexcrichton
bors [Fri, 13 Sep 2019 09:19:43 +0000 (09:19 +0000)]
Auto merge of #64254 - aleksijuvani:fix-macos-sysroot, r=alexcrichton

Fix sysroot on macOS when cross-compiling and SDKROOT is set

Fixes rust-lang/cargo#7283
Closes rust-lang/cargo#7284

r? @alexcrichton

4 years agoInline `mark_neighbours_as_waiting_from`.
Nicholas Nethercote [Fri, 13 Sep 2019 00:46:05 +0000 (10:46 +1000)]
Inline `mark_neighbours_as_waiting_from`.

This function is very hot, doesn't get inlined because it's recursive,
and the function calls are significant.

This commit splits it into inlined and uninlined variants, and uses the
inlined variant for the hot call site. This wins several percent on a
few benchmarks.

4 years agoAuto merge of #64361 - ehuss:update-cargo, r=alexcrichton
bors [Fri, 13 Sep 2019 01:07:51 +0000 (01:07 +0000)]
Auto merge of #64361 - ehuss:update-cargo, r=alexcrichton

Update cargo

11 commits in fe0e5a48b75da2b405c8ce1ba2674e174ae11d5d..9655d70af8a6dddac238e3afa2fec75088c9226f
2019-09-04 00:51:27 +0000 to 2019-09-10 18:16:11 +0000
- Home docs: fix broken links, misspellings, style fixes, clarifications. (rust-lang/cargo#7348)
- add readme key to cargos manifest. (rust-lang/cargo#7347)
- Explicitly ignore some results (rust-lang/cargo#7340)
- Don't resolve std's optional dependencies (rust-lang/cargo#7337)
- Add `alloc` and `proc_macro` to libstd crates (rust-lang/cargo#7336)
- doc: capitalization change for consistency. (rust-lang/cargo#7334)
- Fix test for changes in plugin API. (rust-lang/cargo#7335)
- Fix some man pages where the files weren't rebuilt. (rust-lang/cargo#7332)
- guide: add section about the cargo home (rust-lang/cargo#7314)
- `map_dependencies` is doing a deep clone, so lets make it cheaper (rust-lang/cargo#7326)
- don't need to copy this string (rust-lang/cargo#7324)

4 years agoAuto merge of #64360 - varkor:foreign-items-diagnostic-const-generics, r=cramertj
bors [Thu, 12 Sep 2019 21:20:06 +0000 (21:20 +0000)]
Auto merge of #64360 - varkor:foreign-items-diagnostic-const-generics, r=cramertj

Correct the polymorphic extern fn error for const parameters

Before, any polymorphism on extern functions was assumed to be type polymorphism.

4 years agoDestructure instead of using split_at
Santiago Pastorino [Thu, 12 Sep 2019 19:03:38 +0000 (16:03 -0300)]
Destructure instead of using split_at

4 years agoUse fold
Santiago Pastorino [Thu, 12 Sep 2019 18:25:33 +0000 (15:25 -0300)]
Use fold

4 years agocodegen: be more explicit about setting giving names to allocas.
Eduard-Mihai Burtescu [Thu, 12 Sep 2019 16:04:30 +0000 (19:04 +0300)]
codegen: be more explicit about setting giving names to allocas.

4 years agoIgnore linker env vars set for macOS on iOS targets
Aleksi Juvani [Thu, 12 Sep 2019 12:23:59 +0000 (15:23 +0300)]
Ignore linker env vars set for macOS on iOS targets

4 years agoAuto merge of #64359 - varkor:opaque-ty-in-extern, r=estebank
bors [Thu, 12 Sep 2019 12:40:31 +0000 (12:40 +0000)]
Auto merge of #64359 - varkor:opaque-ty-in-extern, r=estebank

Forbid opaque types in `extern "C"` blocks

Fixes #64338.

4 years agoTrim rustc-workspace-hack
Mateusz Mikuła [Wed, 11 Sep 2019 18:50:53 +0000 (20:50 +0200)]
Trim rustc-workspace-hack

4 years agoRemove env vars instead of setting them to an empty string
Aleksi Juvani [Thu, 12 Sep 2019 10:47:17 +0000 (13:47 +0300)]
Remove env vars instead of setting them to an empty string

4 years agoAuto merge of #64328 - Mark-Simulacrum:rustdoc-find-rustc, r=GuillaumeGomez
bors [Thu, 12 Sep 2019 08:29:55 +0000 (08:29 +0000)]
Auto merge of #64328 - Mark-Simulacrum:rustdoc-find-rustc, r=GuillaumeGomez

rustdoc: change doctests locating rustc binary

We previously used the "naive" approach of replacing the `current_exe()`'s file name with rustc, but now load from the sysroot by default (`$sysroot/bin/rustc`). The functionality of locating the sysroot overlaps/is the same as the functionality used by codegen backend loading; this ensures that any failure cases we've introduced are not exceeding those, and that improvements to finding the sysroot for loading codegen backends likewise enhance rustdoc.

The second commit adds an unstable `--test-builder` flag to rustdoc, and is largely separate (I can split into separate PR, but it's a simple and related change). This is largely intended for "advanced" users at this point (I'm not sure if we'll ever stabilize it); it permits use of a different rustc binary for rustdoc compilation of doctests than the rustdoc binary used when loading. Note, that this may not be what you want as the parsers and such differ (and rustdoc uses its own libsyntax, etc.). However, I've been told that running doctests in miri may be assisted by this change, so I've implemented it; I'll file a tracking issue for it if there's interest in it (and we land this PR).

4 years agoAuto merge of #64303 - nnethercote:avoid-more-Symbol-to-string-operations, r=petrochenkov
bors [Thu, 12 Sep 2019 04:15:27 +0000 (04:15 +0000)]
Auto merge of #64303 - nnethercote:avoid-more-Symbol-to-string-operations, r=petrochenkov

Avoid more `Symbol`-to-string operations

These commits avoid various `Symbol`-to-string conversions, by doing more operations directly on `Symbol`s. This requires adding a few more static `Symbol`s to the binary.

r? @petrochenkov

4 years agoMerge pull request #22 from Wind-River/master_002
Baoshan [Thu, 12 Sep 2019 02:34:23 +0000 (19:34 -0700)]
Merge pull request #22 from Wind-River/master_002

declare EnvKey before use to fix build error

4 years agoAuto merge of #64334 - jyao1:i686-master, r=joshtriplett
bors [Wed, 11 Sep 2019 22:40:11 +0000 (22:40 +0000)]
Auto merge of #64334 - jyao1:i686-master, r=joshtriplett

Add i686-unknown-uefi target

This adds a new rustc target-configuration called 'i686-unknown_uefi'.
This is similar to existing x86_64-unknown_uefi target.

The i686-unknown-uefi target can be used to build Intel Architecture
32bit UEFI application. The ABI defined in UEFI environment (aka IA32)
is similar to cdecl.

We choose i686-unknown-uefi-gnu instead of i686-unknown-uefi to avoid
the intrinsics generated by LLVM. The detail of root-cause and solution
analysis is added as comment in the code.
For x86_64-unknown-uefi, we cannot use -gnu, because the ABI between
MSVC and GNU is totally different, and UEFI chooses ABI similar to MSVC.
For i686-unknown-uefi, the UEFI chooses cdecl ABI, which is same as
MSVC and GNU. According to LLVM code, the only differences between MSVC
and GNU are fmodf(f32), longjmp() and TLS, which have no impact to UEFI.
As such, using i686-unknown-uefi-gnu is the simplest way to pass the build.

Adding the undefined symbols, such as _aulldiv() to rust compiler-builtins
is out of scope. But it may be considered later.

The scope of this patch is limited to support target-configuration.

No standard library support is added in this patch. Such work can be
done in future enhancement.

Cc: Josh Triplett <josh.triplett@intel.com>
Reviewed-by: Josh Triplett <josh.triplett@intel.com>
4 years agoBox `DiagnosticBuilder`.
Nicholas Nethercote [Wed, 11 Sep 2019 22:29:17 +0000 (08:29 +1000)]
Box `DiagnosticBuilder`.

It's a large type -- 176 bytes on 64-bit. And it's passed around and
returned from a lot of functions, including within PResult.

This commit boxes it, which reduces memory traffic. In particular,
`PResult` shrinks to 16 bytes in the best case; this reduces instruction
counts by up to 2% on various workloads.

4 years agoMake Place Boxed on Statement to reduce size from 64 bytes to 32 bytes
Santiago Pastorino [Wed, 11 Sep 2019 19:05:45 +0000 (16:05 -0300)]
Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytes

4 years agoGuarantee vec.clear/truncate is O(1) for trivial types
Kornel [Wed, 11 Sep 2019 10:46:53 +0000 (11:46 +0100)]
Guarantee vec.clear/truncate is O(1) for trivial types

4 years agoAuto merge of #64271 - Centril:non-exhaustive-peel-refs, r=estebank
bors [Wed, 11 Sep 2019 18:46:18 +0000 (18:46 +0000)]
Auto merge of #64271 - Centril:non-exhaustive-peel-refs, r=estebank

check_match: refactor + improve non-exhaustive diagnostics for default binding modes

Refactor `check_match` a bit with more code-reuse and improve the diagnostics for a non-exhaustive pattern match by peeling off any references from the scrutinee type so that the "defined here" label is added in more cases. For example:

```rust
error[E0004]: non-exhaustive patterns: `&mut &B` not covered
 --> foo.rs:4:11
  |
1 | enum E { A, B }
  | ---------------
  | |           |
  | |           not covered
  | `E` defined here
...
4 |     match x {
  |           ^ pattern `&mut &B` not covered
  |
  = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
```

Moreover, wrt. "defined here", we give irrefutable pattern matching (i.e. in `let`, `for`, and `fn` parameters) a more consistent treatment in line with `match`.

r? @estebank

4 years agoAuto merge of #64154 - alexcrichton:std-backtrace, r=sfackler
bors [Wed, 11 Sep 2019 14:46:08 +0000 (14:46 +0000)]
Auto merge of #64154 - alexcrichton:std-backtrace, r=sfackler

std: Add a `backtrace` module

This commit adds a `backtrace` module to the standard library, as
designed in [RFC 2504]. The `Backtrace` type is intentionally very
conservative, effectively only allowing capturing it and printing it.

Additionally this commit also adds a `backtrace` method to the `Error`
trait which defaults to returning `None`, as specified in [RFC 2504].
More information about the design here can be found in [RFC 2504] and in
the [tracking issue].

Implementation-wise this is all based on the `backtrace` crate and very
closely mirrors the `backtrace::Backtrace` type on crates.io. Otherwise
it's pretty standard in how it handles everything internally.

[RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
[tracking issue]: https://github.com/rust-lang/rust/issues/53487

cc #53487

4 years agoFix inconsistent link formatting.
Tomasz Różański [Wed, 11 Sep 2019 12:03:40 +0000 (14:03 +0200)]
Fix inconsistent link formatting.

4 years agodeclare EnvKey before use to fix build error
Baoshan Pang [Wed, 11 Sep 2019 04:35:01 +0000 (21:35 -0700)]
declare EnvKey before use to fix build error

4 years agoMerge pull request #21 from rust-lang/master
Baoshan [Wed, 11 Sep 2019 04:21:48 +0000 (21:21 -0700)]
Merge pull request #21 from rust-lang/master

Sync with rust-lang/rust master branch

4 years agoAvoid two `Symbol::as_str()` calls.
Nicholas Nethercote [Thu, 5 Sep 2019 01:54:01 +0000 (11:54 +1000)]
Avoid two `Symbol::as_str()` calls.

4 years agoUse `Symbol` in `external_path()`.
Nicholas Nethercote [Thu, 5 Sep 2019 01:43:05 +0000 (11:43 +1000)]
Use `Symbol` in `external_path()`.

4 years agoUse `Symbol` in `weak_lang_items!`.
Nicholas Nethercote [Thu, 5 Sep 2019 01:35:39 +0000 (11:35 +1000)]
Use `Symbol` in `weak_lang_items!`.

4 years agoUse `ast::Name` in `report_ambiguous_associated_type()`.
Nicholas Nethercote [Thu, 5 Sep 2019 01:26:51 +0000 (11:26 +1000)]
Use `ast::Name` in `report_ambiguous_associated_type()`.

4 years agoUse `Symbol` in `Linker`.
Nicholas Nethercote [Thu, 5 Sep 2019 01:23:45 +0000 (11:23 +1000)]
Use `Symbol` in `Linker`.

4 years agoStore `InternedString`s in `AssertModuleSource::available_cgus`.
Nicholas Nethercote [Thu, 5 Sep 2019 00:36:30 +0000 (10:36 +1000)]
Store `InternedString`s in `AssertModuleSource::available_cgus`.

4 years agoMerge pull request #20 from Wind-River/rand
Baoshan [Wed, 11 Sep 2019 00:53:54 +0000 (17:53 -0700)]
Merge pull request #20 from Wind-River/rand

use randSecure and randABytes

4 years agoAuto merge of #64369 - Centril:rollup-g875ozi, r=Centril
bors [Wed, 11 Sep 2019 00:39:40 +0000 (00:39 +0000)]
Auto merge of #64369 - Centril:rollup-g875ozi, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #64060 (Improve hygiene of `alloc::format!`)
 - #64072 (Replace file_stem by file_name in rustdoc markdown)
 - #64129 (vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn)
 - #64188 (rustc: Allow the cdylib crate type with wasm32-wasi)
 - #64326 (Fixed documentation within c_str::from_ptr)
 - #64349 (documentation for AtomicPtr CAS operations)

Failed merges:

r? @ghost

4 years agoRollup merge of #64349 - arnohaase:pr_documentation_atomicptr, r=cramertj
Mazdak Farrokhzad [Wed, 11 Sep 2019 00:38:10 +0000 (02:38 +0200)]
Rollup merge of #64349 - arnohaase:pr_documentation_atomicptr, r=cramertj

documentation for AtomicPtr CAS operations

The examples in the documentation for AtomicPtr CAS operations only show code that does *not* perform the CAS operation. I suggest to change them so that they actually do exchange the AtomicPtr's value.

4 years agoRollup merge of #64326 - hman523:master, r=joshtriplett
Mazdak Farrokhzad [Wed, 11 Sep 2019 00:38:09 +0000 (02:38 +0200)]
Rollup merge of #64326 - hman523:master, r=joshtriplett

Fixed documentation within c_str::from_ptr

Fixed the documentation issue mentioned in #63590

4 years agoRollup merge of #64188 - alexcrichton:wasi-cdylib, r=varkor
Mazdak Farrokhzad [Wed, 11 Sep 2019 00:38:07 +0000 (02:38 +0200)]
Rollup merge of #64188 - alexcrichton:wasi-cdylib, r=varkor

rustc: Allow the cdylib crate type with wasm32-wasi

The wasm32-wasi target respects configuration around `crt-static` in
general, but is defaulted to being static. This interacted badly with
code which validated the `cdylib` crate type for `wasm32-wasi`,
erroneously saying that the `cdylib` crate type wasn't supported on
`wasm32-wasi` by default. This commit sets the appropriate flag in
`wasm32_wasi`'s target specification to indicate that the `cdylib` crate
type is supported regardless of `crt-static`

Closes #64187

4 years agoRollup merge of #64129 - Wind-River:master_003, r=alexcrichton
Mazdak Farrokhzad [Wed, 11 Sep 2019 00:38:06 +0000 (02:38 +0200)]
Rollup merge of #64129 - Wind-River:master_003, r=alexcrichton

vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn

vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn

r? @alexcrichton
cc @n-salim

4 years agoRollup merge of #64072 - limira:patch-1, r=ollie27
Mazdak Farrokhzad [Wed, 11 Sep 2019 00:38:04 +0000 (02:38 +0200)]
Rollup merge of #64072 - limira:patch-1, r=ollie27

Replace file_stem by file_name in rustdoc markdown

Before this PR, a file name like `some.file.md` will be output to a file named `some.html` with is not correct because the expected output file must be `some.file.html`

4 years agoRollup merge of #64060 - petrochenkov:unstdhyg, r=tmandry
Mazdak Farrokhzad [Wed, 11 Sep 2019 00:38:03 +0000 (02:38 +0200)]
Rollup merge of #64060 - petrochenkov:unstdhyg, r=tmandry

Improve hygiene of `alloc::format!`

`format` now uses `format_args` though a `__export` module, as described in https://github.com/rust-lang/rust/issues/63687#issuecomment-526254208.

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

4 years agoMake wording less confusing
varkor [Tue, 10 Sep 2019 21:35:10 +0000 (22:35 +0100)]
Make wording less confusing

4 years agouse randSecure and randABytes
Baoshan Pang [Tue, 10 Sep 2019 21:58:31 +0000 (14:58 -0700)]
use randSecure and randABytes

4 years agoCorrect the polymorphic extern fn error for const parameters
varkor [Tue, 10 Sep 2019 17:46:27 +0000 (18:46 +0100)]
Correct the polymorphic extern fn error for const parameters

4 years agoRefactor "not FFI-safe" diagnostic
varkor [Tue, 10 Sep 2019 21:29:31 +0000 (22:29 +0100)]
Refactor "not FFI-safe" diagnostic

4 years agoAdd unstable --test-builder to rustdoc
Mark Rousskov [Tue, 10 Sep 2019 01:11:27 +0000 (21:11 -0400)]
Add unstable --test-builder to rustdoc

This allows overriding the rustc binary used to build tests; it should
not generally be necessary as we fallback to the sysroot.

4 years agoLocate rustc binary similarly to codegen backend loading
Mark Rousskov [Tue, 10 Sep 2019 01:01:41 +0000 (21:01 -0400)]
Locate rustc binary similarly to codegen backend loading

This ensures that the failure cases for finding the codegen backend and
for finding the rustc binary are essentially the same, and since we
almost always will load the codegen backend, this is essentially meaning
that the rustc change is not a regression.

4 years agoMerge pull request #19 from Wind-River/min_stack_size
Baoshan [Tue, 10 Sep 2019 20:39:12 +0000 (13:39 -0700)]
Merge pull request #19 from Wind-River/min_stack_size

remove Copyright notic

4 years agoUpdate cargo
Eric Huss [Tue, 10 Sep 2019 19:01:05 +0000 (12:01 -0700)]
Update cargo

4 years agoSurround `PhantomData` in backticks
varkor [Tue, 10 Sep 2019 17:16:47 +0000 (18:16 +0100)]
Surround `PhantomData` in backticks

4 years agoForbid opaque types in extern blocks
varkor [Tue, 10 Sep 2019 17:16:35 +0000 (18:16 +0100)]
Forbid opaque types in extern blocks

4 years agoremove Copyright notic
Baoshan Pang [Tue, 10 Sep 2019 16:25:22 +0000 (09:25 -0700)]
remove Copyright notic

4 years agoAuto merge of #64354 - Centril:rollup-oaq0xoi, r=Centril
bors [Tue, 10 Sep 2019 16:19:48 +0000 (16:19 +0000)]
Auto merge of #64354 - Centril:rollup-oaq0xoi, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #63786 (Make `abs`, `wrapping_abs`, `overflowing_abs` const functions)
 - #63989 (Add Yaah to clippy toolstain notification list)
 - #64256 (test/c-variadic: Fix patterns on powerpc64)
 - #64292 (lowering: extend temporary lifetimes around await)
 - #64311 (lldb: avoid mixing "Hit breakpoint" message with other output.)
 - #64330 (Clarify E0507 to note Fn/FnMut relationship to borrowing)
 - #64331 (Changed instant is earlier to instant is later)
 - #64344 (rustc_mir: buffer -Zdump-mir output instead of pestering the kernel constantly.)

Failed merges:

r? @ghost

4 years agoRollup merge of #64344 - eddyb:mir-opt-stop-shouting-at-the-kernel, r=oli-obk
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:31 +0000 (17:19 +0200)]
Rollup merge of #64344 - eddyb:mir-opt-stop-shouting-at-the-kernel, r=oli-obk

rustc_mir: buffer -Zdump-mir output instead of pestering the kernel constantly.

This brings `mir-opt` tests from `197s` (over 3 minutes!) to `2.85s`, on my build server.
That's a nice speedup of about `69x` and so it definitely fixes #58485, for me.

It's such a beginner mistake I feel like maybe `clippy` should lint against it?
(cc @Manishearth @oli-obk)

4 years agoRollup merge of #64331 - hman523:fix-64322, r=varkor
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:29 +0000 (17:19 +0200)]
Rollup merge of #64331 - hman523:fix-64322, r=varkor

Changed instant is earlier to instant is later

Fixed the documentation issue from #64322

4 years agoRollup merge of #64330 - Mark-Simulacrum:clarify-E0507, r=GuillaumeGomez
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:28 +0000 (17:19 +0200)]
Rollup merge of #64330 - Mark-Simulacrum:clarify-E0507, r=GuillaumeGomez

Clarify E0507 to note Fn/FnMut relationship to borrowing

Fixes #37904.

4 years agoRollup merge of #64311 - eddyb:lldb-python3, r=michaelwoerister
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:26 +0000 (17:19 +0200)]
Rollup merge of #64311 - eddyb:lldb-python3, r=michaelwoerister

lldb: avoid mixing "Hit breakpoint" message with other output.

This is to get `src/test/debuginfo/lexical-scopes-in-block-expression.rs` working.
It used to work like a week ago, and the main change that happened was I switched from Python 2 to Python 3 (I don't remember why, but I did get rid of the build dir entirely, and it fixed something else).

The error was:
```
error: line not found in debugger output: [...]$27 = 10
```

Relevant part of the output:
```
print val
(long) $26 = 15
print ten
(long) $27 = 10 Hit breakpoint 15.1: where = a`lexical_scopes_in_block_expression::main::hcdd5c3caa9166e73 + 1223 at lexical-scopes-in-block-expression.rs:504:4, address = 0x00005555555556e7, resolved, hit count = 1
Hit breakpoint 16.1: where = a`lexical_scopes_in_block_expression::main::hcdd5c3caa9166e73 + 631 at lexical-scopes-in-block-expression.rs:510:8, address = 0x0000555555555497, resolved, hit count = 1
```

There are most `print` commands and their outputs before, and more `Hit breakpoint` messages afterwards, so I assume what happens is the `Hit breakpoint` messages should be interleaved but somehow they ended up being buffered after all of the other output.

As a stopgap measure I'm adding a newline before each `Hit breakpoint` so they don't end up on the same line as the last `print` output (which breaks our pattern-matching).

r? @michaelwoerister

4 years agoRollup merge of #64292 - davidtwco:issue-63832-await-temporary-lifetimes, r=matthewjasper
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:25 +0000 (17:19 +0200)]
Rollup merge of #64292 - davidtwco:issue-63832-await-temporary-lifetimes, r=matthewjasper

lowering: extend temporary lifetimes around await

Fixes #63832.

r? @matthewjasper
cc @nikomatsakis

4 years agoRollup merge of #64256 - smaeul:patch/powerpc64-tests, r=alexcrichton
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:23 +0000 (17:19 +0200)]
Rollup merge of #64256 - smaeul:patch/powerpc64-tests, r=alexcrichton

test/c-variadic: Fix patterns on powerpc64

On architectures such as powerpc64 that use extend_integer_width_to in
their C ABI processing, integer parameters shorter than the native
register width will be annotated with the ArgAttribute::SExt or
ArgAttribute::ZExt attribute, and that attribute will be included in the
generated LLVM IR.

In this test, all relevant parameters are `i32`, which will get the
`signext` annotation on the relevant 64-bit architectures. Match both
the annotated and non-annotated case, but enforce that the annotation is
applied consistently.

4 years agoRollup merge of #63989 - yaahc:master, r=Manishearth
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:22 +0000 (17:19 +0200)]
Rollup merge of #63989 - yaahc:master, r=Manishearth

Add Yaah to clippy toolstain notification list

4 years agoRollup merge of #63786 - tspiteri:const-abs, r=alexcrichton
Mazdak Farrokhzad [Tue, 10 Sep 2019 15:19:19 +0000 (17:19 +0200)]
Rollup merge of #63786 - tspiteri:const-abs, r=alexcrichton

Make `abs`, `wrapping_abs`, `overflowing_abs` const functions

This makes `abs`, `wrapping_abs` and `overflowing_abs` const functions like #58044 makes `wrapping_neg` and `overflowing_neg` const functions.

`abs` is made const by returning `(self ^ -1) - -1` = `!self + 1` = `-self` for negative numbers and `(self ^ 0) - 0` = `self` for non-negative numbers. The subexpression `self >> ($BITS - 1)` evaluates to `-1` for negative numbers and `0` otherwise. The subtraction overflows when `self` is `min_value()`, as we would be subtracting `max_value() - -1`; this is when `abs` should overflow.

`wrapping_abs` and `overflowing_abs` make use of `wrapping_sub` and `overflowing_sub` instead of the subtraction operator.

4 years agoAdd unexpected type to extern type bug message
varkor [Tue, 10 Sep 2019 14:11:05 +0000 (15:11 +0100)]
Add unexpected type to extern type bug message

4 years agoSet environment variables for linker instead of sysroot
Aleksi Juvani [Tue, 10 Sep 2019 06:53:59 +0000 (09:53 +0300)]
Set environment variables for linker instead of sysroot

4 years agoAuto merge of #60387 - Goirad:test-expansion, r=ollie27
bors [Tue, 10 Sep 2019 12:19:41 +0000 (12:19 +0000)]
Auto merge of #60387 - Goirad:test-expansion, r=ollie27

Allow cross-compiling doctests

This PR allows doctest to receive a --runtool argument, as well as possibly many --runtool-arg arguments, which are then used to run cross compiled doctests.
Also, functionality has been added to rustdoc to allow it to skip testing doctests on a per-target basis, in the same way that compiletest does it. For example, tagging the doctest with "ignore-sgx" disables testing on any targets that contain "sgx". A plain "ignore" still skips testing on all targets.

See [here](https://github.com/rust-lang/cargo/pull/6892) for the companion PR in the cargo project that extends functionality in Cargo so that it passes the appropriate parameters to rustdoc when cross compiling and testing doctests.

Part of [#6460](https://github.com/rust-lang/cargo/issues/6460)