Commit Graph

452 Commits

Author SHA1 Message Date
bors
56ee85274e Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
Remove some `ref` patterns from the compiler

Previous PR: https://github.com/rust-lang/rust/pull/105368

r? `@Nilstrieb`
2023-01-20 04:52:28 +00:00
Guillaume Gomez
dee88e0fa2
Rollup merge of #107037 - tmiasko:rank, r=oli-obk
Fix Dominators::rank_partial_cmp to match documentation

The only use site is also updated accordingly and there is no change in end-to-end behaviour.
2023-01-19 11:19:36 +01:00
Scott McMurray
7d57685682 Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
Tomasz Miąsko
b8c5821ad8 Fix Dominators::rank_partial_cmp to match documentation
The only use site is also updated accordingly and there is no change in
end-to-end behaviour.
2023-01-18 17:11:43 +01:00
Scott McMurray
925dc37313 Stop using BREAK & CONTINUE in compiler
Switching them to `Break(())` and `Continue(())` instead.

libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17 23:17:51 -08:00
Matthias Krüger
68f12338af
Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726
Remove double spaces after dots in comments

Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17 20:21:25 +01:00
Maybe Waffle
6a28fb42a8 Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
Maybe Waffle
fc6cda8603 rustc_data_structures: remove ref patterns and other artifacts of the past 2023-01-17 07:48:19 +00:00
Jakob Degen
f49126e3d6 Document wf constraints on control flow in cleanup blocks
Also fixes a bug in dominator computation
2023-01-16 14:51:33 -08:00
Oli Scherer
58782a8842 Harden the pre-tyctxt query system against accidental recomputation 2023-01-12 09:26:28 +00:00
nils
fd7a159710 Fix uninlined_format_args for some compiler crates
Convert all the crates that have had their diagnostic migration
completed (except save_analysis because that will be deleted soon and
apfloat because of the licensing problem).
2023-01-05 19:01:12 +01:00
Nilstrieb
e1787f5572 Reduce HIR debug output
HIR debug output is currently very verbose, especially when used with
the alternate (`#`) flag. This commit reduces the amount of noisy
newlines by forcing a few small key types to stay on one line, which
makes the output easier to read and scroll by.

```
$ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l
582
$ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l
932
```
2023-01-02 20:15:48 +01:00
KaDiWa
7b371d2ad9
fix some typos 2022-12-25 00:43:50 +01:00
Matthias Krüger
d23cb738d2
Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholk
rustc: Remove needless lifetimes
2022-12-24 00:31:41 +01:00
Jeremy Stucki
3dde32ca97
rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
Chris Denton
b859b8b62b
Bump cfg-if to 1.0 2022-12-20 13:03:45 +00:00
Nilstrieb
8bfd6450c7 A few small cleanups for newtype_index
Remove the `..` from the body, only a few invocations used it and it's
inconsistent with rust syntax.

Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18 21:47:28 +01:00
Matthias Krüger
de59844c98 more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
Matthias Krüger
2ea368e53c minor code cleanups 2022-12-12 19:49:53 +01:00
KaDiWa
9bc69925cb
compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
Matthias Krüger
db416ea195
Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser
Put all cached values into a central struct instead of just the stable hash

cc `@nnethercote`

this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields
2022-12-06 16:54:52 +01:00
bors
9db224fc90 Auto merge of #105175 - michaelwoerister:add-stable-ord-trait, r=nagisa
Add StableOrd trait as proposed in MCP 533.

The `StableOrd` trait can be used to mark types as having a stable sort order across compilation sessions. Collections that sort their items in a stable way can safely implement HashStable by hashing items in sort order.

See https://github.com/rust-lang/compiler-team/issues/533 for more information.
2022-12-06 09:21:49 +00:00
Michael Woerister
56aacb245c StableOrd: Address review comments. 2022-12-05 10:45:31 +01:00
bors
b8a52e3a4b Auto merge of #105218 - matthiaskrgr:rollup-8d3k08n, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #104199 (Keep track of the start of the argument block of a closure)
 - #105050 (Remove useless borrows and derefs)
 - #105153 (Create a hacky fail-fast mode that stops tests at the first failure)
 - #105164 (Restore `use` suggestion for `dyn` method call requiring `Sized`)
 - #105193 (Disable coverage instrumentation for naked functions)
 - #105200 (Remove useless filter in unused extern crate check.)
 - #105201 (Do not call fn_sig on non-functions.)
 - #105208 (Add AmbiguityError for inconsistent resolution for an import)
 - #105214 (update Miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-03 21:25:45 +00:00
Matthias Krüger
1a2f79b82c
Rollup merge of #105050 - WaffleLapkin:uselessrefign, r=jyn514
Remove useless borrows and derefs

They are nothing more than noise.
<sub>These are not all of them, but my clippy started crashing (stack overflow), so rip :(</sub>
2022-12-03 17:37:42 +01:00
bors
cab4fd678c Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiser
Rewrite LLVM's archive writer in Rust

This allows it to be used by other codegen backends.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1155
2022-12-03 15:07:39 +00:00
Michael Woerister
3a58309798 Add StableOrd trait as proposed in MCP 533.
The StableOrd trait can be used to mark types as having a stable
sort order across compilation sessions. Collections that sort their
items in a stable way can safely implement HashStable by
hashing items in sort order.
2022-12-02 15:19:30 +01:00
Maybe Waffle
083ef45458 rustc_data_structures deref in a more humane way 2022-12-01 17:34:45 +00:00
Maybe Waffle
f2b97a8bfe Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
Vadim Petrochenkov
1f259ae679 rustc_hir: Change representation of import paths to support multiple resolutions 2022-12-01 18:51:05 +03:00
Oli Scherer
87a04f51ba move WithCachedTypeInfo to rustc_type_ir 2022-11-30 12:17:13 +00:00
Oli Scherer
3d31e5c981 s/WithStableHash/WithCachedTypeInfo/ 2022-11-30 12:11:19 +00:00
Neutron3529
11525e506e
fix document
https://users.rust-lang.org/t/is-the-document-in-sortedmap-in-rustc-data-structures-sorted-map-correct/84939

SortedMap have `O(n)` insertions and removal rather than `O(log(n))`
2022-11-28 18:31:55 +08:00
bjorn3
be6708428f Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
2022-11-26 19:35:32 +00:00
bors
becc24a23a Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser
Use liballoc's specialised in-place vec collection

liballoc already specialises in-place vector collection, so manually
reimplementing it in `IdFunctor::try_map_id` was superfluous.
2022-11-19 02:28:47 +00:00
Camille GILLOT
9d86e6abaf Use the interned stable hash as plain hash. 2022-11-11 13:02:37 +00:00
Camille GILLOT
d47424b833 Hash spans when interning. 2022-11-11 13:02:37 +00:00
Mateusz Mikuła
d5899efbda Update several crates for improved support of the new targets
This helps with `*-windows-gnullvm` targets
2022-11-05 12:19:55 +01:00
Matthias Krüger
d976a29c30
Rollup merge of #103845 - camsteffen:data-structures-track-caller, r=compiler-errors
Add track_caller to some Lock methods

Would have helped to diagnose #103844.
2022-11-04 12:18:01 +01:00
Michael Howell
03968a802c rustdoc: use ThinVec for cleaned generics 2022-11-02 16:17:22 -07:00
Cameron Steffen
10a5e75537 Add track_caller to some Lock methods 2022-11-01 12:28:14 -05:00
Michael Woerister
9117ea9758 Introduce UnordMap, UnordSet, and UnordBag (see MCP 533)
MCP 533: https://github.com/rust-lang/compiler-team/issues/533

Also, as an example, substitute UnordMap for FxHashMap in
used_trait_imports query result.
2022-10-27 13:23:26 +00:00
Rageking8
62a2a1d257 fix some typos 2022-10-21 18:04:00 +08:00
bors
4b8f431995 Auto merge of #103214 - Nilstrieb:set-theory, r=petrochenkov
Use Set instead of Vec in transitive_relation

Helps with #103195. It doesn't fix the underlying quadraticness but it makes it _a lot_ faster to an extent where even doubling the amount of nested references still takes less than two seconds (50s on nightly).

I want to see whether this causes regressions (because the vec was usually quite small) or improvements (as lookup for bigger sets is now much faster) in real code.
2022-10-19 13:53:06 +00:00
nils
d45f025c90
Use Set instead of Vec in transitive_relation 2022-10-19 12:50:28 +02:00
bors
98a5ac269c Auto merge of #102543 - daym:patch-1, r=joshtriplett
Remove "execute" bit from lock file permissions

Previously, flock would set the "execute" bit on Rust lock files. That makes no sense.

This patch clears the "execute" bit on Rust lock files.

See issue #102531.
2022-10-18 02:04:24 +00:00
Danny Milosavljevic
e07e5104fe Remove execute bit from lock file permissions 2022-10-17 21:10:46 +02:00
Rageking8
7122abaddf more dupe word typos 2022-10-14 12:57:56 +08:00
Matthias Krüger
42df0a580f
Rollup merge of #102725 - nnethercote:rm-Z-time, r=davidtwco
Remove `-Ztime`

Because it has a lot of overlap with `-Ztime-passes` but is generally less useful. Plus some related cleanups.

Best reviewed one commit at a time.

r? `@davidtwco`
2022-10-06 16:29:45 +02:00
Nicholas Nethercote
4e8faff3a1 Be consistent about deciding whether to print pass data.
`print_time_passes_entry` unconditionally prints data about a pass. The
most commonly used call site, in `VerboseTimingGuard::drop`, guards it
with a `should_print_passes` test. But there are a couple of other call
sites that don't do that test.

This commit moves the `should_print_passes` test within
`print_time_passes_entry` so that all passes are treated equally.
2022-10-06 15:50:10 +11:00