Commit graph

181 commits

Author SHA1 Message Date
Jade
3cf820e17d rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
Santiago Pastorino
5bff8429a0
Use type_alias_impl_trait instead of min in compiler and lib 2021-07-27 12:27:08 -03:00
bors
3b4a0dfc13 Auto merge of #86429 - JohnTitor:get-by-key-enum-part-2, r=oli-obk
Improve `get_by_key_enumerated` more

Follow-up of #86392, this applies the suggestions by `@m-ou-se.`

r? `@m-ou-se`
2021-07-23 23:17:38 +00:00
Santiago Pastorino
d71410757d
Add VecMap::get_value_matching and assert if > 1 element
Otherwise is a bug that we want to uncover.
2021-07-23 08:44:23 -03:00
Yuki Okushi
6761826b1b
Sort features alphabetically 2021-07-23 18:08:26 +09:00
Yuki Okushi
8d00be9980
Use map_while instead of take_while + map 2021-07-23 18:04:28 +09:00
Yuki Okushi
cb3b3cf6ab
Improve get_by_key_enumerated more 2021-07-23 18:04:21 +09:00
bors
b2b7c859c1 Auto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorino
Make mir borrowck's use of opaque types independent of the typeck query's result

fixes #87218
fixes #86465

we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result.

When i removed the `fixup_opaque_types` function in #87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information.

We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead.

r? `@spastorino`
2021-07-23 03:40:26 +00:00
Oli Scherer
6d76002baf Make mir borrowck's use of opaque types independent of the typeck query's result 2021-07-22 11:20:29 +00:00
Oli Scherer
d693a98f4e Fix VecMap::iter_mut
It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.
2021-07-22 11:20:29 +00:00
bors
f913a4fe90 Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiser
Profile incremental compilation hashing fingerprints

Adds profiling instrumentation for the hashing of incremental compilation fingerprints per query.

This will eventually feed into the `measureme` and `rustc-perf` infrastructure for tracking if computing hashes changes over time.

TODOs:
* [x] Address the FIXME where we are including node interning in the hash timing.
* [ ] Update measureme/summarize to handle this new data: https://github.com/rust-lang/measureme/pull/166
* [ ] ~Update rustc-perf to handle the new data from measureme~ (will be done at a later time)

r? `@ghost`

cc `@michaelwoerister`
2021-07-22 10:04:44 +00:00
jackh726
d954a8ee8e Some perf optimizations and logging 2021-07-17 16:09:17 -04:00
Oli Scherer
692f638036 Fix VecMap Extend impl 2021-07-13 15:05:29 +00:00
Ryan Levick
b5bec17184 Add docs to new methods 2021-07-07 11:14:14 +02:00
Ryan Levick
6e33dce9c2 Profile incremental hashing 2021-07-07 10:43:30 +02:00
Josh Triplett
6e75aae355 rustc_data_structures: Drop unused dependency on crossbeam-utils
rustc_data_structures has a dependency on crossbeam-utils but never uses
it. It appears to have originally had this dependency in order to set
the "nightly" feature; however, its other dependencies use a different
version of crossbeam-utils, so this doesn't actually affect anything.
Furthermore, in current crossbeam-utils, the "nightly" feature has
become a no-op.
2021-06-25 01:03:16 -07:00
Yuki Okushi
d2852354dc
Rollup merge of #86387 - JohnTitor:now-no-unused-lifetimes, r=Mark-Simulacrum
Remove `#[allow(unused_lifetimes)]` which is now unnecessary

Seems FP has been fixed, it doesn't need `#[allow(unused_lifetimes)]` anymore.
2021-06-22 07:37:53 +09:00
Yuki Okushi
c0efd2a15b
Prefer partition_point to look up assoc items 2021-06-17 11:40:37 +09:00
Yuki Okushi
636170a1e2
Remove #[allow(unused_lifetimes)] which is now unnecessary 2021-06-17 08:56:54 +09:00
bors
0a8629bff6 Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillot
Don't use a generator for BoxedResolver

The generator is non-trivial and requires unsafe code anyway. Using regular unsafe code without a generator is much easier to follow.

Based on #85810 as it touches rustc_interface too.
2021-06-11 16:11:20 +00:00
Santiago Pastorino
7b1e1c7333
add VecMap docs 2021-06-08 17:17:48 -03:00
Santiago Pastorino
cad762b1e2
Use impl FnMut directly as predicate type 2021-06-08 17:17:48 -03:00
Santiago Pastorino
ed94da14ed
Explicitly pass find arguments down the predicate so coercions can apply 2021-06-08 17:17:47 -03:00
bjorn3
99e112d282 Inline the rest of box_region 2021-06-08 19:24:16 +02:00
bjorn3
86b3ebe2da Inline box_region macro calls 2021-06-08 19:24:15 +02:00
bjorn3
8f397bc8a0 Simplify box_region macros 2021-06-08 19:24:15 +02:00
Santiago Pastorino
dd56ec653c
Add VecMap::get_by(FnMut -> bool) 2021-06-08 09:40:58 -03:00
Santiago Pastorino
aa7024b0c7
Add VecMap to rustc_data_structures 2021-06-07 19:03:51 -03:00
Yuki Okushi
b3bcf4af74
Rollup merge of #85436 - tamird:save-clone, r=estebank
Avoid cloning cache key

r? `@estebank`
2021-06-06 19:11:16 +09:00
Joshua Nelson
3412957e7f Unify parallel and non-parallel APIs
It's confusing for these to be different, even if some of the methods
are unused.
2021-06-04 15:26:08 -04:00
Joshua Nelson
1a5cc25525 Remove unused code from rustc_data_structures::sync
Found using https://github.com/est31/warnalyzer.
2021-06-04 15:25:05 -04:00
Yuki Okushi
36f1ed6de2
Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514
Remove unused feature gates

The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`)

The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though.

The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2021-06-04 13:42:54 +09:00
bors
1e13a9bb33 Auto merge of #85892 - tmiasko:i, r=oli-obk
Miscellaneous inlining improvements
2021-06-02 10:47:58 +00:00
Tomasz Miąsko
c1f6495b8e Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
Camille GILLOT
273778086c Remove StableVec. 2021-06-01 20:53:04 +02:00
Camille Gillot
0f0f3138cb
Revert "Reduce the amount of untracked state in TyCtxt" 2021-06-01 09:05:22 +02:00
bjorn3
312f964478 Remove unused feature gates 2021-05-31 13:55:43 +02:00
bjorn3
b4ed7114bd Remove unnecessary unboxed_closures feature usage
It has been possible to clone closures for a while now
2021-05-31 12:13:47 +02:00
Camille GILLOT
ee567fe1b1 Remove StableVec. 2021-05-30 19:54:21 +02:00
Eric Huss
074d667cf5 Don't panic when failing to initialize incremental directory. 2021-05-25 14:40:33 -07:00
Tamir Duberstein
42b9d3fb72
Simplify map | unwrap_or to map_or 2021-05-18 10:37:42 -04:00
Tamir Duberstein
a36c636199
Avoid cloning cache key 2021-05-18 07:48:00 -04:00
Esteban Küber
4bd5505718 Only compute Obligation cache_key once in register_obligation_at 2021-05-04 11:57:53 -07:00
bors
ada102456d Auto merge of #84614 - RalfJung:daily, r=Mark-Simulacrum
don't enable parking_lot nightly features

Having the compiler itself depend on external libraries that use nightly features can lead to "fun" bootstrap situations. Within the rustc repo we use `cfg(bootstrap)` to resolve those, but that is not a reasonable option for external dependencies.

So I propose we stop enabling the "nightly" feature of `parking_lot` here. In my experiments, this then indeed leads to the feature not being enabled (i.e., nothing else enables it), and everything still builds. However, this means parking_lot's `RwLock` will no longer have hardware lock elision for readers -- I hope that is okay to lose in exchange for less bootstrap brain twisting. ;)

Cc `@Amanieu`
2021-04-29 02:53:52 +00:00
Ralf Jung
170a10b2dd don't enable parking_lot nightly features 2021-04-27 15:05:55 +02:00
Jubilee Young
1f5e1c5efa Use latest crossbeam 2021-04-23 16:27:08 -07:00
Jubilee Young
b2c1dbbd33 Use tempfile 2021-04-23 15:33:57 -07:00
Jubilee Young
e8eb691c1f Use arrayvec 0.7, drop smallvec 0.6
With the arrival of min const generics, many alt-vec libraries have
updated to use it in some way and arrayvec is no exception. Use the
latest with minor refactoring.

Also, rustc_workspace_hack is the only user of smallvec 0.6 in the
entire tree, so drop it.
2021-04-21 22:39:08 -07:00
pierwill
0019ca9141 Fix outdated crate names in compiler docs
Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.

Also fix incorrect file paths.
2021-04-08 11:12:14 -05:00
bors
e1d49aaad4 Auto merge of #83821 - camelid:improve-thinvec, r=petrochenkov
Add `FromIterator` and `IntoIterator` impls for `ThinVec`

These should make using `ThinVec` feel much more like using `Vec`.
They will allow users of `Vec` to switch to `ThinVec` while continuing
to use `collect()`, `for` loops, and other parts of the iterator API.

I don't know if there were use cases before for using the iterator API
with `ThinVec`, but I would like to start using `ThinVec` in rustdoc,
and having it conform to the iterator API would make the transition
*a lot* easier.

I added a `FromIterator` impl, an `IntoIterator` impl that yields owned
elements, and `IntoIterator` impls that yield immutable or mutable
references to elements. I also added some unit tests for `ThinVec`.
2021-04-06 09:57:12 +00:00