about summary refs log tree commit diff
path: root/src/librustc_mir/const_eval.rs
AgeCommit message (Collapse)AuthorLines
2020-02-22move const_eval.rs into the module folderRalf Jung-87/+0
2020-02-16Code review changes.Ben Lewis-1/+1
2020-02-15Change `const_field` and `const_caller_location` to return `ConstValue` ↵Ben Lewis-11/+4
instead of `Const` as the type in the returned const isn't needed.
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-2/+4
inside it shouldn't be used.
2020-01-15Promoteds can contain raw pointers, but these must still only point to ↵Oliver Scherer-2/+2
immutable allocations
2020-01-12Split `rustc_mir::{build, hair, lints}` into their own crateMatthew Jasper-6/+23
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-1/+1
2020-01-08Move `is_min_const_fn` query to librustc_mir.Camille GILLOT-0/+2
The only two uses of the associated methods are in librustc_mir and librustdoc. Please tell me if there is a better choice.
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-2/+1
2019-12-26Rebase falloutOliver Scherer-0/+2
2019-12-26Rename `query` moduleOliver Scherer-2/+2
2019-12-26Move all functions used by the queries to query.rsOliver Scherer-108/+3
2019-12-26Make some functions crate localOliver Scherer-3/+3
2019-12-26Move `eval_body_using_ecx` to the only module it is used inOliver Scherer-48/+3
2019-12-26Move const eval query components into their own moduleOliver Scherer-226/+4
2019-12-26Move const eval machine into its own moduleOliver Scherer-344/+11
2019-12-24Deprecate Error::description for realDavid Tolnay-13/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-24x.py fmt after previous deignoreMark Rousskov-169/+117
2019-12-23Constants reading or referencing statics is illegalOliver Scherer-3/+4
and some uses of it will be illegal forever (e.g. mutable or interior mutable statics)
2019-12-23Dynamically prevent constants from accessing staticsOliver Scherer-12/+40
2019-12-22Add simpler entry points to const eval for common usages.Ben Lewis-2/+2
2019-12-08Rollup merge of #66991 - Nashenas88:body_cache_cleanup, r=eddybMazdak Farrokhzad-2/+2
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in #65947) cc @eddyb @oli-obk
2019-12-06Always call const fns with #[track_caller].Adam Perry-2/+6
The caller location is passed as an implicit argument, so we must consider it when checking the sizedness of arguments.
2019-12-05Generate &core::panic::Location type in a single place.Adam Perry-6/+1
2019-12-05rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded ↵Paul Daniel Faria-2/+2
Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
2019-12-04Auto merge of #66866 - oli-obk:const_fn_memoization, r=RalfJungbors-3/+15
Only memoize const fn calls during const eval Miri and other engines may want to execute the function in order to detect UB inside of them. r? @RalfJung
2019-12-02Auto merge of #64736 - Nashenas88:mir_predecessors_cache_cleanup, r=oli-obkbors-2/+2
Remove interior mutability in mir predecessors cache
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-2/+2
rename all body_cache back to body
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-2/+2
(lifetime errors still exist)
2019-12-02fix init_allocation_extraRalf Jung-2/+2
2019-12-02make alloc_extra machine hook a bit nicerRalf Jung-3/+3
2019-12-02Miri: add helper fn to allocate string; simplify alloc_caller_locationRalf Jung-1/+1
2019-12-02expose span to M::assert_panic, and provide helper to turn that into ↵Ralf Jung-0/+1
CallerLocation
2019-12-02Miri: add machine hook for MIR-level assertion panicsRalf Jung-1/+34
2019-11-30Don't repeat the `is_const_fn_raw` checkOliver Scherer-14/+12
2019-11-30`find_fn` -> `find_mir_or_eval_fn` renameOliver Scherer-2/+2
2019-11-29Only memoize const fn calls during const evalOliver Scherer-0/+14
Miri and other engines may want to execute the function in order to detect UB inside of them.
2019-11-28Auto merge of #66294 - davidhewitt:const_fn_memoization, r=oli-obkbors-1/+10
Add memoization for const function evaluations When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism. With thanks to @oli-obk for mentoring me through this at RustFest Barcelona. r? @oli-obk
2019-11-27Correct typo in src/librustc_mir/const_eval.rsDavid Hewitt-1/+1
Co-Authored-By: lqd <remy.rakic+github@gmail.com>
2019-11-27Add memoization for const function evaluationsDavid Hewitt-1/+10
When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-25miri: couple ret place and ret block together (they both exist or both don't)Ralf Jung-9/+6
2019-11-25refactor goto_block and also add unwind_to_blockRalf Jung-1/+1
2019-11-14Auto merge of #66233 - cjgillot:constkind, r=oli-obkbors-4/+4
Split ConstValue into two enums Hello, Issue #59210 appeared abandoned, so I gave it a go. Some further cleanup and refactoring may be mandated. I did not test beyond `x.py check`, since my home computer dies compiling librustc. Fixes #59210
2019-11-12Rename in librustc_mir.Camille GILLOT-4/+4
2019-11-11Rename toAaron Hill-1/+1
2019-11-11Remove trampoline, pass `ret` and `unwind` when handling intrinsicsAaron Hill-0/+2
2019-11-11Some cleanupAaron Hill-11/+1
2019-11-11A few minor tweaksAaron Hill-1/+2
2019-11-11Formatting improvementsAaron Hill-1/+2
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>