Nicholas Nethercote
5a5e2489c5
Reduce pub exposure.
...
A lot of errors don't need to be visible outside the crate, and some
other things as well.
2024-06-04 16:55:55 +10:00
Nicholas Nethercote
2539364053
Remove #[macro_use] extern crate tracing from rustc_mir_build.
2024-05-23 18:02:40 +10:00
Nicholas Nethercote
900bcacf3a
Remove extern crate rustc_middle from rustc_mir_build.
2024-05-13 08:20:18 +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
Matthew Jasper
a277c901d9
Remove MIR unsafe check
...
This also remove safety information from MIR.
2024-04-03 08:50:12 +00:00
omahs
758f642c29
fix typo
2024-03-17 14:25:24 +01:00
Jubilee
e3f9b2f27c
Rollup merge of #122080 - Zalathar:drop-tree, r=oli-obk
...
Clarity improvements to `DropTree`
These changes are based on some points of confusion I had when initially trying to understand this code.
The only “functional” change is an additional assertion in `<ExitScopes as DropTreeBuilder>::link_entry_point`, checking that the dummy terminator is `TerminatorKind::UnwindResume` as expected.
2024-03-11 09:29:35 -07:00
Zalathar
570376c496
Don't pass a break scope to Builder::break_for_else
...
This method would previously take a target scope, and then verify that it
was equal to the scope on top of the if-then scope stack.
In practice, this means that callers have to go out of their way to pass around
redundant scope information that's already on the if-then stack.
So it's easier to just retrieve the correct scope directly from the if-then
stack, and simplify the other code that was passing it around.
2024-03-07 23:11:18 +11:00
Zalathar
5ba70bd3ec
Replace tuples in DropTree with named structs
...
This allows us to use real field names instead of tuple element numbers.
Renaming `previous_drops` to `existing_drops_map` clarifies that "previous" was
unrelated to drop order.
2024-03-06 23:09:04 +11:00
Zalathar
fbdac30427
Rename DropTree::add_entry to add_entry_point
...
This clarifies that we're adding an "entry point", not just adding an "entry"
of some kind.
2024-03-06 23:02:38 +11:00
Zalathar
3bd8df96e1
Assert that link_entry_point sees the expected dummy terminator
2024-03-06 22:32:01 +11:00
Zalathar
30fa6a8b50
Rename DropTreeBuilder::add_entry to link_entry_point
2024-03-06 22:32:01 +11:00
Vadim Petrochenkov
b07283815b
hir: Remove hir::Map::{opt_parent_id,parent_id,get_parent,find_parent}
2024-02-10 12:24:46 +03:00
Oli Scherer
eab2adb660
Continue to borrowck even if there were previous errors
2024-02-08 08:10:43 +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
5e2b66fc9d
Don't populate yield and resume types after the fact
2024-01-06 18:03:01 +00:00
Matthew Jasper
68d684cbff
Pass THIR ExprIds in MIR building
2023-12-18 16:54:58 +00:00
bors
1dfb2283d7
Auto merge of #116170 - matthewjasper:remove-thir-destruction-scopes, r=cjgillot
...
Don't include destruction scopes in THIR
They are not used by anyone, and add memory/performance overhead.
2023-12-09 12:38:32 +00:00
Zalathar
98166358a9
coverage: Use SpanMarker to mark continue expressions.
...
This replaces the previous workaround, which was to inject a dummy `Assign`
statement.
2023-12-08 22:40:49 +11:00
Matthew Jasper
43adf41ca6
Don't include destruction scopes in THIR
...
They are not used by anyone, and add memory/performance overhead.
2023-12-04 16:31:13 +00:00
Nicholas Nethercote
7060fc8327
Replace no_ord_impl with orderable.
...
Similar to the previous commit, this replaces `newtype_index`'s opt-out
`no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-22 18:38:17 +11: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
Camille GILLOT
e63d19c4dd
Remove mir::LocalDecl::internal.
2023-10-04 17:55:15 +00:00
Ralf Jung
4c53783f3c
when terminating during unwinding, show the reason why
2023-08-24 13:28:26 +02:00
Ralf Jung
818ec8e23a
give some unwind-related terminators a more clear name
2023-08-20 15:52:38 +02:00
Nicholas Nethercote
667d75e546
Add a cache for maybe_lint_level_root_bounded.
...
It's a nice speed win.
2023-07-13 09:32:09 +10:00
Nicholas Nethercote
f234dc3e1c
Move maybe_lint_level_root_bounded.
...
From `TyCtxt` to the MIR `Builder`. This will allow us to add a cache to
`Builder` and use it from `maybe_lint_level_root_bounded`.
2023-07-12 10:02:13 +10:00
Nicholas Nethercote
36458109ae
Shorten some overlong comment lines.
...
It's annoying that these wrap in a 100-char terminal window.
2023-07-12 09:16:31 +10:00
Boxy
12138b8e5e
Move TyCtxt::mk_x to Ty::new_x where applicable
2023-07-05 20:27:07 +01:00
Camille GILLOT
844c1cc5fe
Remove DesugaringKind::Replace.
2023-05-25 17:40:46 +00:00
Maybe Waffle
fb0f74a8c9
Use Option::is_some_and and Result::is_ok_and in the compiler
2023-05-24 14:20:41 +00:00
Maybe Waffle
03d5f9b783
rustc_mir_build: drive-by-cleaup: replace nested ifs with a match
2023-05-17 11:27:37 +00:00
Maybe Waffle
5ae51d69a3
rustc_mir_build: drive-by-cleanup: remove some local mutable state
2023-05-17 11:27:37 +00:00
Ben Kimock
f08f903fa9
Box AssertKind
2023-05-01 23:12:41 -04:00
Maybe Waffle
e496fbec92
Split {Idx, IndexVec, IndexSlice} into their own modules
2023-04-24 13:53:35 +00:00
Gary Guo
c5829c2ee5
Fix new usage of old api
2023-04-06 09:34:16 +01:00
Gary Guo
e3f2edc75b
Rename Abort terminator to Terminate
...
Unify terminology used in unwind action and terminator, and reflect
the fact that a nounwind panic is triggered instead of an immediate
abort is triggered for this terminator.
2023-04-06 09:34:16 +01:00
Gary Guo
0a5dac3062
Add UnwindAction::Terminate
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
Scott McMurray
a2ee7592d6
Use &IndexSlice instead of &IndexVec where possible
...
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-04-02 17:35:37 -07:00
Giacomo Pasini
c5d4e4d907
Remove DropAndReplace terminator
...
PR 107844 made DropAndReplace unused, let's remove it completely
from the codebase.
2023-03-07 14:25:22 +01:00
Giacomo Pasini
b3a47d9b6b
Desugars drop and replace at MIR build
...
This commit desugars the drop and replace deriving from an
assignment at MIR build, avoiding the construction of the
DropAndReplace terminator (which will be removed in a followign PR)
In order to retain the same error messages for replaces a new
DesugaringKind::Replace variant is introduced.
2023-03-03 16:33:11 +01:00
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +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
Will Crichton
d595884302
Move -Z maximal-hir-to-mir-coverage implementation to new maybe_new_source_scope method
2022-12-05 12:47:44 -08:00
Maybe Waffle
1d42936b18
Prefer doc comments over //-comments in compiler
2022-11-27 11:19:04 +00:00
Ding Xiang Fei
565c35aa5c
fix doc and dedup diverge_cleanup
2022-10-05 22:24:12 +08:00
X
fb52dc7c3b
apply suggestion
...
Co-authored-by: SafariMonkey <charlton.rodda@gmail.com >
2022-09-30 21:03:08 +08:00