Michael Goulet
be2540a1f0
Fix some pub(crate) that were undetected bc of instrument
2024-10-04 14:02:09 -04:00
Michael Goulet
c682aa162b
Reformat using the new identifier sorting from rustfmt
2024-09-22 19:11:29 -04:00
Nicholas Nethercote
606b9cb406
Rename some lifetimes.
...
Giving them more typical names.
2024-09-13 15:36:55 +10:00
Ralf Jung
35709be02d
rename AddressOf -> RawBorrow inside the compiler
2024-08-18 19:46:53 +02:00
Nicholas Nethercote
84ac80f192
Reformat use
declarations.
...
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Scott McMurray
b28efb11af
Save 2 pointers in TerminatorKind
(96 → 80 bytes)
...
These things don't need to be `Vec`s; boxed slices are enough.
The frequent one here is call arguments, but MIR building knows the number of arguments from the THIR, so the collect is always getting the allocation right in the first place, and thus this shouldn't ever add the shrink-in-place overhead.
2024-06-21 18:02:05 -07:00
Michael Goulet
93ff86ed7c
Use is_lang_item more aggressively
2024-06-14 16:54:29 -04:00
Nicholas Nethercote
9287aede31
Remove #[macro_use] extern crate tracing
from rustc_mir_dataflow
.
2024-05-23 18:02:40 +10:00
Waffle Lapkin
698d7a031e
Inline & delete Ty::new_unit
, since it's just a field access
2024-05-02 17:49:23 +02:00
Nicholas Nethercote
99e036bd21
Remove extern crate rustc_middle
from numerous crates.
2024-04-29 14:50:45 +10:00
Vadim Petrochenkov
b40ea03f8a
rustc_index: Add a ZERO
constant to index types
...
It is commonly used.
2024-04-03 19:06:22 +03:00
Michael Goulet
81e7e80990
Eagerly convert some ctors to use their specialized ctors
2024-03-22 11:12:01 -04:00
Michael Goulet
c567eddec2
Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs
2024-02-06 02:22:58 +00:00
Martin Nordholts
16ba56c242
compiler: Lower fn call arg spans down to MIR
...
To enable improved accuracy of diagnostics in upcoming commits.
2024-01-15 19:07:11 +01:00
Michael Goulet
fcb42b42d6
Remove movability from TyKind::Coroutine
2023-12-28 16:35:01 +00:00
Nilstrieb
21a870515b
Fix clippy::needless_borrow
in the compiler
...
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.
Then I had to remove a few unnecessary parens and muts that were exposed
now.
2023-11-21 20:13:40 +01:00
Oli Scherer
e96ce20b34
s/generator/coroutine/
2023-10-20 21:14:01 +00:00
Oli Scherer
60956837cf
s/Generator/Coroutine/
2023-10-20 21:10:38 +00:00
Oli Scherer
ec6f554536
Some tracing cleanups
2023-09-28 16:13:37 +00:00
Ralf Jung
c94410c145
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const
2023-09-21 08:12:30 +02:00
Ralf Jung
4c53783f3c
when terminating during unwinding, show the reason why
2023-08-24 13:28:26 +02:00
Michael Goulet
99969d282b
Use upvar_tys in more places, make it a list
2023-08-01 23:19:31 +00:00
Mahdi Dibaiee
e55583c4b8
refactor(rustc_middle): Substs -> GenericArg
2023-07-14 13:27:35 +01:00
Boxy
12138b8e5e
Move TyCtxt::mk_x
to Ty::new_x
where applicable
2023-07-05 20:27:07 +01:00
Ziru Niu
8fb4c41f35
merge BorrowKind::Unique
into BorrowKind::Mut
2023-06-20 20:55:31 +08:00
Deadbeef
89c24af133
Better error for non const PartialEq
call generated by match
2023-06-18 05:24:38 +00:00
DrMeepster
a5c6cb888e
remove box_free and replace with drop impl
2023-06-16 13:41:06 -07:00
Camille GILLOT
844c1cc5fe
Remove DesugaringKind::Replace.
2023-05-25 17:40:46 +00:00
b-naber
e7a2f52ba1
don't inline polymorphic adt instances whose fields contain projections
...
in DropGlue.
2023-05-10 16:03:52 +00:00
b-naber
930c39aa8f
dont expect normalization to succeed in elaborate_drops
2023-04-28 07:17:19 +00:00
Maybe Waffle
e496fbec92
Split {Idx, IndexVec, IndexSlice}
into their own modules
2023-04-24 13:53:35 +00:00
Gary Guo
5ae3a53a44
Revert box_free unwind action
2023-04-06 09:34:16 +01:00
Gary Guo
0a5dac3062
Add UnwindAction::Terminate
2023-04-06 09:34:16 +01:00
Gary Guo
5e6ed132fa
Add UnwindAction::Unreachable
...
This also makes eval machine's `StackPopUnwind`
redundant so that is replaced.
2023-04-06 09:34:16 +01:00
Gary Guo
daeb844e0c
Refactor unwind from Option to a new enum
2023-04-06 09:34:16 +01:00
bors
a5a690cf4b
Auto merge of #109008 - clubby789:drop-elaborate-array, r=davidtwco
...
Drop array patterns using subslices
Fixes #109004
Drops contiguous subslices of an array when moving elements out with a pattern, which improves perf for large arrays
r? `@compiler-errors`
2023-04-02 12:17:52 +00:00
Scott McMurray
4abb455529
Update ty::VariantDef
to use IndexVec<FieldIdx, FieldDef>
...
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`.
There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places.
Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-30 09:23:40 -07:00
Scott McMurray
5bbaeadc01
Move mir::Field
→ abi::FieldIdx
...
The first PR for https://github.com/rust-lang/compiler-team/issues/606
This is just the move-and-rename, because it's plenty big-and-bitrotty already. Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-28 22:22:37 -07:00
Scott McMurray
0439d13176
Refactor: VariantIdx::from_u32(0)
-> FIRST_VARIANT
...
Since structs are always `VariantIdx(0)`, there's a bunch of files where the only reason they had `VariantIdx` or `vec::Idx` imported at all was to get the first variant.
So this uses a constant for that, and adds some doc-comments to `VariantIdx` while I'm there, since it doesn't have any today.
2023-03-25 18:58:25 -07:00
clubby789
ce2d52841b
Drop subslices of arrays
2023-03-17 12:26:04 +00:00
Tomasz Miąsko
cf0e78bd3b
Use index based drop loop for slices and arrays
...
Instead of building two kinds of drop pair loops, of which only one will
be eventually used at runtime in a given monomorphization, always use
index based loop.
2023-03-14 21:29:32 +01:00
Oli Scherer
936bf29d4c
s/eval_usize/eval_target_usize/ for clarity
2023-02-14 08:51:19 +00:00
Oli Scherer
4ffe3bdf99
Remove one more usage of mk_substs_trait
2022-12-14 15:36:39 +00:00
Jakob Degen
9fb8da8f8f
Remove unneeded field from SwitchTargets
2022-12-09 04:53:10 -08: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
44d1936d00
Some tracing and comment cleanups
2022-11-04 17:10:07 +00:00
ouz-a
d59c7ff000
Remove mir::CastKind::Misc
2022-10-06 15:32:41 +03:00
Oli Scherer
dab1074b91
Only generate OpaqueCast
for opaque types
2022-09-16 11:37:50 +00:00
DrMeepster
cb417881a9
remove box derefs from codgen
2022-06-15 18:38:26 -07:00
b-naber
705d818bd5
implement valtrees as the type-system representation for constant values
2022-06-14 16:07:11 +02:00