about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/monomorphize/collector.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Move monomorphize code to its own crate.Camille GILLOT-1414/+0
2021-08-28Treat macros as HIR itemsinquisitivecrystal-0/+1
2021-08-26add `tcx` to `fn walk`lcnr-1/+1
2021-07-20Switch to store `Instance` directly within `VtblEntry`, fix `TraitVPtr` ↵Charles Lew-7/+3
representation.
2021-07-20Refactor vtable format.Charles Lew-0/+4
2021-07-14consistently treat None-tagged pointers as ints; get rid of some deprecated ↵Ralf Jung-1/+1
Scalar methods
2021-07-14CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion ↵Ralf Jung-4/+4
infallible This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-3/+3
2021-07-04Query-ify global limit attribute handlingAaron Hill-6/+16
2021-06-28Introduce -Zprofile-closures to evaluate the impact of 2229Aman Arora-0/+7
This creates a CSV with name "closure_profile_XXXXX.csv", where the variable part is the process id of the compiler. To profile a cargo project you can run one of the following depending on if you're compiling a library or a binary: ``` cargo +stage1 rustc --lib -- -Zprofile-closures cargo +stage1 rustc --bin -- -Zprofile-closures ```
2021-06-15Refactor to make interpreter and codegen backend neutral to vtable internal ↵Charles Lew-10/+11
representation.
2021-05-27don't trim paths in collector PME messageRémy Rakic-4/+3
2021-05-25emit diagnostic after post-monomorphization errorsRémy Rakic-2/+44
Emit a diagnostic when the monomorphized item collector encounters errors during a step of the recursive item collection. These post-monomorphization errors otherwise only show the erroneous expression without a trace, making them very obscure and hard to pinpoint whenever they happen in dependencies.
2021-05-17Auto merge of #85178 - cjgillot:local-crate, r=oli-obkbors-3/+3
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-13global_asm! consts do not depend on other itemsAmanieu d'Antras-7/+4
2021-05-13Add support for const operands and options to global_asm!Amanieu d'Antras-1/+20
On x86, the default syntax is also switched to Intel to match asm!
2021-05-12Use () for codegen queries.Camille GILLOT-2/+2
2021-05-12Use () for entry_fn.Camille GILLOT-1/+1
2021-04-29Implement RFC 1260 with feature_name `imported_main`.Charles Lew-2/+2
2021-04-20Add an attribute to be able to configure the limitOli Scherer-1/+6
2021-04-20Implement a lint that highlights all moves larger than 1000 bytesOli Scherer-0/+37
2021-04-02fixMario Carneiro-1/+2
2021-04-02clarify wordingMario Carneiro-3/+6
2021-04-02Monomorphization doc fixMario Carneiro-2/+2
Only public items are monomorphization roots. This can be confirmed by noting that this program compiles: ```rust fn foo<T>() { if true { foo::<Option<T>>() } } fn bar() { foo::<()>() } ```
2021-03-31Add a new normalization query just for mir constantsOli Scherer-1/+30
2021-03-31We should never see unevaluated type-level constants after monomorphization ↵Oli Scherer-1/+7
unless errors occurred
2021-03-23Add has_default to GenericParamDefKind::Constkadmin-1/+2
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
2021-03-20update `const_eval_resolve`lcnr-2/+2
2021-03-20extract `ConstKind::Unevaluated` into a structlcnr-1/+1
2021-03-12Prepare mir::Constant for ty::Const only supporting valtreesOli Scherer-1/+1
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-2/+1
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-16/+12
Items are guaranteed to be HIR owner.
2021-02-15Use an ItemId inside mir::GlobalAsm.Camille GILLOT-1/+1
2021-01-14Rollup merge of #80969 - camelid:monomorph-ice-msg, r=nagisaMara Bos-1/+1
Use better ICE message when no MIR is available The ICE message is somewhat confusing and overly specific - the issue is that there's no MIR available. This should make debugging these ICEs easier since the error tells you what's actually wrong, not what it was trying to do when it failed. cc https://github.com/rust-lang/rust/pull/80952#issuecomment-759198841 cc `````@jyn514`````
2021-01-12Use better ICE message when no MIR is availableCamelid-1/+1
The ICE message is somewhat confusing and overly specific - the issue is that there's no MIR available. This should make debugging these ICEs easier since the error tells you what's actually wrong, not what it was trying to do when it failed. cc https://github.com/rust-lang/rust/pull/80952#issuecomment-759198841
2021-01-12Separate out a `hir::Impl` structJoshua Nelson-3/+3
This makes it possible to pass the `Impl` directly to functions, instead of having to pass each of the many fields one at a time. It also simplifies matches in many cases.
2020-11-26Remove ForeignMod struct.Camille GILLOT-1/+1
2020-11-26Store ForeignItem in a side table.Camille GILLOT-0/+2
2020-11-16compiler: fold by valueBastian Kauschke-2/+2
2020-11-06inliner: Use substs_for_mir_bodyTomasz Miąsko-5/+5
Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account.
2020-10-10Use range instead of tuple of intsDániel Buga-9/+9
2020-09-21Let user see the full type of type-length limit errorKornel Lesiński-26/+40
2020-09-19Stop using the `const_eval` query for initializers of staticsOliver Scherer-2/+4
As a side effect, we now represent most promoteds as `ConstValue::Scalar` again. This is useful because all implict promoteds are just references anyway and most explicit promoteds are numeric arguments to `asm!` or SIMD instructions.
2020-09-17Better handling for exponential-sized types in misc placesValerii Lashmanov-19/+28
Mostly to fix ui/issues/issue-37311-type-length-limit/issue-37311.rs. Most parts of the compiler can handle deeply nested types with a lot of duplicates just fine, but some parts still attempt to naively traverse type tree. Before such problems were caught by type length limit check, but now these places will have to be changed to handle duplicated types gracefully.
2020-09-04Change ty.kind to a methodLeSeulArtichaut-5/+5
2020-08-30ty: remove obsolete printerDavid Wood-16/+8
This commit removes the obsolete printer and replaces all uses of it with `FmtPrinter`. Of the replaced uses, all but one use was in `debug!` logging, two cases were notable: - `MonoItem::to_string` is used in `-Z print-mono-items` and therefore affects the output of all codegen-units tests. - `DefPathBasedNames` was used in `librustc_codegen_llvm/type_of.rs` with `LLVMStructCreateNamed` and that'll now get different values, but this should result in no functional change. Signed-off-by: David Wood <david@davidtw.co>
2020-08-30mv compiler to compiler/mark-0/+1242