]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRemove incorrect space
ashtneoi [Mon, 13 Aug 2018 23:12:35 +0000 (16:12 -0700)]
Remove incorrect space

5 years agoRemove unnecessary comment
ashtneoi [Mon, 13 Aug 2018 23:06:08 +0000 (16:06 -0700)]
Remove unnecessary comment

Turns out I didn't read the original comment correctly and had some
confusion about how MIR uses temporaries.

5 years agoTest patterns in tuples
ashtneoi [Mon, 13 Aug 2018 22:52:23 +0000 (15:52 -0700)]
Test patterns in tuples

5 years agoCoalesce var-is-not-Copy notes per move
ashtneoi [Mon, 13 Aug 2018 21:51:27 +0000 (14:51 -0700)]
Coalesce var-is-not-Copy notes per move

5 years agoDedup suggestions
ashtneoi [Mon, 13 Aug 2018 10:17:53 +0000 (03:17 -0700)]
Dedup suggestions

5 years agoRemove unnecessary underscore
ashtneoi [Sun, 12 Aug 2018 23:07:19 +0000 (16:07 -0700)]
Remove unnecessary underscore

5 years agoChange TODOs to FIXMEs
ashtneoi [Sun, 12 Aug 2018 21:42:33 +0000 (14:42 -0700)]
Change TODOs to FIXMEs

5 years agoMake move errors more consistent with typeck errors
ashtneoi [Sun, 12 Aug 2018 20:55:34 +0000 (13:55 -0700)]
Make move errors more consistent with typeck errors

5 years agoMake move error suggestions clearer
ashtneoi [Sun, 12 Aug 2018 20:27:14 +0000 (13:27 -0700)]
Make move error suggestions clearer

5 years agoAdd backquotes around variable name
ashtneoi [Sun, 12 Aug 2018 20:14:03 +0000 (13:14 -0700)]
Add backquotes around variable name

5 years agoFix move errors for index expressions
ashtneoi [Wed, 8 Aug 2018 06:44:35 +0000 (23:44 -0700)]
Fix move errors for index expressions

The suggestion logic gave up too early, which kept it from suggesting
borrowing index expressions.

5 years agoTest move errors for index expressions
ashtneoi [Wed, 8 Aug 2018 06:34:01 +0000 (23:34 -0700)]
Test move errors for index expressions

5 years agoAccept whitespace between `&` and `mut`
ashtneoi [Tue, 7 Aug 2018 23:16:37 +0000 (16:16 -0700)]
Accept whitespace between `&` and `mut`

5 years agoAdd more TODOs
ashtneoi [Tue, 7 Aug 2018 08:27:04 +0000 (01:27 -0700)]
Add more TODOs

5 years agoSuggest match ergonomics, not `ref`/`ref mut`
ashtneoi [Tue, 7 Aug 2018 08:02:39 +0000 (01:02 -0700)]
Suggest match ergonomics, not `ref`/`ref mut`

5 years agoFix some random stuff
ashtneoi [Thu, 2 Aug 2018 06:53:28 +0000 (23:53 -0700)]
Fix some random stuff

5 years agoRemoved `ignore-test-compare-mode-nll` from unboxed-closures tests
Felix S. Klock II [Wed, 15 Aug 2018 21:39:30 +0000 (23:39 +0200)]
Removed `ignore-test-compare-mode-nll` from unboxed-closures tests
by strengthening the tests (by adding no-op references to the
closures doing the borrows after the conflicting borrows, thus
forcing the lifetimes to resemble lexical scopes even under NLL).

5 years agoRemoved `ignore-test-compare-mode-nll` from hashmap-lifetimes.rs
Felix S. Klock II [Wed, 15 Aug 2018 21:33:14 +0000 (23:33 +0200)]
Removed `ignore-test-compare-mode-nll` from hashmap-lifetimes.rs
by strengthening the test there.

5 years agoRemoved `ignore-test-compare-mode-nll` from borrowck-closures-two-mut-fail.rs
Felix S. Klock II [Wed, 15 Aug 2018 21:31:00 +0000 (23:31 +0200)]
Removed `ignore-test-compare-mode-nll` from borrowck-closures-two-mut-fail.rs
by strengthening the tests there.

5 years agoRemoved `ignore-test-compare-mode-nll` from borrowck-closures-unique.rs
Felix S. Klock II [Wed, 15 Aug 2018 21:26:59 +0000 (23:26 +0200)]
Removed `ignore-test-compare-mode-nll` from borrowck-closures-unique.rs
by strengthening the tests there.

In almost all cases the strengthening amount to just encoding a use
that models the original lexical lifetime. A more invasive revision
was made in one case where it seems the actual issue is MIR-borrowck's
greater "knowledge" of unreachable code in the control flow...

5 years agoDo not emit "incorrect close delimiter" twice in the same place
Esteban Küber [Wed, 15 Aug 2018 21:26:03 +0000 (14:26 -0700)]
Do not emit "incorrect close delimiter" twice in the same place

5 years agoTweak unclosed delimiter parser error
Esteban Küber [Wed, 15 Aug 2018 01:04:20 +0000 (18:04 -0700)]
Tweak unclosed delimiter parser error

5 years agoDo not suggest conversion method that is already there
Esteban Küber [Wed, 15 Aug 2018 19:30:50 +0000 (12:30 -0700)]
Do not suggest conversion method that is already there

5 years agoAuto merge of #53400 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 15 Aug 2018 19:39:54 +0000 (19:39 +0000)]
Auto merge of #53400 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #52453 (improve diagnostics for tests with custom return values)
 - #53271 (use ? to simplify `TransitiveRelation.maybe_map`)
 - #53279 (Extend documentation of `rustc_on_unimplemented`)
 - #53342 (fix error for unsized packed struct field)
 - #53344 (Add doc examples for std::alloc::{alloc,alloc_zeroed}.)
 - #53368 (Ignore test that fails on stage1)
 - #53388 (Fix links' color)
 - #53396 (Fix since of Iterator::flatten to be a proper semver)

Failed merges:

r? @ghost

5 years agoTest VecDeque append not dropping twice
Pazzaz [Wed, 15 Aug 2018 17:42:07 +0000 (19:42 +0200)]
Test VecDeque append not dropping twice

5 years agoRollup merge of #53396 - matklad:fix-flatten-since, r=varkor
Guillaume Gomez [Wed, 15 Aug 2018 17:20:29 +0000 (19:20 +0200)]
Rollup merge of #53396 - matklad:fix-flatten-since, r=varkor

Fix since of Iterator::flatten to be a proper semver

r? @kennytm

5 years agoRollup merge of #53388 - GuillaumeGomez:fix-links-color, r=frewsxcv
Guillaume Gomez [Wed, 15 Aug 2018 17:20:28 +0000 (19:20 +0200)]
Rollup merge of #53388 - GuillaumeGomez:fix-links-color, r=frewsxcv

Fix links' color

Fixes #53375.

Problem was coming from the minifier.

r? @frewsxcv

5 years agoRollup merge of #53368 - matthewjasper:only-stage-2, r=varkor
Guillaume Gomez [Wed, 15 Aug 2018 17:20:26 +0000 (19:20 +0200)]
Rollup merge of #53368 - matthewjasper:only-stage-2, r=varkor

Ignore test that fails on stage1

The error code is not emitted on stage1, so ignore this test there.

5 years agoRollup merge of #53344 - frewsxcv:frewsxcv-doc-ptr, r=ollie27
Guillaume Gomez [Wed, 15 Aug 2018 17:20:25 +0000 (19:20 +0200)]
Rollup merge of #53344 - frewsxcv:frewsxcv-doc-ptr, r=ollie27

Add doc examples for std::alloc::{alloc,alloc_zeroed}.

None

5 years agoRollup merge of #53342 - RalfJung:unsized-packed, r=cramertj
Guillaume Gomez [Wed, 15 Aug 2018 17:20:23 +0000 (19:20 +0200)]
Rollup merge of #53342 - RalfJung:unsized-packed, r=cramertj

fix error for unsized packed struct field

It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field *was* unsized.

5 years agoRollup merge of #53279 - estebank:on-unimplemented-doc, r=GuillaumeGomez
Guillaume Gomez [Wed, 15 Aug 2018 17:20:22 +0000 (19:20 +0200)]
Rollup merge of #53279 - estebank:on-unimplemented-doc, r=GuillaumeGomez

Extend documentation of `rustc_on_unimplemented`

5 years agoRollup merge of #53271 - llogiq:simplify-maybe-map, r=joshtriplett
Guillaume Gomez [Wed, 15 Aug 2018 17:20:21 +0000 (19:20 +0200)]
Rollup merge of #53271 - llogiq:simplify-maybe-map, r=joshtriplett

use ? to simplify `TransitiveRelation.maybe_map`

I think this looks much clearer than the original.

5 years agoRollup merge of #52453 - srijs:fix-52436, r=TimNN
Guillaume Gomez [Wed, 15 Aug 2018 17:20:19 +0000 (19:20 +0200)]
Rollup merge of #52453 - srijs:fix-52436, r=TimNN

improve diagnostics for tests with custom return values

This is an attempt at getting the ball rolling to improve the diagnostics for test functions that return custom `impl Termination` values (see #52436).

An alternative could be to use `eprintln!`, but including this in the panic message felt nicely consistent with how failing test assertions would be reported.

Let me know what you think!

5 years agoAuto merge of #53164 - davidtwco:issue-52663-span-decl-captured-variables, r=nikomatsakis
bors [Wed, 15 Aug 2018 17:03:39 +0000 (17:03 +0000)]
Auto merge of #53164 - davidtwco:issue-52663-span-decl-captured-variables, r=nikomatsakis

Provide span for declaration of captured variables

Part of #52663.

r? @nikomatsakis

5 years agoTidy: ignore non-Markdown files when linting for the Unstable Book
varkor [Wed, 15 Aug 2018 17:01:37 +0000 (18:01 +0100)]
Tidy: ignore non-Markdown files when linting for the Unstable Book

5 years agoRemove outdated Unstable Book sections
varkor [Wed, 15 Aug 2018 16:56:53 +0000 (17:56 +0100)]
Remove outdated Unstable Book sections

5 years agoVisit all attributes for feature collection
varkor [Wed, 15 Aug 2018 16:34:56 +0000 (17:34 +0100)]
Visit all attributes for feature collection

5 years agoFix since of Iterator::flatten to be a proper semver
Aleksey Kladov [Wed, 15 Aug 2018 16:28:42 +0000 (19:28 +0300)]
Fix since of Iterator::flatten to be a proper semver

5 years agoMake cloudapi enums #[non_exhaustive]
varkor [Wed, 15 Aug 2018 15:58:53 +0000 (16:58 +0100)]
Make cloudapi enums #[non_exhaustive]

5 years agoMake std::io::Error #[non_exhaustive]
varkor [Wed, 15 Aug 2018 15:57:06 +0000 (16:57 +0100)]
Make std::io::Error #[non_exhaustive]

5 years agoMake proc_macro Level #[non_exhaustive]
varkor [Wed, 15 Aug 2018 15:56:54 +0000 (16:56 +0100)]
Make proc_macro Level #[non_exhaustive]

5 years agoMake core::sync::atomic::Ordering #[non_exhaustive]
varkor [Wed, 15 Aug 2018 15:56:29 +0000 (16:56 +0100)]
Make core::sync::atomic::Ordering #[non_exhaustive]

5 years agoClarify unused_as_mut_slices
Pazzaz [Wed, 15 Aug 2018 16:01:42 +0000 (18:01 +0200)]
Clarify unused_as_mut_slices

5 years agoAuto merge of #53237 - overdrivenpotato:wasm-export-table, r=alexcrichton
bors [Wed, 15 Aug 2018 14:40:46 +0000 (14:40 +0000)]
Auto merge of #53237 - overdrivenpotato:wasm-export-table, r=alexcrichton

Export WASM table by default

This allows loading a rust-generated `.wasm` binary in a host and using the exported table much like the `memory` export.

5 years agoFix links' color
Guillaume Gomez [Wed, 15 Aug 2018 13:07:07 +0000 (15:07 +0200)]
Fix links' color

5 years agoUse CGU name as LLVM module name and add some caching to CGU name generation.
Michael Woerister [Tue, 14 Aug 2018 15:55:22 +0000 (17:55 +0200)]
Use CGU name as LLVM module name and add some caching to CGU name generation.

5 years agoAuto merge of #53133 - Zoxc:gen-int, r=eddyb
bors [Wed, 15 Aug 2018 12:02:00 +0000 (12:02 +0000)]
Auto merge of #53133 - Zoxc:gen-int, r=eddyb

Record adjustments and original type for expressions in the generator interior

Fixes https://github.com/rust-lang/rust/issues/50878 and https://github.com/rust-lang/rust/issues/52398.

r? @eddyb

5 years agoTwo small improvements
Andre Bogus [Mon, 13 Aug 2018 21:17:45 +0000 (23:17 +0200)]
Two small improvements

In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to
simplify the code. In `libserialize/json.rs`, make use of the fact
that `Vec.last` on an empty `Vec` returns `None` to simplify the
code to a single match.

5 years agoFix some run-make tests after object file naming has changed.
Michael Woerister [Thu, 12 Jul 2018 12:59:50 +0000 (14:59 +0200)]
Fix some run-make tests after object file naming has changed.

5 years agoAdapt codegen-unit tests to new CGU naming scheme.
Michael Woerister [Thu, 12 Jul 2018 08:44:13 +0000 (10:44 +0200)]
Adapt codegen-unit tests to new CGU naming scheme.

5 years agoClean up CodegenUnit name generation.
Michael Woerister [Tue, 10 Jul 2018 17:16:22 +0000 (19:16 +0200)]
Clean up CodegenUnit name generation.

5 years agoAuto merge of #53367 - ehuss:update-cargo, r=alexcrichton
bors [Wed, 15 Aug 2018 09:08:35 +0000 (09:08 +0000)]
Auto merge of #53367 - ehuss:update-cargo, r=alexcrichton

Update cargo

- Update transitioning url (rust-lang/cargo#5889)
- Resolve some clippy lint warnings (rust-lang/cargo#5884)
- Don't kill child processes on normal exit on Windows (rust-lang/cargo#5887)
- fix a bunch of clippy warnings (rust-lang/cargo#5876)
- Add support for rustc's --error-format short (rust-lang/cargo#5879)
- Support JSON with rustdoc. (rust-lang/cargo#5878)
- Fix rustfmt instructions in CONTRIBUTING.md (rust-lang/cargo#5880)
- Allow `cargo run` in workspaces. (rust-lang/cargo#5877)
- Change target filters in workspaces. (rust-lang/cargo#5873)
- Improve verbose console and log for finding git repo in package check (rust-lang/cargo#5858)
- Meta rename (rust-lang/cargo#5871)
- fetch: skip target tests when cross_compile is disabled (rust-lang/cargo#5870)
- Fully capture rustc and rustdoc output when -Zcompile-progress is passed (rust-lang/cargo#5862)
- Fix test --example docs. (rust-lang/cargo#5867)
- Add a feature to build a vendored OpenSSL (rust-lang/cargo#5865)

5 years agofix error for unsized packed struct field
Ralf Jung [Tue, 14 Aug 2018 10:50:01 +0000 (12:50 +0200)]
fix error for unsized packed struct field

5 years agoAuto merge of #53212 - sunjay:nll-raw-cast, r=nikomatsakis
bors [Wed, 15 Aug 2018 06:54:18 +0000 (06:54 +0000)]
Auto merge of #53212 - sunjay:nll-raw-cast, r=nikomatsakis

NLL - Prevent where clauses from extending the lifetime of bindings

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

r? @nikomatsakis

5 years agoUpdate cargo
Eric Huss [Tue, 14 Aug 2018 21:27:26 +0000 (14:27 -0700)]
Update cargo

5 years agopretty printing for btreemap
Unknown [Tue, 14 Aug 2018 16:38:00 +0000 (01:38 +0900)]
pretty printing for btreemap

5 years agostd: Use target_pointer_width for BACKTRACE_ELF_SIZE
Josh Stone [Wed, 15 Aug 2018 04:08:42 +0000 (21:08 -0700)]
std: Use target_pointer_width for BACKTRACE_ELF_SIZE

The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:

- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit

Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.

Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122.

5 years agoAuto merge of #52716 - tromey:rustup-lldb, r=alexcrichton
bors [Wed, 15 Aug 2018 02:52:08 +0000 (02:52 +0000)]
Auto merge of #52716 - tromey:rustup-lldb, r=alexcrichton

Add lldb to the build

This optionally adds lldb (and clang, which it needs) to the build.

Because rust uses LLVM 7, and because clang 7 is not yet released, a
recent git master version of clang is used.

The lldb that is used includes the Rust plugin.

lldb is only built when asked for, or when doing a nightly build on
macOS.  Only macOS is done for now due to difficulties with the Python
dependency.

5 years agoAdd doc examples for std::alloc::{alloc,alloc_zeroed}.
Corey Farwell [Tue, 14 Aug 2018 12:37:12 +0000 (08:37 -0400)]
Add doc examples for std::alloc::{alloc,alloc_zeroed}.

5 years agoAccount for warning in existing GAT tests
varkor [Wed, 15 Aug 2018 01:08:20 +0000 (02:08 +0100)]
Account for warning in existing GAT tests

5 years agoWarn when `generic_associated_types` feature gate is enabled
varkor [Wed, 15 Aug 2018 01:02:52 +0000 (02:02 +0100)]
Warn when `generic_associated_types` feature gate is enabled

5 years agoAdd lldb to the build
Tom Tromey [Tue, 3 Jul 2018 18:24:24 +0000 (12:24 -0600)]
Add lldb to the build

This optionally adds lldb (and clang, which it needs) to the build.

Because rust uses LLVM 7, and because clang 7 is not yet released, a
recent git master version of clang is used.

The lldb that is used includes the Rust plugin.

lldb is only built when asked for, or when doing a nightly build on
macOS.  Only macOS is done for now due to difficulties with the Python
dependency.

5 years agoCorrected typing description in doc
Jacob [Wed, 15 Aug 2018 00:48:46 +0000 (21:48 -0300)]
Corrected typing description in doc

5 years agoAuto merge of #52928 - Mark-Simulacrum:borrowck-cleanup, r=cramertj
bors [Wed, 15 Aug 2018 00:37:52 +0000 (00:37 +0000)]
Auto merge of #52928 - Mark-Simulacrum:borrowck-cleanup, r=cramertj

(old) borrowck cleanup

Primarily moves dataflow code based on CFG to borrowck; this is mostly so we don't forget to delete it once it becomes unused after we fully move to MIR borrowck.

5 years agoUpdated the most glaring instances of weak tests w.r.t. NLL that came from #53196.
Felix S. Klock II [Tue, 14 Aug 2018 23:16:05 +0000 (01:16 +0200)]
Updated the most glaring instances of weak tests w.r.t. NLL that came from #53196.

See also the bulletpoint list on #53351.

5 years agoAuto merge of #52936 - felixrabe:patch-1, r=alexcrichton
bors [Tue, 14 Aug 2018 22:22:18 +0000 (22:22 +0000)]
Auto merge of #52936 - felixrabe:patch-1, r=alexcrichton

Document #39364 – Panic in mpsc::Receiver::recv_timeout

I can still reproduce #39364 with the example code at https://github.com/rust-lang/rust/issues/39364#issuecomment-320637702.

I'm opening this PR in an attempt to document this bug as a known issue in [libstd/sync/mpsc/mod.rs](https://github.com/rust-lang/rust/blob/master/src/libstd/sync/mpsc/mod.rs).

Inputs very much welcome. ([Nightly docs for `recv_timeout`.](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html?search=#method.recv_timeout))

5 years agoIgnore test that fails on stage1
Matthew Jasper [Tue, 14 Aug 2018 21:42:16 +0000 (22:42 +0100)]
Ignore test that fails on stage1

5 years agosyntax: Enforce attribute grammar in the parser
Vadim Petrochenkov [Sun, 12 Aug 2018 17:15:59 +0000 (20:15 +0300)]
syntax: Enforce attribute grammar in the parser

5 years agoUpdate former compile-fail tests
Matthew Jasper [Tue, 14 Aug 2018 20:26:33 +0000 (21:26 +0100)]
Update former compile-fail tests

5 years agoAuto merge of #53361 - Manishearth:clippyup, r=nrc
bors [Tue, 14 Aug 2018 19:38:45 +0000 (19:38 +0000)]
Auto merge of #53361 - Manishearth:clippyup, r=nrc

Update clippy

r? @kennytm @nrc

5 years agoName the right expected and actual return lifetimes
Matthew Jasper [Wed, 8 Aug 2018 21:44:54 +0000 (22:44 +0100)]
Name the right expected and actual return lifetimes

5 years agoUpdate tests
Matthew Jasper [Tue, 7 Aug 2018 20:48:50 +0000 (21:48 +0100)]
Update tests

5 years agoTweek best_blame_constraint to slightly prefer specific explanations
Matthew Jasper [Tue, 7 Aug 2018 20:33:27 +0000 (21:33 +0100)]
Tweek best_blame_constraint to slightly prefer specific explanations

5 years agoChange "return" to "returning this value" when explaining free regions
Matthew Jasper [Tue, 7 Aug 2018 20:31:43 +0000 (21:31 +0100)]
Change "return" to "returning this value" when explaining free regions

5 years agoTreat assigning the destination of a call as an assignment
Matthew Jasper [Tue, 7 Aug 2018 20:30:01 +0000 (21:30 +0100)]
Treat assigning the destination of a call as an assignment

5 years agoMake assigning to the return type interesting
Matthew Jasper [Tue, 7 Aug 2018 20:17:59 +0000 (21:17 +0100)]
Make assigning to the return type interesting

5 years agoAdddressed #51602
Pramod Bisht [Tue, 14 Aug 2018 19:05:27 +0000 (19:05 +0000)]
Adddressed #51602

5 years agoClarify dst condition
Pazzaz [Tue, 14 Aug 2018 18:56:22 +0000 (20:56 +0200)]
Clarify dst condition

5 years agoDon't drop values in other, just move the tail
Pazzaz [Tue, 14 Aug 2018 18:54:25 +0000 (20:54 +0200)]
Don't drop values in other, just move the tail

5 years agoUpdate clippy
Manish Goregaokar [Tue, 14 Aug 2018 18:29:00 +0000 (11:29 -0700)]
Update clippy

5 years agoAuto merge of #53354 - kennytm:rollup, r=kennytm
bors [Tue, 14 Aug 2018 17:24:18 +0000 (17:24 +0000)]
Auto merge of #53354 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #53112 (pretty print BTreeSet)
 - #53208 (Don't panic on std::env::vars() when env is null.)
 - #53226 (driver: set the syntax edition in phase 1)
 - #53229 (Make sure rlimit is only ever increased)
 - #53233 (targets: aarch64: Add bare-metal aarch64 target)
 - #53239 (rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.)
 - #53246 (A few cleanups)
 - #53257 (Idiomatic improvements to IP method)
 - #53274 (Remove statics field from CodegenCx)
 - #53290 (Make LLVM emit assembly comments with -Z asm-comments)
 - #53317 (Mark prior failure to avoid ICE)

5 years ago`{to,from}_{ne,le,be}_bytes` for unsigned integer types
Simon Sapin [Tue, 14 Aug 2018 16:46:04 +0000 (18:46 +0200)]
`{to,from}_{ne,le,be}_bytes` for unsigned integer types

Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers.

Tracking issue: https://github.com/rust-lang/rust/issues/52963

5 years agoImproved how upvars are detected when presenting errors using prefixes.
David Wood [Tue, 7 Aug 2018 17:50:19 +0000 (19:50 +0200)]
Improved how upvars are detected when presenting errors using prefixes.

5 years agoRollup merge of #53317 - estebank:abolish-ice, r=oli-obk
kennytm [Tue, 14 Aug 2018 15:59:17 +0000 (23:59 +0800)]
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk

Mark prior failure to avoid ICE

Fix #53251

5 years agoRollup merge of #53290 - whitequark:fix-35741, r=nagisa
kennytm [Tue, 14 Aug 2018 15:59:16 +0000 (23:59 +0800)]
Rollup merge of #53290 - whitequark:fix-35741, r=nagisa

Make LLVM emit assembly comments with -Z asm-comments

Fixes #35741, and makes `-Z asm-comments` actually do something useful.

Before:
```
.section .text.main,"ax",@progbits
.globl main
.p2align 4, 0x90
.type main,@function
main:
.cfi_startproc
pushq %rax
.cfi_def_cfa_offset 16
movslq %edi, %rax
leaq _ZN1t4main17he95a7d4f1843730eE(%rip), %rdi
movq %rsi, (%rsp)
movq %rax, %rsi
movq (%rsp), %rdx
callq _ZN3std2rt10lang_start17h3121da83b2bc3697E
movl %eax, %ecx
movl %ecx, %eax
popq %rcx
.cfi_def_cfa_offset 8
retq
.Lfunc_end8:
.size main, .Lfunc_end8-main
.cfi_endproc
```

After:
```
.section .text.main,"ax",@progbits
.globl main                    # -- Begin function main
.p2align 4, 0x90
.type main,@function
main:                                   # @main
.cfi_startproc
# %bb.0:
pushq %rax
.cfi_def_cfa_offset 16
movslq %edi, %rax
leaq _ZN1t4main17he95a7d4f1843730eE(%rip), %rdi
movq %rsi, (%rsp)            # 8-byte Spill
movq %rax, %rsi
movq (%rsp), %rdx            # 8-byte Reload
callq _ZN3std2rt10lang_start17h3121da83b2bc3697E
movl %eax, %ecx
movl %ecx, %eax
popq %rcx
.cfi_def_cfa_offset 8
retq
.Lfunc_end8:
.size main, .Lfunc_end8-main
.cfi_endproc
                                        # -- End function
```

5 years agoRollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa
kennytm [Tue, 14 Aug 2018 15:59:15 +0000 (23:59 +0800)]
Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa

Remove statics field from CodegenCx

It doesnt seem to be used anywhere.

5 years agoRollup merge of #53257 - faern:ip-method-idiomatic-improvement, r=TimNN
kennytm [Tue, 14 Aug 2018 15:59:13 +0000 (23:59 +0800)]
Rollup merge of #53257 - faern:ip-method-idiomatic-improvement, r=TimNN

Idiomatic improvements to IP method

Since match ergonomics and slice patterns are stable this might be more idiomatic modern Rust implementations of these methods? Or well, slice patterns with `..` are not stabilized yet, so maybe we want to specify all fields but with `_`?

5 years agoRollup merge of #53246 - ljedrz:cleanup_various, r=kennytm
kennytm [Tue, 14 Aug 2018 15:59:12 +0000 (23:59 +0800)]
Rollup merge of #53246 - ljedrz:cleanup_various, r=kennytm

A few cleanups

- change `skip(1).next()` to `nth(1)`
- collapse some `if-else` expressions
- remove a few explicit `return`s
- remove an unnecessary field name
- dereference once instead of matching on multiple references
- prefer `iter().enumerate()` to indexing with `for`
- remove some unnecessary lifetime annotations
- use `writeln!()` instead of `write!()`+`\n`
- remove redundant parentheses
- shorten some enum variant names
- a few other cleanups suggested by `clippy`

5 years agoRollup merge of #53239 - cuviper:llvm5-closure-alloca, r=eddyb
kennytm [Tue, 14 Aug 2018 15:59:11 +0000 (23:59 +0800)]
Rollup merge of #53239 - cuviper:llvm5-closure-alloca, r=eddyb

rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.

This hack was removed in #50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.

It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.

This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb.
Fixes #53204.
r? @eddyb

5 years agoRollup merge of #53233 - andre-richter:master, r=alexcrichton
kennytm [Tue, 14 Aug 2018 15:59:09 +0000 (23:59 +0800)]
Rollup merge of #53233 - andre-richter:master, r=alexcrichton

targets: aarch64: Add bare-metal aarch64 target

A generic AArch64 target that can be used for writing bare-metal code
for 64-bit ARM architectures.

5 years agoRollup merge of #53229 - varkor:rlimits_min, r=nikomatsakis
kennytm [Tue, 14 Aug 2018 15:59:08 +0000 (23:59 +0800)]
Rollup merge of #53229 - varkor:rlimits_min, r=nikomatsakis

Make sure rlimit is only ever increased

`libc::setrlimit` will fail if we try to set the rlimit to a value lower than it is currently, so make sure we're never trying to do this. Fixes #52801.

5 years agoRollup merge of #53226 - QuietMisdreavus:editions-for-all, r=estebank
kennytm [Tue, 14 Aug 2018 15:59:07 +0000 (23:59 +0800)]
Rollup merge of #53226 - QuietMisdreavus:editions-for-all, r=estebank

driver: set the syntax edition in phase 1

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

It seems the way libsyntax handles the desired edition is to use a global, set via `syntax_pos::hygiene::set_default_edition`. Right now, this is set in the driver in `run_compiler`, which is the entry point for running the compiler all the way through to emitting files. Since rustdoc doesn't use this function, it wasn't properly setting this global. (When initially setting up editions in rustdoc, i'd assumed that setting `sessopts.edition` would have done this... `>_>`) This was "fixed" for doctests in https://github.com/rust-lang/rust/pull/52385, but rather than patching in a call to `set_default_edition` in all the places rustdoc sets up the compiler, i've instead moved the call in the driver to be farther in the process. This means that any use of `phase_1_parse_input` with the right session options will have the edition properly set without having to also remember to set libsyntax up separately.

r? @rust-lang/compiler

5 years agoRollup merge of #53208 - BurntPizza:protect-the-environment, r=alexcrichton
kennytm [Tue, 14 Aug 2018 15:59:05 +0000 (23:59 +0800)]
Rollup merge of #53208 - BurntPizza:protect-the-environment, r=alexcrichton

Don't panic on std::env::vars() when env is null.

Fixes #53200.

Reviewer(s):
* Do I need to do any `#[cfg()]` here?
* Is this use of libc ok for a dev-dependency?

5 years agoRollup merge of #53112 - fukatani:pretty-print-btreeset, r=michaelwoerister
kennytm [Tue, 14 Aug 2018 15:59:04 +0000 (23:59 +0800)]
Rollup merge of #53112 - fukatani:pretty-print-btreeset, r=michaelwoerister

pretty print BTreeSet

I want pretty printing for BTreeSet.
```rust
use std::collections::*;

fn main() {
  let mut s = BTreeSet::new();
  s.insert(5);
  s.insert(3);
  s.insert(7);
  s.remove(&3);
  println!("{:?}", s);
}
```

```
(gdb) b 9
(gdb) p s
$1 = BTreeSet<i32> with 2 elements = {[0] = 5, [1] = 7}
```
This is analogy of pretty printing for C++ std::set.

5 years agoLabel definition of captured variables in errors.
David Wood [Tue, 7 Aug 2018 15:06:21 +0000 (17:06 +0200)]
Label definition of captured variables in errors.

5 years agoAdded some debug logging.
David Wood [Tue, 7 Aug 2018 13:37:32 +0000 (15:37 +0200)]
Added some debug logging.

5 years agoAuto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz
bors [Tue, 14 Aug 2018 15:09:37 +0000 (15:09 +0000)]
Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz

Move SmallVector and ThinVec out of libsyntax

- move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec`
- remove `libsyntax::util::SmallVector`
- move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec`

Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.

5 years agoAdd regression test for issue #30104
memoryruins [Tue, 14 Aug 2018 14:26:47 +0000 (10:26 -0400)]
Add regression test for issue #30104

#30104

5 years agoAdd regression test for issue #48697
memoryruins [Tue, 14 Aug 2018 14:25:54 +0000 (10:25 -0400)]
Add regression test for issue #48697

#48697

5 years agoadd copyright from template
Hideki Sekine [Tue, 14 Aug 2018 14:19:12 +0000 (23:19 +0900)]
add copyright from template