Michael Goulet
3f8919c09b
get rid of a bit more calls to poly_select
2023-07-06 16:50:12 +00:00
Nicholas Nethercote
1191bea6ab
Improve CGU debug printing.
...
- Add more total and per-CGU measurements.
- Ensure CGUs are sorted by name before the first `debug_dump` calls,
for deterministic output.
- Print items within CGUs in sorted-by-name order, for deterministic
output.
- Add some assertions and comments clarifying sortedness of CGUs at
various points.
An example, before:
```
INITIAL PARTITIONING (5 CodegenUnits, max=29, min=1, max/min=29.0):
CodegenUnit scev95ysd7g4b0z estimated size 2:
- fn <() as std::process::Termination>::report [(External, Hidden)] [h082b15a6d07338dcE] estimated size 2
CodegenUnit 1j0frgtl72rsz24q estimated size 29:
- fn std::rt::lang_start::<()>::{closure#0} [(External, Hidden)] [h695c7b5d6a212565E] estimated size 17
- fn std::rt::lang_start::<()> [(External, Hidden)] [h4ca942948e9cb931E] estimated size 12
CodegenUnit 5dbzi1e5qm0d7kj2 estimated size 4:
- fn <[closure@std::rt::lang_start<()>::{closure#0}] as std::ops::FnOnce<()>>::call_once - shim [(External, Hidden)] [h24eaa44f03b2b233E] estimated size 1
- fn <fn() as std::ops::FnOnce<()>>::call_once - shim(fn()) [(External, Hidden)] [hf338f5339c3711acE] estimated size 1
- fn <[closure@std::rt::lang_start<()>::{closure#0}] as std::ops::FnOnce<()>>::call_once - shim(vtable) [(External, Hidden)] [h595d414cbb7651d5E] estimated size 1
- fn std::ptr::drop_in_place::<[closure@std::rt::lang_start<()>::{closure#0}]> - shim(None) [(External, Hidden)] [h17a19dcdb40600daE] estimated size 1
CodegenUnit 220m1mqa2mlbg7r3 estimated size 1:
- fn main [(External, Hidden)] [hb29587cdb6db5f42E] estimated size 1
CodegenUnit 4ulbh241f7tvyn7x estimated size 6:
- fn std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()> [(External, Hidden)] [h41dada2c21a1259dE] estimated size 6
```
and after:
```
INITIAL PARTITIONING (9 items, total_size=42; 5 CGUs, max_size=29, min_size=1, max_size/min_size=29.0):
- CGU[0] 1j0frgtl72rsz24q (2 items, size=29):
- fn std::rt::lang_start::<()> [(External, Hidden)] [h4ca942948e9cb931E] (size=12)
- fn std::rt::lang_start::<()>::{closure#0} [(External, Hidden)] [h695c7b5d6a212565E] (size=17)
- CGU[1] 220m1mqa2mlbg7r3 (1 items, size=1):
- fn main [(External, Hidden)] [hb29587cdb6db5f42E] (size=1)
- CGU[2] 4ulbh241f7tvyn7x (1 items, size=6):
- fn std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()> [(External, Hidden)] [h41dada2c21a1259dE] (size=6)
- CGU[3] 5dbzi1e5qm0d7kj2 (4 items, size=4):
- fn <[closure@std::rt::lang_start<()>::{closure#0}] as std::ops::FnOnce<()>>::call_once - shim(vtable) [(External, Hidden)] [h595d414cbb7651d5E] (size=1)
- fn <[closure@std::rt::lang_start<()>::{closure#0}] as std::ops::FnOnce<()>>::call_once - shim [(External, Hidden)] [h24eaa44f03b2b233E] (size=1)
- fn <fn() as std::ops::FnOnce<()>>::call_once - shim(fn()) [(External, Hidden)] [hf338f5339c3711acE] (size=1)
- fn std::ptr::drop_in_place::<[closure@std::rt::lang_start<()>::{closure#0}]> - shim(None) [(External, Hidden)] [h17a19dcdb40600daE] (size=1)
- CGU[4] scev95ysd7g4b0z (1 items, size=2):
- fn <() as std::process::Termination>::report [(External, Hidden)] [h082b15a6d07338dcE] (size=2)
```
2023-06-01 11:31:22 +10:00
John Kåre Alsaker
54b582a0e8
Finish move of query.rs
2023-05-17 01:57:21 +02:00
John Kåre Alsaker
fff20a703d
Move expansion of query macros in rustc_middle to rustc_middle::query
2023-05-15 08:49:13 +02:00
Maybe Waffle
4f2532fb53
Switch ty::TraitRef::from_lang_item
from using TyCtxtAt
to TyCtxt
and a Span
2023-04-26 10:55:11 +00:00
Maybe Waffle
46b01abbcd
Replace tcx.mk_trait_ref
with ty::TraitRef::new
2023-04-25 16:12:44 +00:00
Nilstrieb
b5d3d970fa
Add rustc_fluent_macro
to decouple fluent from rustc_macros
...
Fluent, with all the icu4x it brings in, takes quite some time to
compile. `fluent_messages!` is only needed in further downstream rustc
crates, but is blocking more upstream crates like `rustc_index`. By
splitting it out, we allow `rustc_macros` to be compiled earlier, which
speeds up `x check compiler` by about 5 seconds (and even more after the
needless dependency on `serde_json` is removed from
`rustc_data_structures`).
2023-04-18 18:56:22 +00:00
est31
7e2ecb3cd8
Simplify message paths
...
This makes it easier to open the messages file while developing on features.
The commit was the result of automatted changes:
for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done
for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-03-11 22:51:57 +01:00
David Wood
d1fcf61117
errors: generate typed identifiers in each crate
...
Instead of loading the Fluent resources for every crate in
`rustc_error_messages`, each crate generates typed identifiers for its
own diagnostics and creates a static which are pulled together in the
`rustc_driver` crate and provided to the diagnostic emitter.
Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:53 +00:00
Scott McMurray
7d57685682
Also remove #![feature(control_flow_enum)]
where possible
2023-01-18 10:22:21 -08:00
Oli Scherer
7658e0fccf
Stop passing the self-type as a separate argument.
2022-11-21 20:39:46 +00:00
Oli Scherer
ad57f88d3f
Add helper to create the trait ref for a lang item
2022-11-21 20:35:17 +00:00
Oli Scherer
ec8d01fdcc
Allow iterators instead of requiring slices that will get turned into iterators
2022-11-21 20:33:55 +00:00
Oli Scherer
6f77c97b38
Assert that various types have the right amount of generic args and fix the sites that used the wrong amount
2022-11-21 20:31:59 +00:00
Pietro Albini
3975d55d98
remove cfg(bootstrap)
2022-09-26 10:14:45 +02:00
est31
173eb6f407
Only enable the let_else feature on bootstrap
...
On later stages, the feature is already stable.
Result of running:
rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-15 21:06:45 +02:00
lcnr
c63020a7c3
rename codegen_fulfill_obligation
2022-09-09 13:36:27 +02:00
Nathan Stocks
137f20c112
rebased: convert rustc_monomorphize errors to SessionDiagnostic
2022-08-25 11:06:32 -06:00
Jacob Pratt
49c82f31a8
Remove crate
visibility usage in compiler
2022-05-20 20:04:54 -04:00
Josh Triplett
0fc5c524f5
Stabilize bool::then_some
2022-05-04 13:22:08 +02:00
Mark Rousskov
22c3a71de1
Switch bootstrap cfgs
2022-02-25 08:00:52 -05:00
lcnr
a1a30f7548
add a rustc::query_stability lint
2022-02-01 10:15:59 +01:00
Peter Jaszkowiak
f0b714258f
Remove in_band_lifetimes
for rustc_monomorphize
2021-12-13 22:00:50 -07:00
Mark Rousskov
3215eeb99f
Revert "Add rustc lint, warning when iterating over hashmaps"
2021-10-28 11:01:42 -04:00
Matthias Krüger
87822b27ee
Rollup merge of #89558 - lcnr:query-stable-lint, r=estebank
...
Add rustc lint, warning when iterating over hashmaps
r? rust-lang/wg-incr-comp
2021-10-24 15:48:42 +02:00
est31
1418df5888
Adopt let_else across the compiler
...
This performs a substitution of code following the pattern:
let <id> = if let <pat> = ... { identity } else { ... : ! };
To simplify it to:
let <pat> = ... { identity } else { ... : ! };
By adopting the let_else feature.
2021-10-16 07:18:05 +02:00
lcnr
00e5abe9b6
allow potential_query_instability
everywhere
2021-10-15 10:58:18 +02:00
Camille GILLOT
924dbc36c9
Rebase fallout.
2021-09-08 20:40:30 +02:00
Camille GILLOT
81a600b6b7
Move monomorphize code to its own crate.
2021-09-07 19:53:04 +02:00