Commit Graph

108253 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
73a625b5fb remove unnecessary hir::map imports 2020-03-16 02:49:19 +01:00
bors
45ebd5808a Auto merge of #68944 - Zoxc:hir-map, r=eddyb
Use queries for the HIR map

r? @eddyb cc @michaelwoerister
2020-03-15 20:40:16 +00:00
bors
e0f5df0173 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
2020-03-15 17:27:47 +00:00
Mazdak Farrokhzad
bde77af094
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.
2020-03-15 15:40:15 +01:00
Mazdak Farrokhzad
b46ef3dd03
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
2020-03-15 15:40:13 +01:00
Mazdak Farrokhzad
d74c5cd07c
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.
2020-03-15 15:40:12 +01:00
Mazdak Farrokhzad
d986a706bd
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
2020-03-15 15:40:10 +01:00
Mazdak Farrokhzad
8bca839fdf
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
2020-03-15 15:40:08 +01:00
Mazdak Farrokhzad
cc1623267b
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 :)
2020-03-15 15:40:07 +01:00
Mazdak Farrokhzad
d1e943f263
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
2020-03-15 15:40:05 +01:00
Mazdak Farrokhzad
83aad6b9a8
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
2020-03-15 15:40:03 +01:00
bors
5da2e53f47 Auto merge of #69961 - RalfJung:miri, r=RalfJung
update miri

r? @ghost
Cc @oli-obk

Fixes https://github.com/rust-lang/rust/issues/69855
2020-03-15 14:18:14 +00:00
bors
5a72ecf2c5 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
2020-03-15 10:52:37 +00:00
Ralf Jung
b8ac984129 update miri 2020-03-15 11:51:09 +01:00
Vadim Petrochenkov
78f01eca3f resolve: Prevent fresh bindings from shadowing ambiguity items
Correctly treat const generic parameters in fresh binding disambiguation
2020-03-15 12:35:48 +03:00
Lukas Kalbertodt
401a3f3762
Fix "since" field for Once::is_complete's #[stable] attribute
It was accidentally merged with the wrong version.
2020-03-15 10:19:26 +01:00
Dylan DPC
838884e022
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
2020-03-15 02:44:23 +01:00
Dylan DPC
191a7965b1
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
2020-03-15 02:44:22 +01:00
Dylan DPC
65f56dad14
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`.
2020-03-15 02:44:20 +01:00
Dylan DPC
bf6e715fa0
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
2020-03-15 02:44:18 +01:00
Dylan DPC
f40272ca6f
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)
2020-03-15 02:44:17 +01:00
Dylan DPC
0619e4649d
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
2020-03-15 02:44:15 +01:00
Dylan DPC
62c0579116
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`).
2020-03-15 02:44:13 +01:00
Vadim Petrochenkov
2093d83afc def_collector: Fully visit async functions 2020-03-15 03:15:47 +03:00
Dylan MacKenzie
d7e6649326 Return feature gate as a Symbol 2020-03-14 16:04:42 -07:00
John Kåre Alsaker
14fdd85a5a Add some comments to the new queries 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
31183c39df Add test for #69596 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
2af085d34f Don't try to print missing HIR ids 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
8b8041efc0 Update tests 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
7118f71ea1 Update ich_nested_items.rs 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
6258c0144d Reintroduce workaround for #62649 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
10b23e3fd3 Format function_interfaces.rs 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
274fb668b4 Replace Hir with hir_owner in tests 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
c0b60c428a Replace HirBody with hir_owner_items in tests 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
739a1ef113 Create the hir_to_node_id map before TyCtxt 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
396aeb83c0 Optimize the HIR map 2020-03-14 22:52:31 +01:00
John Kåre Alsaker
aea57aee5f Don't hash HIR with bodies thrice 2020-03-14 22:52:30 +01:00
John Kåre Alsaker
0e316e29e6 Fix HIR map validation 2020-03-14 22:52:30 +01:00
John Kåre Alsaker
8b16b023b1 Index HIR after creating TyCtxt 2020-03-14 22:52:30 +01:00
John Kåre Alsaker
3538cb38fc Only hash the Hir owner (including its bodies) 2020-03-14 22:52:30 +01:00
John Kåre Alsaker
d73268b05c Remove input_task 2020-03-14 22:52:30 +01:00
John Kåre Alsaker
b97d4383a4 Remove Hir and HirBody dep nodes 2020-03-14 22:52:30 +01:00
John Kåre Alsaker
e9d166fac5 Clean up the collector 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
fa09db8468 Remove AllLocalTraitImpls 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
d99b17fa64 Remove the map field from Map 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
072449c0dc Update trait_impls 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
270ee7eca3 Remove comments 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
61527c8d8c Update find_entry 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
21942a5cf6 Update is_hir_id_module 2020-03-14 22:52:29 +01:00
John Kåre Alsaker
9c4308ed92 Update find 2020-03-14 22:52:29 +01:00