]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #69964 - ollie27:ci_nodejs, r=Mark-Simulacrum,GuillaumeGomez
Dylan DPC [Mon, 16 Mar 2020 00:30:33 +0000 (01:30 +0100)]
Rollup merge of #69964 - ollie27:ci_nodejs, r=Mark-Simulacrum,GuillaumeGomez

Add Node.js to PR CI image

This should allow the `rustdoc-js` and `rustdoc-js-std` test suites to run automatically on PRs.

4 years agoRollup merge of #69917 - GuillaumeGomez:cleanup-e0412, r=Dylan-DPC
Dylan DPC [Mon, 16 Mar 2020 00:30:31 +0000 (01:30 +0100)]
Rollup merge of #69917 - GuillaumeGomez:cleanup-e0412, r=Dylan-DPC

Cleanup E0412 and E0422

r? @Dylan-DPC

4 years agoRollup merge of #69858 - da-x:windows-precise-time, r=Dylan-DPC
Dylan DPC [Mon, 16 Mar 2020 00:30:28 +0000 (01:30 +0100)]
Rollup merge of #69858 - da-x:windows-precise-time, r=Dylan-DPC

std: on Windows, use GetSystemTimePreciseAsFileTime if it is available

This implements #67266.

4 years agoRollup merge of #69686 - varkor:rustdoc-attributes, r=GuillaumeGomez
Dylan DPC [Mon, 16 Mar 2020 00:30:24 +0000 (01:30 +0100)]
Rollup merge of #69686 - varkor:rustdoc-attributes, r=GuillaumeGomez

Use `pprust` to print attributes in rustdoc

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

I'm not sure what the original motivation was for the `render_attribute`, so I may be missing something, but replacing it with `pprust::attribute_to_string` seems to give the intended output (modulo some spacing idiosyncrasies).

r? @GuillaumeGomez

4 years agoAuto merge of #68944 - Zoxc:hir-map, r=eddyb
bors [Sun, 15 Mar 2020 20:40:16 +0000 (20:40 +0000)]
Auto merge of #68944 - Zoxc:hir-map, r=eddyb

Use queries for the HIR map

r? @eddyb cc @michaelwoerister

4 years agoAuto merge of #70024 - Centril:rollup-cppmaxr, r=Centril
bors [Sun, 15 Mar 2020 17:27:47 +0000 (17:27 +0000)]
Auto merge of #70024 - Centril:rollup-cppmaxr, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #69528 (Add undo_leak to reset RefCell borrow state)
 - #69589 (ast: `Mac`/`Macro` -> `MacCall`)
 - #69661 (Implement From<&mut str> for String)
 - #69988 (rustc_metadata: Remove `rmeta::MacroDef`)
 - #70006 (resolve: Fix two issues in fresh binding disambiguation)
 - #70011 (def_collector: Fully visit async functions)
 - #70013 (Return feature gate as a `Symbol` )
 - #70018 (Fix "since" field for `Once::is_complete`'s `#[stable]` attribute)

Failed merges:

r? @ghost

4 years agoAdd FIXME note
varkor [Tue, 3 Mar 2020 23:47:13 +0000 (23:47 +0000)]
Add FIXME note

4 years agoRender full attributes in rustdoc
varkor [Tue, 3 Mar 2020 23:41:32 +0000 (23:41 +0000)]
Render full attributes in rustdoc

4 years agoRollup merge of #70018 - LukasKalbertodt:fix-once-is-complete-since, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:15 +0000 (15:40 +0100)]
Rollup merge of #70018 - LukasKalbertodt:fix-once-is-complete-since, r=Centril

Fix "since" field for `Once::is_complete`'s `#[stable]` attribute

It was accidentally merged with the wrong version in #68945.  Thanks @jplatte for noticing.

This also needs to be beta backported.

4 years agoRollup merge of #70013 - ecstatic-morse:check-consts-feature-gate, r=oli-obk
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:13 +0000 (15:40 +0100)]
Rollup merge of #70013 - ecstatic-morse:check-consts-feature-gate, r=oli-obk

Return feature gate as a `Symbol`

A minor refactoring that will be needed for #68940. That PR is blocked on me changing the error comments in a whole lot of UI tests.

r? @oli-obk

4 years agoRollup merge of #70011 - petrochenkov:asyncice, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:12 +0000 (15:40 +0100)]
Rollup merge of #70011 - petrochenkov:asyncice, r=Centril

def_collector: Fully visit async functions

We forgot to visit attributes previously, it caused ICEs.

Special treatment of async functions is also moved from `visit_item` to `visit_fn` to reuse more of the default visitor.

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

4 years agoRollup merge of #70006 - petrochenkov:fresh, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:10 +0000 (15:40 +0100)]
Rollup merge of #70006 - petrochenkov:fresh, r=Centril

resolve: Fix two issues in fresh binding disambiguation

Prevent fresh bindings from shadowing ambiguity items.
Fixes https://github.com/rust-lang/rust/issues/46079

Correctly treat const generic parameters in fresh binding disambiguation.
Fixes https://github.com/rust-lang/rust/issues/68853

4 years agoRollup merge of #69988 - petrochenkov:nomacrodef, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:08 +0000 (15:40 +0100)]
Rollup merge of #69988 - petrochenkov:nomacrodef, r=Centril

rustc_metadata: Remove `rmeta::MacroDef`

And other related cleanups.

Follow-up to https://github.com/rust-lang/rust/pull/66364.
r? @Centril

4 years agoRollup merge of #69661 - lopopolo:string-from-mut-str, r=sfackler
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:07 +0000 (15:40 +0100)]
Rollup merge of #69661 - lopopolo:string-from-mut-str, r=sfackler

Implement From<&mut str> for String

I ran into this missing impl when trying to do `String::from` on the result returned from this API in the `uuid` crate:

https://docs.rs/uuid/0.8.1/uuid/adapter/struct.Hyphenated.html#method.encode_lower

I wasn't sure what to put in the stability annotation. I'd appreciate some help with that :)

4 years agoRollup merge of #69589 - petrochenkov:maccall, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:05 +0000 (15:40 +0100)]
Rollup merge of #69589 - petrochenkov:maccall, r=Centril

ast: `Mac`/`Macro` -> `MacCall`

It's now obvious that these refer to macro calls rather than to macro definitions.

It's also a single name instead of two different names in different places.

`rustc_expand` usually calls macro calls in a wide sense (including attributes and derives) "macro invocations", but structures and variants renamed in this PR are only relevant to fn-like macros, so it's simpler and clearer to just call them calls.

cc https://github.com/rust-lang/rust/pull/63586#discussion_r314232513
r? @eddyb

4 years agoRollup merge of #69528 - HeroicKatora:finalize-ref-cell, r=dtolnay
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:03 +0000 (15:40 +0100)]
Rollup merge of #69528 - HeroicKatora:finalize-ref-cell, r=dtolnay

Add undo_leak to reset RefCell borrow state

This method is complementary for the feature cell_leak added in an
earlier PR. It allows *safely* reverting the effects of leaking a borrow guard by
statically proving that such a guard could not longer exist. This was
not added to the existing `get_mut` out of concern of impacting the
complexity of the otherwise pure pointer cast and because the name
`get_mut` poorly communicates the intent of resetting remaining borrows.

This is a follow-up to #68712 and uses the same tracking issue, #69099,
as these methods deal with the same mechanism and the idea came up
[in a review comment](https://github.com/rust-lang/rust/pull/68712#discussion_r384670041).

@dtolnay who reviewed the prior PR.
cc @RalfJung

4 years agoAuto merge of #69961 - RalfJung:miri, r=RalfJung
bors [Sun, 15 Mar 2020 14:18:14 +0000 (14:18 +0000)]
Auto merge of #69961 - RalfJung:miri, r=RalfJung

update miri

r? @ghost
Cc @oli-obk

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

4 years agoAuto merge of #70016 - Dylan-DPC:rollup-5k7lxs3, r=Dylan-DPC
bors [Sun, 15 Mar 2020 10:52:37 +0000 (10:52 +0000)]
Auto merge of #70016 - Dylan-DPC:rollup-5k7lxs3, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #69357 (Emit 1-based column numbers in debuginfo)
 - #69471 (Remove `sip::Hasher::short_write`.)
 - #69498 (Change "method" to "associated function")
 - #69967 (Remove a few `Rc`s from RegionInferenceCtxt)
 - #69987 (Add self to .mailmap)
 - #69991 (fix E0117 message out of sync)
 - #69993 (Add long error explanation for E0693)

Failed merges:

r? @ghost

4 years agoupdate miri
Ralf Jung [Sun, 15 Mar 2020 10:51:09 +0000 (11:51 +0100)]
update miri

4 years agoresolve: Prevent fresh bindings from shadowing ambiguity items
Vadim Petrochenkov [Sat, 14 Mar 2020 16:44:11 +0000 (19:44 +0300)]
resolve: Prevent fresh bindings from shadowing ambiguity items

Correctly treat const generic parameters in fresh binding disambiguation

4 years agoFix "since" field for `Once::is_complete`'s `#[stable]` attribute
Lukas Kalbertodt [Sun, 15 Mar 2020 09:19:26 +0000 (10:19 +0100)]
Fix "since" field for `Once::is_complete`'s `#[stable]` attribute

It was accidentally merged with the wrong version.

4 years agoRollup merge of #69993 - ayushmishra2005:doc/61137-add-long-error-code-e0693, r=Dylan-DPC
Dylan DPC [Sun, 15 Mar 2020 01:44:23 +0000 (02:44 +0100)]
Rollup merge of #69993 - ayushmishra2005:doc/61137-add-long-error-code-e0693, r=Dylan-DPC

Add long error explanation for E0693

Add long explanation for the E0693 error code
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #69991 - contrun:fix-69980, r=Dylan-DPC
Dylan DPC [Sun, 15 Mar 2020 01:44:22 +0000 (02:44 +0100)]
Rollup merge of #69991 - contrun:fix-69980, r=Dylan-DPC

fix E0117 message out of sync

Closes https://github.com/rust-lang/rust/issues/69980

4 years agoRollup merge of #69987 - kraai:mailmap, r=nikomatsakis
Dylan DPC [Sun, 15 Mar 2020 01:44:20 +0000 (02:44 +0100)]
Rollup merge of #69987 - kraai:mailmap, r=nikomatsakis

Add self to .mailmap

The variants are only used for [rust-lang/rust-clippy](https://github.com/rust-lang/rust-clippy), but it seems like <https://thanks.rust-lang.org/> only uses this `.mailmap`.

4 years agoRollup merge of #69967 - mark-i-m:rinfctx, r=matthewjasper
Dylan DPC [Sun, 15 Mar 2020 01:44:18 +0000 (02:44 +0100)]
Rollup merge of #69967 - mark-i-m:rinfctx, r=matthewjasper

Remove a few `Rc`s from RegionInferenceCtxt

fixes https://github.com/rust-lang/rust/issues/55853

r? @matthewjasper

4 years agoRollup merge of #69498 - mark-i-m:describe-it-2, r=matthewjasper
Dylan DPC [Sun, 15 Mar 2020 01:44:17 +0000 (02:44 +0100)]
Rollup merge of #69498 - mark-i-m:describe-it-2, r=matthewjasper

Change "method" to "associated function"

r? @matthewjasper

cc @Centril @eddyb #67742

I'm opening this mostly as a test to see what the diagnostic changes would be. It seems that this makes them somewhat more verbose, and I'm not sure it's worth it...

The relevant changes are the last two commits (it is rebased on top of #67742)

4 years agoRollup merge of #69471 - nnethercote:rm-sip-Hasher-short_write, r=dtolnay
Dylan DPC [Sun, 15 Mar 2020 01:44:15 +0000 (02:44 +0100)]
Rollup merge of #69471 - nnethercote:rm-sip-Hasher-short_write, r=dtolnay

Remove `sip::Hasher::short_write`.

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See #69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.

r? @rust-lang/libs

4 years agoRollup merge of #69357 - tmiasko:debuginfo-column, r=michaelwoerister
Dylan DPC [Sun, 15 Mar 2020 01:44:13 +0000 (02:44 +0100)]
Rollup merge of #69357 - tmiasko:debuginfo-column, r=michaelwoerister

Emit 1-based column numbers in debuginfo

* Use byte offsets instead of char position offsets. Resolves #67360.
* Use 1-based offsets instead of 0-based ones. Resolves #65437.
* Consistently omit column information for msvc targets, matching clang behaviour (previously columns have been omitted from `DILocation`, but not from `DILexicalBlock`).

4 years agodef_collector: Fully visit async functions
Vadim Petrochenkov [Sat, 14 Mar 2020 19:22:29 +0000 (22:22 +0300)]
def_collector: Fully visit async functions

4 years agoReturn feature gate as a `Symbol`
Dylan MacKenzie [Sat, 14 Mar 2020 22:59:10 +0000 (15:59 -0700)]
Return feature gate as a `Symbol`

4 years agoUpdate ui tests
Guillaume Gomez [Sat, 14 Mar 2020 22:51:45 +0000 (23:51 +0100)]
Update ui tests

4 years agoClean up E0412 and E0422 explanations
Guillaume Gomez [Wed, 11 Mar 2020 12:06:54 +0000 (13:06 +0100)]
Clean up E0412 and E0422 explanations

4 years agoAdd some comments to the new queries
John Kåre Alsaker [Wed, 11 Mar 2020 14:20:24 +0000 (15:20 +0100)]
Add some comments to the new queries

4 years agoAdd test for #69596
John Kåre Alsaker [Tue, 10 Mar 2020 07:26:13 +0000 (08:26 +0100)]
Add test for #69596

4 years agoDon't try to print missing HIR ids
John Kåre Alsaker [Thu, 20 Feb 2020 18:24:44 +0000 (19:24 +0100)]
Don't try to print missing HIR ids

4 years agoUpdate tests
John Kåre Alsaker [Thu, 13 Feb 2020 10:17:49 +0000 (11:17 +0100)]
Update tests

4 years agoUpdate ich_nested_items.rs
John Kåre Alsaker [Wed, 12 Feb 2020 17:50:30 +0000 (18:50 +0100)]
Update ich_nested_items.rs

4 years agoReintroduce workaround for #62649
John Kåre Alsaker [Wed, 12 Feb 2020 17:11:32 +0000 (18:11 +0100)]
Reintroduce workaround for #62649

4 years agoFormat function_interfaces.rs
John Kåre Alsaker [Wed, 12 Feb 2020 15:01:24 +0000 (16:01 +0100)]
Format function_interfaces.rs

4 years agoReplace `Hir` with `hir_owner` in tests
John Kåre Alsaker [Wed, 12 Feb 2020 15:00:15 +0000 (16:00 +0100)]
Replace `Hir` with `hir_owner` in tests

4 years agoReplace `HirBody` with `hir_owner_items` in tests
John Kåre Alsaker [Wed, 12 Feb 2020 14:34:10 +0000 (15:34 +0100)]
Replace `HirBody` with `hir_owner_items` in tests

4 years agoCreate the `hir_to_node_id` map before `TyCtxt`
John Kåre Alsaker [Wed, 12 Feb 2020 14:11:33 +0000 (15:11 +0100)]
Create the `hir_to_node_id` map before `TyCtxt`

4 years agoOptimize the HIR map
John Kåre Alsaker [Mon, 10 Feb 2020 16:00:49 +0000 (17:00 +0100)]
Optimize the HIR map

4 years agoDon't hash HIR with bodies thrice
John Kåre Alsaker [Mon, 10 Feb 2020 13:29:21 +0000 (14:29 +0100)]
Don't hash HIR with bodies thrice

4 years agoFix HIR map validation
John Kåre Alsaker [Sun, 9 Feb 2020 16:11:02 +0000 (17:11 +0100)]
Fix HIR map validation

4 years agoIndex HIR after creating TyCtxt
John Kåre Alsaker [Sun, 9 Feb 2020 14:32:00 +0000 (15:32 +0100)]
Index HIR after creating TyCtxt

4 years agoOnly hash the Hir owner (including its bodies)
John Kåre Alsaker [Sun, 9 Feb 2020 11:13:08 +0000 (12:13 +0100)]
Only hash the Hir owner (including its bodies)

4 years agoRemove `input_task`
John Kåre Alsaker [Sun, 9 Feb 2020 09:31:13 +0000 (10:31 +0100)]
Remove `input_task`

4 years agoRemove `Hir` and `HirBody` dep nodes
John Kåre Alsaker [Sat, 8 Feb 2020 04:30:45 +0000 (05:30 +0100)]
Remove `Hir` and `HirBody` dep nodes

4 years agoClean up the collector
John Kåre Alsaker [Sat, 8 Feb 2020 04:18:34 +0000 (05:18 +0100)]
Clean up the collector

4 years agoRemove `AllLocalTraitImpls`
John Kåre Alsaker [Sat, 8 Feb 2020 03:26:12 +0000 (04:26 +0100)]
Remove `AllLocalTraitImpls`

4 years agoRemove the `map` field from `Map`
John Kåre Alsaker [Sat, 8 Feb 2020 03:24:42 +0000 (04:24 +0100)]
Remove the `map` field from `Map`

4 years agoUpdate `trait_impls`
John Kåre Alsaker [Sat, 8 Feb 2020 03:14:29 +0000 (04:14 +0100)]
Update `trait_impls`

4 years agoRemove comments
John Kåre Alsaker [Sat, 8 Feb 2020 02:30:57 +0000 (03:30 +0100)]
Remove comments

4 years agoUpdate `find_entry`
John Kåre Alsaker [Fri, 7 Feb 2020 18:17:48 +0000 (19:17 +0100)]
Update `find_entry`

4 years agoUpdate `is_hir_id_module`
John Kåre Alsaker [Fri, 7 Feb 2020 18:09:19 +0000 (19:09 +0100)]
Update `is_hir_id_module`

4 years agoUpdate `find`
John Kåre Alsaker [Fri, 7 Feb 2020 18:01:27 +0000 (19:01 +0100)]
Update `find`

4 years agoUpdate `get_parent_node`
John Kåre Alsaker [Fri, 7 Feb 2020 17:46:21 +0000 (18:46 +0100)]
Update `get_parent_node`

4 years agoUpdate `visit_item_likes_in_module`
John Kåre Alsaker [Fri, 7 Feb 2020 17:25:36 +0000 (18:25 +0100)]
Update `visit_item_likes_in_module`

4 years agoUpdate `krate_attrs` and `get_module`
John Kåre Alsaker [Fri, 7 Feb 2020 15:43:36 +0000 (16:43 +0100)]
Update `krate_attrs` and `get_module`

4 years agoUpdate `body_owner` and `maybe_body_owned_by`
John Kåre Alsaker [Fri, 7 Feb 2020 15:10:50 +0000 (16:10 +0100)]
Update `body_owner` and `maybe_body_owned_by`

4 years agoUpdate `fn_decl_by_hir_id` and `fn_sig_by_hir_id`
John Kåre Alsaker [Fri, 7 Feb 2020 14:34:39 +0000 (15:34 +0100)]
Update `fn_decl_by_hir_id` and `fn_sig_by_hir_id`

4 years agoUpdate item functions
John Kåre Alsaker [Fri, 7 Feb 2020 14:17:05 +0000 (15:17 +0100)]
Update item functions

4 years agoCreate Map after TyCtxt
John Kåre Alsaker [Fri, 7 Feb 2020 12:13:35 +0000 (13:13 +0100)]
Create Map after TyCtxt

4 years agoCollect the new maps
John Kåre Alsaker [Fri, 7 Feb 2020 10:45:04 +0000 (11:45 +0100)]
Collect the new maps

4 years agoAdd HIR queries
John Kåre Alsaker [Fri, 7 Feb 2020 10:14:47 +0000 (11:14 +0100)]
Add HIR queries

4 years agoAuto merge of #69999 - RalfJung:miri-unwind, r=oli-obk
bors [Sat, 14 Mar 2020 19:54:23 +0000 (19:54 +0000)]
Auto merge of #69999 - RalfJung:miri-unwind, r=oli-obk

adjust Miri to needs of changed unwinding strategy

As expected, https://github.com/rust-lang/rust/pull/67502 broke unwinding in Miri. To fix it we have to adjust parts of the engine and the panic runtime, which this PR does. The Miri-side changes are in https://github.com/rust-lang/miri/pull/1227.

Cc @oli-obk @Aaron1011 @Mark-Simulacrum @Amanieu

4 years agoAuto merge of #69076 - cjgillot:split_trait, r=matthewjasper
bors [Sat, 14 Mar 2020 16:43:20 +0000 (16:43 +0000)]
Auto merge of #69076 - cjgillot:split_trait, r=matthewjasper

Split librustc::{traits,infer} to their respective crates

Followup on #67953.

I tried to follow the existing module structures.

cc @eddyb
r? @Zoxc

4 years agoAuto merge of #69923 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Sat, 14 Mar 2020 13:28:50 +0000 (13:28 +0000)]
Auto merge of #69923 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from 329923ed to fdce47ba

Changes:
````
add CR feedback
Improve documentation
Use `edition:2018` flag more widely
Update tests/ui/needless_doc_main.rs
Move links to the end of each chapter on adding_lints
Move links to the end of each chapter on CONTRIBUTING
Clean-up adding_lints.md
Clean-up CONTRIBUTING.md
needless_doc_main: only check rust code
Use `node_type_opt` over `node_type`
Fix doc
Fix ICE with trivial_bounds feature
clippy_lints: readme: don't mention crates.io since it is no longer used to publish clippy.
update rust-lang.github.io to rustc-dev-guide.rust-lang.org
Improve placeholder in map_unit_fn
Fix match single binding when in a let stmt
Improve error messages for {option,result}_map_unit_fn
Mention the setup instructions in CONTRIBUTING
redundant_pattern: take binding (ref, ref mut) into account in suggestion.
check_pat: delay creation of the "normal" vec until we reach the branch where is is actually needed
deps: bump itertools 0.8 -> 0.9
add lint on File::read_to_string and File::read_to_end
transition rustc-guide to rustc-dev-guide
Rename macro_use_import -> macro_use_imports
warn on macro_use attr
Fix deploy script for tag deploys
````

Fixes rust-lang#69957

4 years agoTrim dependencies and features.
Camille GILLOT [Tue, 11 Feb 2020 21:39:02 +0000 (22:39 +0100)]
Trim dependencies and features.

4 years agoMake downstream crates compile.
Camille GILLOT [Tue, 11 Feb 2020 20:19:40 +0000 (21:19 +0100)]
Make downstream crates compile.

4 years agoSplit librustc_infer.
Camille GILLOT [Sat, 22 Feb 2020 10:44:18 +0000 (11:44 +0100)]
Split librustc_infer.

4 years agoMove rustc_infer::traits to new crate rustc_trait_selection.
Camille GILLOT [Tue, 11 Feb 2020 18:53:40 +0000 (19:53 +0100)]
Move rustc_infer::traits to new crate rustc_trait_selection.

4 years agoMode ProjectionCache to its own module.
Camille GILLOT [Tue, 11 Feb 2020 18:46:31 +0000 (19:46 +0100)]
Mode ProjectionCache to its own module.

4 years agoMove traits::query::outlives_bounds::explicit_outlives_bounds to infer::outlives.
Camille GILLOT [Mon, 10 Feb 2020 19:39:11 +0000 (20:39 +0100)]
Move traits::query::outlives_bounds::explicit_outlives_bounds to infer::outlives.

4 years agoMove opaque_types::unexpected_hidden_region_diagnostic to error_reporting.
Camille GILLOT [Mon, 10 Feb 2020 19:26:24 +0000 (20:26 +0100)]
Move opaque_types::unexpected_hidden_region_diagnostic to error_reporting.

4 years agoMove IntercrateAmbiguityCause back to rustc::traits::select.
Camille GILLOT [Mon, 10 Feb 2020 19:50:16 +0000 (20:50 +0100)]
Move IntercrateAmbiguityCause back to rustc::traits::select.

4 years agofix comment, rustfmt
Ralf Jung [Sat, 14 Mar 2020 11:10:00 +0000 (12:10 +0100)]
fix comment, rustfmt

4 years agoadjust Miri to needs of changed unwinding strategy
Ralf Jung [Sat, 14 Mar 2020 10:51:27 +0000 (11:51 +0100)]
adjust Miri to needs of changed unwinding strategy

4 years agoupdate panicking comments in libstd
Ralf Jung [Sat, 14 Mar 2020 10:36:40 +0000 (11:36 +0100)]
update panicking comments in libstd

4 years agoadjust Miri interaction with panic runtime
Ralf Jung [Sat, 14 Mar 2020 10:23:39 +0000 (11:23 +0100)]
adjust Miri interaction with panic runtime

4 years agoadd Scalar::from methods for signed integers
Ralf Jung [Sat, 14 Mar 2020 10:12:32 +0000 (11:12 +0100)]
add Scalar::from methods for signed integers

4 years agoAuto merge of #69744 - ecstatic-morse:fix-enum-discr-effect-test, r=oli-obk
bors [Sat, 14 Mar 2020 08:26:54 +0000 (08:26 +0000)]
Auto merge of #69744 - ecstatic-morse:fix-enum-discr-effect-test, r=oli-obk

Add `mir-opt` test for more precise drop elaboration

Depends on #69676. This test should ensure that the problem fixed in that PR does not reoccur.

This has been split out from #69676 since the test fails on certain targets where no cleanup blocks are emitted. I have to find the correct `ignore` directives.

r? @oli-obk

4 years agoAdd long error explanation for E0693 #61137
Ayush Kumar Mishra [Sat, 14 Mar 2020 03:11:05 +0000 (08:41 +0530)]
Add long error explanation for E0693 #61137

4 years agoAuto merge of #69716 - jonas-schievink:generator-size, r=tmandry
bors [Sat, 14 Mar 2020 02:04:49 +0000 (02:04 +0000)]
Auto merge of #69716 - jonas-schievink:generator-size, r=tmandry

Don't store locals in generators that are immediately overwritten with the resume argument

This fixes https://github.com/rust-lang/rust/issues/69672 and makes https://github.com/rust-lang/rust/pull/69033 pass the async fn size tests again (in other words, there will be no size regression of async fn if both this and https://github.com/rust-lang/rust/pull/69033 land).

~~This is a small botch and I'd rather have a more precise analysis, but that seems much harder to pull off, so this special-cases `Yield` terminators that store the resume argument into a simple local (ie. without any field projections) and explicitly marks that local as "not live" in the suspend point of that yield. We know that this local does not need to be stored in the generator for this suspend point because the next resume would immediately overwrite it with the passed-in resume argument anyways. The local might still end up in the state if it is used across another yield.~~ (this now properly updates the dataflow framework to handle this case)

4 years agofix E0117 message out of sync
YI [Sat, 14 Mar 2020 01:23:59 +0000 (09:23 +0800)]
fix E0117 message out of sync

4 years agoAllow `rustdoc-js` and `rustdoc-js-std` to use none default build dir location
Oliver Middleton [Fri, 13 Mar 2020 23:24:12 +0000 (23:24 +0000)]
Allow `rustdoc-js` and `rustdoc-js-std` to use none default build dir location

4 years agoAuto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrum
bors [Fri, 13 Mar 2020 22:43:06 +0000 (22:43 +0000)]
Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrum

Optimize catch_unwind to match C++ try/catch

This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown.

https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great.

This PR, on the other hand, generates the following assembly:

```asm
# -Cpanic=unwind:
push   rbx
mov    ebx,0x2a
call   QWORD PTR [rip+0x1c53c]        # <happy>
mov    eax,ebx
pop    rbx
ret
mov    rdi,rax
call   QWORD PTR [rip+0x1c537]        # cleanup function call
call   QWORD PTR [rip+0x1c539]        # <unfortunate>
mov    ebx,0xd
mov    eax,ebx
pop    rbx
ret

# -Cpanic=abort:
push   rax
call   QWORD PTR [rip+0x20a1]        # <happy>
mov    eax,0x2a
pop    rcx
ret
```

Fixes #64224, and resolves #64222.

4 years agorustc_metadata: Remove `rmeta::MacroDef`
Vadim Petrochenkov [Fri, 13 Mar 2020 21:00:35 +0000 (00:00 +0300)]
rustc_metadata: Remove `rmeta::MacroDef`

Use `ast::MacroDef` instead.

Also remove `Session::imported_macro_spans`, external macros have spans now.

4 years agoAuto merge of #69986 - JohnTitor:rollup-h0809mf, r=JohnTitor
bors [Fri, 13 Mar 2020 19:16:03 +0000 (19:16 +0000)]
Auto merge of #69986 - JohnTitor:rollup-h0809mf, r=JohnTitor

Rollup of 12 pull requests

Successful merges:

 - #69403 (Implement `Copy` for `IoSlice`)
 - #69460 (Move some `build-pass` tests to `check-pass`)
 - #69723 (Added doc on keyword Pub.)
 - #69802 (fix more clippy findings)
 - #69809 (remove lifetimes that can be elided (clippy::needless_lifetimes))
 - #69947 (Clean up E0423 explanation)
 - #69949 (triagebot.toml: add ping aliases)
 - #69954 (rename panic_if_ intrinsics to assert_)
 - #69960 (miri engine: fix treatment of abort intrinsic)
 - #69966 (Add more regression tests)
 - #69973 (Update stable-since version for const_int_conversion)
 - #69974 (Clean up E0434 explanation)

Failed merges:

r? @ghost

4 years agoAdd self to .mailmap
KRAAI, MATTHEW [VISUS] [Fri, 13 Mar 2020 19:01:41 +0000 (12:01 -0700)]
Add self to .mailmap

4 years agoRollup merge of #69974 - GuillaumeGomez:cleanup-e0434, r=Dylan-DPC
Yuki Okushi [Fri, 13 Mar 2020 19:03:37 +0000 (04:03 +0900)]
Rollup merge of #69974 - GuillaumeGomez:cleanup-e0434, r=Dylan-DPC

Clean up E0434 explanation

r? @Dylan-DPC

4 years agoRollup merge of #69973 - tspiteri:const-int-conversion-since, r=dtolnay
Yuki Okushi [Fri, 13 Mar 2020 19:03:36 +0000 (04:03 +0900)]
Rollup merge of #69973 - tspiteri:const-int-conversion-since, r=dtolnay

Update stable-since version for const_int_conversion

Since #69373 was not merged in time for 1.43.0 beta, update to `since = "1.44.0"`.

4 years agoRollup merge of #69966 - JohnTitor:more-more-tests, r=Centril
Yuki Okushi [Fri, 13 Mar 2020 19:03:34 +0000 (04:03 +0900)]
Rollup merge of #69966 - JohnTitor:more-more-tests, r=Centril

Add more regression tests

Closes #58490, closes #60390, closes #62504, closes #67739, closes #69092

r? @Centril

4 years agoRollup merge of #69960 - RalfJung:abort, r=oli-obk
Yuki Okushi [Fri, 13 Mar 2020 19:03:33 +0000 (04:03 +0900)]
Rollup merge of #69960 - RalfJung:abort, r=oli-obk

miri engine: fix treatment of abort intrinsic

I screwed up in https://github.com/rust-lang/rust/pull/69830 and added `abort` to the wrong block of intrinsics, namely the one that actually has a return place. So that branch was never actually reached.

r? @oli-obk

4 years agoRollup merge of #69954 - RalfJung:panic_if-assert, r=Centril,eddyb
Yuki Okushi [Fri, 13 Mar 2020 19:03:31 +0000 (04:03 +0900)]
Rollup merge of #69954 - RalfJung:panic_if-assert, r=Centril,eddyb

rename panic_if_ intrinsics to assert_

[Suggested by @eddyb](https://github.com/rust-lang/miri/issues/1222#issuecomment-598087523)

4 years agoRollup merge of #69949 - rust-lang:triagebot-ping-alias, r=Mark-Simulacrum
Yuki Okushi [Fri, 13 Mar 2020 19:03:29 +0000 (04:03 +0900)]
Rollup merge of #69949 - rust-lang:triagebot-ping-alias, r=Mark-Simulacrum

triagebot.toml: add ping aliases

I think I got the syntax right.
Closes https://github.com/rust-lang/triagebot/issues/402.

r? @Mark-Simulacrum
cc @pnkfelix

4 years agoRollup merge of #69947 - GuillaumeGomez:cleanup-e0423, r=Dylan-DPC
Yuki Okushi [Fri, 13 Mar 2020 19:03:28 +0000 (04:03 +0900)]
Rollup merge of #69947 - GuillaumeGomez:cleanup-e0423, r=Dylan-DPC

Clean up E0423 explanation

r? @Dylan-DPC

4 years agoRollup merge of #69809 - matthiaskrgr:lifetimes, r=eddyb
Yuki Okushi [Fri, 13 Mar 2020 19:03:26 +0000 (04:03 +0900)]
Rollup merge of #69809 - matthiaskrgr:lifetimes, r=eddyb

remove lifetimes that can be elided (clippy::needless_lifetimes)

4 years agoRollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPC
Yuki Okushi [Fri, 13 Mar 2020 19:03:24 +0000 (04:03 +0900)]
Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPC

fix more clippy findings

* reduce references on match patterns (clippy::match_ref_pats)
* Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline)
* libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string)
* remove unneeded mutable references (cippy::unnecessary_mut_passed)
* libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast)
* rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes)
* call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref)
* iterate over a maps values directly. (clippy::for_kv_map)
* rustdoc: simplify boolean condition (clippy::nonminimal_bool)
* Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently)
* rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some)
* rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)