about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/intrinsics
AgeCommit message (Collapse)AuthorLines
2023-10-28interpret: call caller_location logic the same way codegen does, and share ↵Ralf Jung-136/+0
some code
2023-10-17[RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopesUrgau-1/+9
2023-07-25interpret: make write functions generic over the place typeRalf Jung-3/+3
2023-07-25interpret: refactor projection code to work on a common trait, and use that ↵Ralf Jung-3/+3
for visitors
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1/+1
2023-05-25Remove ExpnKind::Inlined.Camille GILLOT-5/+1
2023-04-13Implement `Copy` for `LocationDetail`Maybe Waffle-1/+1
2023-03-18Ignore `Inlined` spans when computing caller location.Camille GILLOT-1/+5
2023-02-24Rename many interner functions.Nicholas Nethercote-1/+1
(This is a large commit. The changes to `compiler/rustc_middle/src/ty/context.rs` are the most important ones.) The current naming scheme is a mess, with a mix of `_intern_`, `intern_` and `mk_` prefixes, with little consistency. In particular, in many cases it's easy to use an iterator interner when a (preferable) slice interner is available. The guiding principles of the new naming system: - No `_intern_` prefixes. - The `intern_` prefix is for internal operations. - The `mk_` prefix is for external operations. - For cases where there is a slice interner and an iterator interner, the former is `mk_foo` and the latter is `mk_foo_from_iter`. Also, `slice_interners!` and `direct_interners!` can now be `pub` or non-`pub`, which helps enforce the internal/external operations division. It's not perfect, but I think it's a clear improvement. The following lists show everything that was renamed. slice_interners - const_list - mk_const_list -> mk_const_list_from_iter - intern_const_list -> mk_const_list - substs - mk_substs -> mk_substs_from_iter - intern_substs -> mk_substs - check_substs -> check_and_mk_substs (this is a weird one) - canonical_var_infos - intern_canonical_var_infos -> mk_canonical_var_infos - poly_existential_predicates - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter - intern_poly_existential_predicates -> mk_poly_existential_predicates - _intern_poly_existential_predicates -> intern_poly_existential_predicates - predicates - mk_predicates -> mk_predicates_from_iter - intern_predicates -> mk_predicates - _intern_predicates -> intern_predicates - projs - intern_projs -> mk_projs - place_elems - mk_place_elems -> mk_place_elems_from_iter - intern_place_elems -> mk_place_elems - bound_variable_kinds - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter - intern_bound_variable_kinds -> mk_bound_variable_kinds direct_interners - region - intern_region (unchanged) - const - mk_const_internal -> intern_const - const_allocation - intern_const_alloc -> mk_const_alloc - layout - intern_layout -> mk_layout - adt_def - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid) - alloc_adt_def(!) -> mk_adt_def - external_constraints - intern_external_constraints -> mk_external_constraints Other - type_list - mk_type_list -> mk_type_list_from_iter - intern_type_list -> mk_type_list - tup - mk_tup -> mk_tup_from_iter - intern_tup -> mk_tup
2023-02-17Replace `mk_foo` calls with `infer_foo` where possible.Nicholas Nethercote-1/+1
There are several `mk_foo`/`intern_foo` pairs, where the former takes an iterator and the latter takes a slice. (This naming convention is bad, but that's a fix for another PR.) This commit changes several `mk_foo` occurrences into `intern_foo`, avoiding the need for some `.iter()`/`.into_iter()` calls. Affected cases: - mk_type_list - mk_tup - mk_substs - mk_const_list
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-07miri: fix ICE when running out of address spaceRalf Jung-3/+4
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-2/+0
2022-11-18interpret: use Either over Result when it is not representing an error conditionRalf Jung-2/+2
2022-10-31interpret: move type_name implementation to an interpreter-independent ↵Ralf Jung-201/+0
helper file
2022-10-30All verbosity checks in `PrettyPrinter` now go through ↵Sarthak Singh-4/+7
`PrettyPrinter::should_print_verbose`
2022-10-25Added helper to prevent verbose printing from the `PrettyPrinter` when ↵Sarthak Singh-2/+4
printing constants
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+0
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-08-26Replace `Body::basic_blocks()` with field accessTomasz Miąsko-1/+1
2022-07-19interpret: rename Tag/PointerTag to Prov/ProvenanceRalf Jung-2/+2
Let's avoid using two different terms for the same thing -- let's just call it "provenance" everywhere. In Miri, provenance consists of an AllocId and an SbTag (Stacked Borrows tag), which made this even more confusing.
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-06-04tweak some bug!sRalf Jung-1/+1
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-4/+4
2022-05-13Add bound_type_ofJack Huey-5/+4
2022-05-10Introduce EarlyBinderJack Huey-4/+5
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-1/+2
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-03-07Introduce `ConstAllocation`.Nicholas Nethercote-2/+2
Currently some `Allocation`s are interned, some are not, and it's very hard to tell at a use point which is which. This commit introduces `ConstAllocation` for the known-interned ones, which makes the division much clearer. `ConstAllocation::inner()` is used to get the underlying `Allocation`. In some places it's natural to use an `Allocation`, in some it's natural to use a `ConstAllocation`, and in some places there's no clear choice. I've tried to make things look as nice as possible, while generally favouring `ConstAllocation`, which is the type that embodies more information. This does require quite a few calls to `inner()`. The commit also tweaks how `PartialOrd` works for `Interned`. The previous code was too clever by half, building on `T: Ord` to make the code shorter. That caused problems with deriving `PartialOrd` and `Ord` for `ConstAllocation`, so I changed it to build on `T: PartialOrd`, which is slightly more verbose but much more standard and avoided the problems.
2022-02-23Rename `region_should_not_be_omitted` to `should_print_region`Tomasz Miąsko-1/+1
to avoid double negation
2022-02-15Overhaul `Const`.Nicholas Nethercote-1/+1
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-2/+2
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-2/+2
2021-12-13Remove `in_band_lifetimes` from `rustc_const_eval`LegionMammal978-1/+1
See #91867 for more information.
2021-11-06use matches!() macro in more placesMatthias Krüger-4/+2
2021-10-21Configure saved panic locations based on location-detail flagHudson Ayers-4/+11
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-0/+320