]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=kennytm
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:57 +0000 (21:50 +0200)]
Rollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

5 years agoRollup merge of #60146 - Manishearth:font-update, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:55 +0000 (21:50 +0200)]
Rollup merge of #60146 - Manishearth:font-update, r=QuietMisdreavus

Update fonts used by rustdoc

Our version of Source Serif Pro is pretty old and is causing issues on Linux, see https://bugzilla.mozilla.org/show_bug.cgi?id=1545317 . I took this opportunity to update all of the fonts we use.

r? @steveklabnik @QuietMisdreavus

5 years agoRollup merge of #59839 - KodrAus:must-use-num, r=sfackler
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:54 +0000 (21:50 +0200)]
Rollup merge of #59839 - KodrAus:must-use-num, r=sfackler

Warn on unused results for operation methods on nums

From a suggestion by @llogiq

Adds a `#[must_use]` attribute to operation methods on integers that take self by value as the first operand and another value as the second. It makes it clear that these methods return the result of the operation instead of mutating `self`, which is the source of a rather embarrassing bug I had in a codebase of mine recently...

As an example:

```rust
struct Int {
   value: i64,
}

impl Int {
    fn add(&mut self, other: i64) {
        self.value.wrapping_add(other);
    }
}
```

Will produce a warning like:

```
warning: unused return value of `core::num::<impl i64>::wrapping_add` that must be used
 --> src/main.rs:7:7
  |
7 |       self.value.wrapping_add(other);
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(unused_must_use)] on by default
  = note: this returns the result of the operation, without modifying the original
```

If this is something we're on board with, we could do something similar for `f32` and `f64` too. There are probably other methods on integers that make sense.

5 years agoRollup merge of #59823 - davidtwco:issue-54716, r=cramertj
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:52 +0000 (21:50 +0200)]
Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj

[wg-async-await] Drop `async fn` arguments in async block

Fixes #54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis

5 years agoReduce noise and document test case.
David Wood [Tue, 23 Apr 2019 17:44:41 +0000 (18:44 +0100)]
Reduce noise and document test case.

This commit introduces a `assert_drop_order_after_poll` helper function
to the test case for this case to reduce repetitive noise and documents
what each function aims to test.

5 years agoAuto merge of #60155 - davidtwco:issue-59819, r=oli-obk
bors [Tue, 23 Apr 2019 15:54:23 +0000 (15:54 +0000)]
Auto merge of #60155 - davidtwco:issue-59819, r=oli-obk

Suggest dereferencing when `Deref` is implemented.

Fixes #59819.

r? @oli-obk
cc @estebank

5 years agoAuto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkor
bors [Tue, 23 Apr 2019 12:27:38 +0000 (12:27 +0000)]
Auto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkor

Remove `visit_subpats` parameter from `check_pat`

The core idea is to keep track of current ID directly in `EllipsisInclusiveRangePatterns` struct and early return in `check_pat` based on it.

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

r? @varkor

5 years agoFix regression in line ending test
varkor [Tue, 23 Apr 2019 10:44:27 +0000 (11:44 +0100)]
Fix regression in line ending test

5 years agoRemove unnecessary tidy ignore directives
varkor [Mon, 22 Apr 2019 19:56:27 +0000 (20:56 +0100)]
Remove unnecessary tidy ignore directives

5 years agoCheck for other unused tidy check directives
varkor [Mon, 22 Apr 2019 19:56:13 +0000 (20:56 +0100)]
Check for other unused tidy check directives

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 16:35:37 +0000 (17:35 +0100)]
Update ui tests

5 years agoRemove unnecessary ignore-tidy-linelength
varkor [Mon, 22 Apr 2019 15:15:50 +0000 (16:15 +0100)]
Remove unnecessary ignore-tidy-linelength

5 years agoTidy warn on ignored line length when lines are not too long
varkor [Mon, 22 Apr 2019 15:15:39 +0000 (16:15 +0100)]
Tidy warn on ignored line length when lines are not too long

5 years agoLook specifically for comments containing tidy ignore directives
varkor [Mon, 22 Apr 2019 15:15:18 +0000 (16:15 +0100)]
Look specifically for comments containing tidy ignore directives

5 years agoAuto merge of #60125 - estebank:continue-evaluating, r=oli-obk
bors [Tue, 23 Apr 2019 09:38:34 +0000 (09:38 +0000)]
Auto merge of #60125 - estebank:continue-evaluating, r=oli-obk

Don't stop evaluating due to errors before borrow checking

r? @oli-obk

Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.

5 years agoAuto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm
bors [Tue, 23 Apr 2019 06:40:12 +0000 (06:40 +0000)]
Auto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm

Disallow double trailing newlines in tidy

This wasn't done previously in https://github.com/rust-lang/rust/pull/47064#issuecomment-354533010 as it affected too many files, but I think it's best to fix it now so that the number of files with double trailing newlines doesn't keep increasing.

r? kennytm

5 years agoAuto merge of #60121 - davazp:fix-sync-all-macos, r=KodrAus
bors [Tue, 23 Apr 2019 03:34:21 +0000 (03:34 +0000)]
Auto merge of #60121 - davazp:fix-sync-all-macos, r=KodrAus

Fix sync_all on macos/ios

`sync_all` should flush all metadata in macos/ios, so it should call `fcntl` with the `F_FULLFSYNC` flag as `sync_data` does.

Note that without this `sync_data` performs more flushes than `sync_all` on macos/ios.

5 years agoAuto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez
bors [Tue, 23 Apr 2019 00:44:58 +0000 (00:44 +0000)]
Auto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez

upgrade rustdoc's pulldown-cmark to 0.4.1

Fixes #59194.

5 years agoAuto merge of #60126 - estebank:continue-eval, r=oli-obk
bors [Mon, 22 Apr 2019 21:46:07 +0000 (21:46 +0000)]
Auto merge of #60126 - estebank:continue-eval, r=oli-obk

Continue evaluating after item-type checking

Fix #30999.

r? @oli-obk

5 years agoRemove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns
Tomas Koutsky [Sun, 21 Apr 2019 14:09:30 +0000 (17:09 +0300)]
Remove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns

5 years agoreview comment: add HACK comment
Esteban Küber [Mon, 22 Apr 2019 20:14:43 +0000 (13:14 -0700)]
review comment: add HACK comment

5 years agoFix ICE related to #53708
Esteban Küber [Fri, 19 Apr 2019 21:53:34 +0000 (14:53 -0700)]
Fix ICE related to #53708

5 years agoNever stop due to errors before borrow checking
Esteban Küber [Mon, 15 Apr 2019 19:54:18 +0000 (12:54 -0700)]
Never stop due to errors before borrow checking

5 years agoRemove needless error in test
Esteban Küber [Mon, 22 Apr 2019 19:19:07 +0000 (12:19 -0700)]
Remove needless error in test

5 years agoreview comments: deduplicate tests
Esteban Küber [Mon, 22 Apr 2019 19:11:46 +0000 (12:11 -0700)]
review comments: deduplicate tests

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 18:50:11 +0000 (19:50 +0100)]
Update ui tests

5 years agoContinue evaluating after item-type checking
Esteban Küber [Fri, 19 Apr 2019 22:37:34 +0000 (15:37 -0700)]
Continue evaluating after item-type checking

5 years agoOnly make suggestion when type is `Copy`.
David Wood [Mon, 22 Apr 2019 09:16:47 +0000 (10:16 +0100)]
Only make suggestion when type is `Copy`.

This commit makes the suggestion to dereference when a type implements
`Deref` only apply if the dereference would succeed (ie. the type is
`Copy`, otherwise a borrow check error would occur).

5 years agoAuto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton
bors [Mon, 22 Apr 2019 16:30:42 +0000 (16:30 +0000)]
Auto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton

Add a tidy check for leading newlines

This is fairly uncommon, but it can slip through when refactoring (as evidenced by the files with leading newlines here).

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 16:30:54 +0000 (17:30 +0100)]
Update ui tests

5 years agoRemove leading newlines
varkor [Mon, 22 Apr 2019 14:50:02 +0000 (15:50 +0100)]
Remove leading newlines

5 years agoAdd a tidy check for leading trailing newlines
varkor [Mon, 22 Apr 2019 14:49:51 +0000 (15:49 +0100)]
Add a tidy check for leading trailing newlines

5 years agoDisallow double trailing newlines in tidy
varkor [Mon, 22 Apr 2019 15:56:47 +0000 (16:56 +0100)]
Disallow double trailing newlines in tidy

5 years agoRemove double trailing newlines
varkor [Mon, 22 Apr 2019 15:55:33 +0000 (16:55 +0100)]
Remove double trailing newlines

5 years agoupgrade rustdoc's pulldown-cmark to 0.4.1
Andy Russell [Sat, 20 Apr 2019 17:03:59 +0000 (13:03 -0400)]
upgrade rustdoc's pulldown-cmark to 0.4.1

5 years agoAuto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix
bors [Mon, 22 Apr 2019 12:09:59 +0000 (12:09 +0000)]
Auto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix

Enable NLL migrate mode on the 2015 edition

## What is in this PR?

* Remove the `-Zborrowck=ast` flag option from rustc.
* The default in the 2015 edition is now `-Zborrowck=migrate`.
* The 2018 edition default is unchanged: it's still `-Zborrowck=migrate`.
* Enable two-phase borrows (currently toggled via the `-Ztwo-phase-borrows` flag) on all editions.
* Remove most dead code that handled these options.
* Update tests for the above changes.

## What is *not* in this PR?

These are left for future PRs

* Use `-Zborrowck=mir` in NLL compare mode tests (#56993)
* Remove the `-Zborrowck=compare` option (#59193)
* Remove the `-Ztwo-phase-borrows` flag. It's kept, as a flag that does nothing so that perf.rlo has time to stop using it (cc @Mark-Simulacrum)
* Remove MIR typeck as its own MIR pass - it's now run by NLL.
* Enabling `-Zborrowck=mir` by default (#58781)
* Replace `allow_bind_by_move_patterns_with_guards` and `check_for_mutation_in_guard_via_ast_walk` with just using the feature gate. (#59192)

Soundness issues that are fixed by NLL will stay open until full NLL is emitting hard errors. However, these diagnostics and completeness issues can now be closed:

Closes #18330
Closes #22323
Closes #23591
Closes #26736
Closes #27487
Closes #28092
Closes #28970
Closes #29733
Closes #30104
Closes #38915
Closes #39908
Closes #43407
Closes #47524
Closes #48540
Closes #49073
Closes #52614
Closes #55085
Closes #56093
Closes #56496
Closes #57804

cc #43234

r? @pnkfelix
cc @rust-lang/lang
cc @rust-lang/wg-compiler-nll

5 years agoupdate tests for migrate mode by default
Matthew Jasper [Mon, 22 Apr 2019 07:40:08 +0000 (08:40 +0100)]
update tests for migrate mode by default

5 years agoAuto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril
bors [Mon, 22 Apr 2019 07:28:20 +0000 (07:28 +0000)]
Auto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril

Deny rust_2018_idioms globally

cc https://github.com/rust-lang/rust/issues/58099#issuecomment-484921194

5 years agoAuto merge of #60053 - Xanewok:serde-save-analysis, r=nrc
bors [Mon, 22 Apr 2019 01:46:13 +0000 (01:46 +0000)]
Auto merge of #60053 - Xanewok:serde-save-analysis, r=nrc

save-analysis: Use serde instead of libserialize to dump JSON data

This breaks the save-analysis infrastructure (which also includes `rls-{analysis, data, span}` crates) from depending on rustc_serialize and so we can start moving them to being supported on stable without implementing `Decodable` et al. by hand for data structures defined there.

Notable benefits:
- we drop the awkward raw byte `PathBuf` [serialization](https://gist.github.com/Xanewok/f4fe8564d0dc0c3ab1dbc244279ff895) (until now (de)serialized as `&[u8]`)
- [faster](https://github.com/serde-rs/json-benchmark) (hopefully noticeable for inner crate dependencies for the RLS workloads)
- we can easily explore the binary serialization backend (which we planned to do for save-analysis anyway)

~This should be merged together with an update to RLS (https://github.com/rust-lang/rls/pull/1435), which technically could be included right now because we can use the bundled `rls-analysis` here directly, however I'd prefer to publish this to crates.io first (https://github.com/rust-lang/rls/pull/1434, cc @nrc) and use the published version, instead.~
Includes https://github.com/rust-lang/rls/pull/1436.

@matklad @nikomatsakis This is also important for the potential RLS 1.0 - 2.0 bridge we talked about on Zulip today

5 years agoAuto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr
bors [Sun, 21 Apr 2019 21:46:15 +0000 (21:46 +0000)]
Auto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr

Update Clippy

Fixes fallout from https://github.com/rust-lang/rust/pull/60124.
Closes #60154.

r? @oli-obk
cc @matthiaskrgr

5 years agoUpdate Clippy
Igor Matuszewski [Sun, 21 Apr 2019 21:03:27 +0000 (23:03 +0200)]
Update Clippy

Fixes fallout from https://github.com/rust-lang/rust/pull/60124.
Closes #60154.

5 years agoEnable migrate mode by default on the 2015 edition
Matthew Jasper [Sat, 26 Jan 2019 17:25:37 +0000 (17:25 +0000)]
Enable migrate mode by default on the 2015 edition

This also fully stabilizes two-phase borrows on all editions

5 years agoSuggest dereferencing when `Deref` is implemented.
David Wood [Sun, 21 Apr 2019 19:00:32 +0000 (20:00 +0100)]
Suggest dereferencing when `Deref` is implemented.

This commit suggests dereferencing a type when it implements `Deref`
with the correct `Output` associated type.

5 years agoAdd existing behaviour test for deref suggestions.
David Wood [Sun, 21 Apr 2019 17:49:02 +0000 (18:49 +0100)]
Add existing behaviour test for deref suggestions.

This commit adds a test that demonstrates the current behaviour where
suggestions to add a dereference aren't given for non-references.

5 years agoDisplay original pattern in rustdoc.
David Wood [Sun, 21 Apr 2019 13:33:28 +0000 (14:33 +0100)]
Display original pattern in rustdoc.

This commit displays the original pattern in generated documentation for
async functions rather than the synthesized pattern.

5 years agoCorrect lowering order to avoid ICE after rebase.
David Wood [Sat, 20 Apr 2019 23:04:10 +0000 (00:04 +0100)]
Correct lowering order to avoid ICE after rebase.

This commit changes the order that arguments and bodies of async
functions are lowered so that when the body attempts to `lower_def` of a
upvar then the id has already been assigned by lowering the argument
first.

5 years agoIntroduce `ArgSource` for diagnostics.
David Wood [Wed, 13 Mar 2019 16:10:27 +0000 (17:10 +0100)]
Introduce `ArgSource` for diagnostics.

This commit introduces an `ArgSource` enum that is lowered into the HIR
so that diagnostics can correctly refer to the argument pattern's
original name rather than the generated pattern.

5 years agoDo not specify type in generated let bindings.
David Wood [Wed, 13 Mar 2019 16:08:34 +0000 (17:08 +0100)]
Do not specify type in generated let bindings.

This avoids issues with `impl_trait_in_bindings` as the type from the
argument is normally used as the let binding, but `impl Trait` is
unstable in binding position.

5 years agoEnforce consistent drop order w/ async methods.
David Wood [Wed, 13 Mar 2019 09:45:36 +0000 (10:45 +0100)]
Enforce consistent drop order w/ async methods.

This commit extends the previous commit to apply to trait methods as
well as free functions.

5 years agoMove `async fn` arguments into closure.
David Wood [Tue, 12 Mar 2019 16:12:18 +0000 (17:12 +0100)]
Move `async fn` arguments into closure.

This commit takes advantage of `AsyncArgument` type that was added in a
previous commit to replace the arguments of the `async fn` in the HIR
and add statements to move the bindings from the new arguments to the
pattern from the old argument.

For example, the async function `foo` below:

    async fn foo((x, _y): (T, V)) {
        async move {
        }
    }

becomes:

    async fn foo(__arg0: (T, V)) {
        async move {
            let (x, _y) = __arg0;
        }
    }

5 years agoAdd `AsyncArgument` to AST.
David Wood [Tue, 12 Mar 2019 16:00:20 +0000 (17:00 +0100)]
Add `AsyncArgument` to AST.

This commit adds an `AsyncArgument` struct to the AST that contains the
generated argument and statement that will be used in HIR lowering, name
resolution and def collection.

5 years agoUse sysroot libserialize in newtype_index test
Igor Matuszewski [Sun, 21 Apr 2019 13:51:28 +0000 (15:51 +0200)]
Use sysroot libserialize in newtype_index test

5 years agoAuto merge of #60124 - petrochenkov:stanomut, r=eddyb
bors [Sun, 21 Apr 2019 13:40:22 +0000 (13:40 +0000)]
Auto merge of #60124 - petrochenkov:stanomut, r=eddyb

Remove mutability from `Def::Static`

Querify `TyCtxt::is_static`.
Use `Mutability` instead of bool in foreign statics in AST/HIR.

cc https://github.com/rust-lang/rust/pull/60110
r? @eddyb

5 years agoAST/HIR: Use `Mutability` instead of bool in foreign statics
Vadim Petrochenkov [Sun, 21 Apr 2019 12:29:58 +0000 (15:29 +0300)]
AST/HIR: Use `Mutability` instead of bool in foreign statics

5 years agoRemove mutability from `Def::Static`
Vadim Petrochenkov [Fri, 19 Apr 2019 20:32:26 +0000 (23:32 +0300)]
Remove mutability from `Def::Static`

5 years agoChange return type of `TyCtxt::is_static` to bool
Vadim Petrochenkov [Sun, 21 Apr 2019 11:41:51 +0000 (14:41 +0300)]
Change return type of `TyCtxt::is_static` to bool

Add `TyCtxt::is_mutable_static`

5 years agoIntroduce query `static_mutability`
Vadim Petrochenkov [Fri, 19 Apr 2019 20:32:26 +0000 (23:32 +0300)]
Introduce query `static_mutability`

5 years agoSwitch to serde-enabled rls-* and update RLS appropriately
Igor Matuszewski [Sun, 21 Apr 2019 10:52:07 +0000 (12:52 +0200)]
Switch to serde-enabled rls-* and update RLS appropriately

This also bumps RLS version to 1.36.
The updated rls-* packages use serde but *not* serde_derive thanks to
manual proc macro expansion. This is a hack, since rustc cannot handle
crates.io proc macros (duplicated in tools) when cross-compiling, so
that's the best we can do in order to support serde_json in save-analysis.

5 years agosave-analysis: Use serde instead of libserialize to dump JSON data
Igor Matuszewski [Wed, 17 Apr 2019 19:34:35 +0000 (21:34 +0200)]
save-analysis: Use serde instead of libserialize to dump JSON data

5 years agoAuto merge of #60119 - estebank:bad-recovery, r=davidtwco
bors [Sun, 21 Apr 2019 10:13:27 +0000 (10:13 +0000)]
Auto merge of #60119 - estebank:bad-recovery, r=davidtwco

Remove assumption from recovery code

Fix #60115.

5 years agoAllow unused_extern_crates for rustc_libserialize
Philipp Hansch [Sun, 21 Apr 2019 08:52:12 +0000 (10:52 +0200)]
Allow unused_extern_crates for rustc_libserialize

5 years agoIntroduce `LocalSource` into the AST.
David Wood [Tue, 12 Mar 2019 15:53:33 +0000 (16:53 +0100)]
Introduce `LocalSource` into the AST.

This will be used to keep track of the origin of a local in the AST. In
particular, it will be used by `async fn` lowering for the locals in
`let <pat>: <ty> = __arg0;` statements.

5 years agoAdd test for drop order in async functions.
David Wood [Thu, 7 Mar 2019 22:15:57 +0000 (23:15 +0100)]
Add test for drop order in async functions.

This tests that async functions drop parameters in the same order as
regular functions.

5 years agoAuto merge of #60132 - davidtwco:issue-60075, r=estebank
bors [Sun, 21 Apr 2019 07:20:14 +0000 (07:20 +0000)]
Auto merge of #60132 - davidtwco:issue-60075, r=estebank

Fix fn front matter parsing ICE from invalid code.

Fixes #60075.

This PR fixes an "unreachable code" ICE that results from parsing
invalid code where the compiler is expecting the next trait item
declaration in the middle of the previous trait item due to extra
closing braces.

r? @estebank (thanks for the minimized test case)

5 years agoUpdate Fira Sans to version 4.202
Manish Goregaokar [Sun, 21 Apr 2019 02:37:25 +0000 (19:37 -0700)]
Update Fira Sans to version 4.202

From https://github.com/mozilla/Fira

5 years agoUpdate Source Code Pro fonts to version 2.030
Manish Goregaokar [Sun, 21 Apr 2019 02:33:58 +0000 (19:33 -0700)]
Update Source Code Pro fonts to version 2.030

Pulled in from https://github.com/adobe-fonts/source-code-pro/

5 years agoUpdate Source Serif Pro fonts to version 2.010
Manish Goregaokar [Sun, 21 Apr 2019 02:27:37 +0000 (19:27 -0700)]
Update Source Serif Pro fonts to version 2.010

Pulled in from https://github.com/adobe-fonts/source-serif-pro/

See https://bugzilla.mozilla.org/show_bug.cgi?id=1545317

5 years agoAuto merge of #60116 - RalfJung:miri-exit, r=oli-obk
bors [Sun, 21 Apr 2019 02:38:15 +0000 (02:38 +0000)]
Auto merge of #60116 - RalfJung:miri-exit, r=oli-obk

add Miri error variant for process exit

This is to support https://github.com/rust-lang/miri/pull/702

r? @oli-obk

5 years agoAuto merge of #60088 - varkor:async_await-method-feature-gate, r=cramertj
bors [Sat, 20 Apr 2019 23:44:02 +0000 (23:44 +0000)]
Auto merge of #60088 - varkor:async_await-method-feature-gate, r=cramertj

Feature gate async methods

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

5 years agoUpdate error message in test
varkor [Sat, 20 Apr 2019 21:32:47 +0000 (22:32 +0100)]
Update error message in test

5 years agoCheck async in trait methods
varkor [Thu, 18 Apr 2019 19:57:15 +0000 (20:57 +0100)]
Check async in trait methods

5 years agoFix additional variadic typos
varkor [Thu, 18 Apr 2019 19:36:32 +0000 (20:36 +0100)]
Fix additional variadic typos

5 years agoFix typo in variadic C function warning
varkor [Thu, 18 Apr 2019 18:16:17 +0000 (19:16 +0100)]
Fix typo in variadic C function warning

5 years agoAdd test for async fn methods feature gating
varkor [Thu, 18 Apr 2019 18:15:53 +0000 (19:15 +0100)]
Add test for async fn methods feature gating

5 years agoFeature gate async fn methods
varkor [Thu, 18 Apr 2019 18:15:43 +0000 (19:15 +0100)]
Feature gate async fn methods

5 years agoRefactor some existing methods
varkor [Thu, 18 Apr 2019 17:47:52 +0000 (18:47 +0100)]
Refactor some existing methods

5 years agoAdd a `header` method to `FnKind`
varkor [Thu, 18 Apr 2019 17:44:55 +0000 (18:44 +0100)]
Add a `header` method to `FnKind`

5 years agoAuto merge of #59826 - llogiq:multi-dbg, r=SimonSapin
bors [Sat, 20 Apr 2019 20:55:29 +0000 (20:55 +0000)]
Auto merge of #59826 - llogiq:multi-dbg, r=SimonSapin

allow multiple args to `dbg!(..)`

This closes #59763

5 years agoAuto merge of #59700 - matklad:simplify, r=eddyb
bors [Sat, 20 Apr 2019 17:59:15 +0000 (17:59 +0000)]
Auto merge of #59700 - matklad:simplify, r=eddyb

Simplify doc comment lexing

is_doc_comment function checks the first four chars, but this is
redundant, `doc_comment` local var has the same info.

5 years agoDeny rust_2018_idioms in libcore tests
Philipp Hansch [Sat, 20 Apr 2019 16:44:29 +0000 (18:44 +0200)]
Deny rust_2018_idioms in libcore tests

5 years agoimprove docs
Ralf Jung [Sat, 20 Apr 2019 16:38:39 +0000 (18:38 +0200)]
improve docs

5 years agoAuto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obk
bors [Sat, 20 Apr 2019 15:06:15 +0000 (15:06 +0000)]
Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obk

Refactor Adjust and CastKind

fixes rust-lang#59588

5 years agoDeny rust_2018_idioms in liballoc tests
Philipp Hansch [Sat, 20 Apr 2019 14:05:25 +0000 (16:05 +0200)]
Deny rust_2018_idioms in liballoc tests

5 years agoAuto merge of #59564 - bjorn3:move_link_to_cg_ssa, r=eddyb
bors [Sat, 20 Apr 2019 12:18:49 +0000 (12:18 +0000)]
Auto merge of #59564 - bjorn3:move_link_to_cg_ssa, r=eddyb

Move back::link and debuginfo::type_names to cg ssa

r? @eddyb

5 years agoDeny rust_2018_idioms globally
Philipp Hansch [Sat, 20 Apr 2019 11:45:46 +0000 (13:45 +0200)]
Deny rust_2018_idioms globally

5 years agoTidy
bjorn3 [Sat, 30 Mar 2019 15:16:25 +0000 (16:16 +0100)]
Tidy

5 years agoMove cg_llvm/debuginfo/type_names.rs to cg_ssa
bjorn3 [Sat, 30 Mar 2019 14:45:09 +0000 (15:45 +0100)]
Move cg_llvm/debuginfo/type_names.rs to cg_ssa

5 years agoRemove cg_llvm/back/link.rs
bjorn3 [Sat, 30 Mar 2019 14:30:07 +0000 (15:30 +0100)]
Remove cg_llvm/back/link.rs

5 years agoMove almost all of cg_llvm/back/link.rs to cg_ssa
bjorn3 [Sat, 30 Mar 2019 14:25:10 +0000 (15:25 +0100)]
Move almost all of cg_llvm/back/link.rs to cg_ssa

5 years agoRemove get_reloc_model and target_cpu dependency from most of link.rs
bjorn3 [Sat, 30 Mar 2019 11:59:40 +0000 (12:59 +0100)]
Remove get_reloc_model and target_cpu dependency from most of link.rs

5 years agoMake link functions generic over archive builder
bjorn3 [Sat, 30 Mar 2019 11:59:40 +0000 (12:59 +0100)]
Make link functions generic over archive builder

5 years agoMove some filename constants to cg_ssa
bjorn3 [Sat, 30 Mar 2019 12:03:52 +0000 (13:03 +0100)]
Move some filename constants to cg_ssa

5 years agoMove some function from cg_llvm/back/link.rs to cg_ssa/back/link.rs
bjorn3 [Sat, 30 Mar 2019 10:25:22 +0000 (11:25 +0100)]
Move some function from cg_llvm/back/link.rs to cg_ssa/back/link.rs

5 years agoFix fn front matter parsing ICE from invalid code.
David Wood [Sat, 20 Apr 2019 10:31:38 +0000 (11:31 +0100)]
Fix fn front matter parsing ICE from invalid code.

This commit fixes an "unreachable code" ICE that results from parsing
invalid code where the compiler is expecting the next trait item
declaration in the middle of the previous trait item due to extra
closing braces.

5 years agoAuto merge of #60128 - jimblandy:futures-doc-fix, r=withoutboats
bors [Sat, 20 Apr 2019 09:30:51 +0000 (09:30 +0000)]
Auto merge of #60128 - jimblandy:futures-doc-fix, r=withoutboats

Doc fixes for core::future::Future.

Fixed outdated reference to `waker` argument; now futures are passed a
`Context`, from which one can obtain a `waker`.

Cleaned up explanation of what happens when you call `poll` on a completed
future. It doesn't make sense to say that `poll` implementations can't cause
memory unsafety; no safe function is ever allowed to cause memory unsafety, so
why mention it here? It seems like the intent is to say that the `Future` trait
doesn't say what the consequences of excess polls will be, and they might be
bad; but that the usual constraints that Rust imposes on any non-`unsafe`
function still apply. It's also oddly specific to say 'memory corruption'
instead of just 'undefined behavior'; UB is a bit jargony, so the text should
provide examples.

5 years agocore::future::Future: Fix markup typo in docs.
Jim Blandy [Sat, 20 Apr 2019 02:25:40 +0000 (19:25 -0700)]
core::future::Future: Fix markup typo in docs.

5 years agoDoc fixes for core::future::Future.
Jim Blandy [Sat, 20 Apr 2019 02:10:24 +0000 (19:10 -0700)]
Doc fixes for core::future::Future.

Fixed outdated reference to `waker` argument; now futures are passed a
`Context`, from which one can obtain a `waker`.

Cleaned up explanation of what happens when you call `poll` on a completed
future. It doesn't make sense to say that `poll` implementations can't cause
memory unsafety; no safe function is ever allowed to cause memory unsafety, so
why mention it here? It seems like the intent is to say that the `Future` trait
doesn't say what the consequences of excess polls will be, and they might be
bad; but that the usual constraints that Rust imposes on any non-`unsafe`
function still apply. It's also oddly specific to say 'memory corruption'
instead of just 'undefined behavior'; UB is a bit jargony, so the text should
provide examples.

5 years agoAuto merge of #60120 - matthiaskrgr:submodule_upd, r=sanxiyn
bors [Sat, 20 Apr 2019 00:12:14 +0000 (00:12 +0000)]
Auto merge of #60120 - matthiaskrgr:submodule_upd, r=sanxiyn

submodules: update clippy from fbb3a47b to cafbe7f2

Changes:
````
Update compiletest_rs
Typo
Fix dogfood error
Add lint PathBufPushOverwrite
Update *.stderr file
Remove code duplication
Format code
Add test for debug_assert!(false)
Don't lint debug_assert!(false)
Add run-rustfix for option_map_or_none lint
Move two cast_lossless tests to their correct files
Change naive_bytecount applicability MaybeIncorrect
Add tests for declare_lint_pass and impl_lint_pass
Use lint pass macros
Document `declare_lint_pass!`
Fix lint_without_lint_pass internal lint
Use {get,match}_def_path from LateContext
Remove uplifted functions {get,match}_def_path from Clippy
Add run-rustfix for len_zero lint
Add run-rustfix for bool_comparison lint
Add run-rustfix for deref_addrof lint
while_let_loop uses placeholders in suggestions
Remove rust-toolchain file from clippy_dev
Update adding_lints.md
Update PULL_REQUEST_TEMPLATE
Add new lint checklist
Create PULL_REQUEST_TEMPLATE
Only suggest .copied() for Option right now
Also suggest .copied() when .clone() is called on a Copy type
Suggest .copied() instead of .cloned() in map_clone when dealing with references
Deny rustc internal lints
Remove clippy::default_hash_types internal lint
Enable -Zunstable-options in .cargo/config
````

r? @oli-obk

5 years agoAuto merge of #59981 - estebank:recover-struct-lit, r=petrochenkov
bors [Fri, 19 Apr 2019 20:15:11 +0000 (20:15 +0000)]
Auto merge of #59981 - estebank:recover-struct-lit, r=petrochenkov

Emit specific error for struct literal in conditions

Fix #59962, fix #51311.

5 years agoextend ui test
Andre Bogus [Wed, 10 Apr 2019 04:00:35 +0000 (06:00 +0200)]
extend ui test