summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/util
AgeCommit message (Collapse)AuthorLines
2024-03-02Rollup merge of #121731 - oli-obk:eager_opaque_checks, r=compiler-errorsGuillaume Boisseau-22/+3
Now that inlining, mir validation and const eval all use reveal-all, we won't be constraining hidden types here anymore r? `@compiler-errors` one bubble down, two more to go the test is unrelated, just something I noticed would be good to test in both the old solver and the new.
2024-02-28Now that inlining, mir validation and const eval all use reveal-all, we ↵Oli Scherer-22/+3
won't be constraining hidden types here anymore
2024-02-27Split rustc_type_ir to avoid rustc_ast from depending on itOli Scherer-2/+1
2024-02-21make it possible for outside crates to inspect a mir::ConstValue with the ↵Ralf Jung-2/+7
interpreter
2024-02-10unstably allow constants to refer to statics and read from immutable staticsRalf Jung-4/+4
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-0/+1
2024-01-25Auto merge of #119627 - oli-obk:const_prop_lint_n̵o̵n̵sense, r=cjgillotbors-2/+2
Remove all ConstPropNonsense We track all locals and projections on them ourselves within the const propagator and only use the InterpCx to actually do some low level operations or read from constants (via `OpTy` we get for said constants). This helps moving the const prop lint out from the normal pipeline and running it just based on borrowck information. This in turn allows us to make progress on https://github.com/rust-lang/rust/pull/108730#issuecomment-1875557745 there are various follow up cleanups that can be done after this PR (e.g. not matching on Rvalue twice and doing binop checks twice), but lets try landing this one first. r? `@RalfJung`
2024-01-23partially inline `eval_rvalue_into_place` for const prop lintOli Scherer-2/+2
2024-01-22const-eval interner: from-scratch rewrite using mutability information from ↵Ralf Jung-0/+1
provenance rather than types
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-12-10Revert "Don't print host effect param in pretty path_generic_args"Deadbeef-1/+0
This reverts commit f1bf874fb13703d706fc8184407c6df12555d8e9.
2023-12-09Don't print host effect param in pretty path_generic_argsMichael Goulet-0/+1
2023-10-31Turn const_caller_location from a query to a hookOli Scherer-5/+8
2023-10-28interpret: call caller_location logic the same way codegen does, and share ↵Ralf Jung-0/+64
some code
2023-10-21Make `ty::print::Printer` take `&mut self` instead of `self`Nilstrieb-37/+39
This simplifies the code by removing all the `self` assignments and makes the flow of data clearer - always into the printer. Especially in v0 mangling, which already used `&mut self` in some places, it gets a lot more uniform.
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-17Remove `Print::Error`Nilstrieb-1/+1
All printing goes through `fmt::Error` now.
2023-10-17Remove `Printer::Error`Nilstrieb-19/+17
It's always a `fmt::Error` except in some cases where it was `!`, but we're not really winning anything in that case.
2023-10-17Remove `Print::Output`Nilstrieb-1/+1
Now that `Printer` doesn't have subprinters anymore, the output of a printing operation is always the same.
2023-10-17Remove "subprinter" types from `Printer`Nilstrieb-18/+12
These are `Self` in almost all printers except one, which can just store the state as a field instead. This simplifies the printer and allows for further simplifications, for example using `&mut self` instead of passing around the printer.
2023-10-07Auto merge of #115583 - RalfJung:packed-unsized, r=lcnrbors-1/+9
fix detecting references to packed unsized fields Fixes https://github.com/rust-lang/rust/issues/115396 This is a breaking change, but permitted as a soundness fix.
2023-10-02have better explanation for `relate_types`ouz-a-3/+3
2023-10-02change is_subtype to relate_typesouz-a-5/+11
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-2/+1
2023-09-06still accept references to u8 slices and str in packed fieldsRalf Jung-2/+8
2023-09-05fix detecting references to packed unsized fieldsRalf Jung-1/+3
2023-09-04interpret: make MemPlace, Place, Operand types private to the interpreterRalf Jung-1/+1
2023-08-24MIR validation: reject in-place argument/return for packed fieldsRalf Jung-2/+3
2023-07-27Turns out opaque types can have hidden types registered during mir validationOli Scherer-6/+9
2023-07-21Double check that hidden types match the expected hidden typeOli Scherer-3/+8
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-7/+6
2023-07-01Put `LayoutError` behind reference to shrink resultNilstrieb-3/+3
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's shrink that.
2023-06-24Add enum for `can_access_statics` booleanNilstrieb-3/+2
`/*can_access_statics:*/ false` is one of the ways to do this, but not the one I like.
2023-06-19Dedup some type checks in the MIR validatorScott McMurray-0/+26
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-0/+1
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-05-31Remove const eval limit and implement an exponential backoff lint insteadOli Scherer-6/+2
2023-05-25Move DefiningAnchorMichael Goulet-2/+2
2023-05-22properly pretty-print inherent projectionsLeón Orell Valerian Liehr-1/+2
2023-04-16Move some utils out of `rustc_const_eval`Nilstrieb-214/+0
This allows us to get rid of the `rustc_const_eval->rustc_borrowck` dependency edge which was delaying the compilation of borrowck. The added utils in `rustc_middle` are small and should not affect compile times there.
2023-03-02Allow checking whether a type allows being uninitializedNilstrieb-1/+4
This is useful for clippy and for the future `MaybeUninit::assume_init` panics.
2023-02-27Unify all validity check intrinsicsNilstrieb-12/+22
Also merges the inhabitedness check into the query to further unify the code paths.
2023-02-23Unify validity checks into a single queryNilstrieb-3/+3
Previously, there were two queries to check whether a type allows the 0x01 or zeroed bitpattern. I am planning on adding a further initness to check, truly uninit for MaybeUninit, which would make this three queries. This seems overkill for such a small feature, so this PR unifies them into one.
2023-02-14Make permit_uninit/zero_init fallibleMichael Goulet-23/+17
2023-02-14Don't ICE in might_permit_raw_init if reference is polymorphicMichael Goulet-2/+7
2023-02-02Stop deaggegating MIR.Camille GILLOT-79/+0
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-0/+1
2023-01-26add method_substs to CallKindKyle Matsuda-1/+2
2023-01-23Thread a ParamEnv down to might_permit_raw_initBen Kimock-1/+2
2023-01-09Assert defining anchor is set in take_opaque_typesMichael Goulet-1/+1
2022-12-15Make alignment checks a future incompat lintOli Scherer-2/+2