about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-25/+12
2022-11-15Auto merge of #102570 - cjgillot:deagg-debuginfo, r=oli-obkbors-0/+64
Perform simple scalar replacement of aggregates (SROA) MIR opt This is a re-open of https://github.com/rust-lang/rust/pull/85796 I copied the debuginfo implementation (first commit) from `@eddyb's` own SROA PR. This pass replaces plain field accesses by simple locals when possible. To be eligible, the replaced locals: - must not be enums or unions; - must not be used whole; - must not have their address taken. The storage and deinit statements are duplicated on each created local. cc `@tmiasko` who reviewed the former version of this PR.
2022-11-15Introduce composite debuginfo.Camille GILLOT-0/+64
2022-11-15Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obkbors-812/+990
interpret: support for per-byte provenance Also factors the provenance map into its own module. The third commit does the same for the init mask. I can move it in a separate PR if you prefer. Fixes https://github.com/rust-lang/miri/issues/2181 r? `@oli-obk`
2022-11-15Auto merge of #104437 - matthiaskrgr:rollup-n5jdg9v, r=matthiaskrgrbors-9/+69
Rollup of 9 pull requests Successful merges: - #103439 (Show note where the macro failed to match) - #103734 (Adjust stabilization version to 1.65.0 for wasi fds) - #104148 (Visit attributes of trait impl items during AST validation) - #104241 (Move most of unwind's build script to lib.rs) - #104258 (Deduce closure signature from a type alias `impl Trait`'s supertraits) - #104296 (Walk types more carefully in `ProhibitOpaqueTypes` visitor) - #104309 (Slightly improve error message for invalid identifier) - #104316 (Simplify suggestions for errors in generators.) - #104339 (Add `rustc_deny_explicit_impl`) Failed merges: - #103484 (Add `rust` to `let_underscore_lock` example) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-15Rollup merge of #104258 - compiler-errors:tait-closure-deduce, r=oli-obkMatthias Krüger-9/+69
Deduce closure signature from a type alias `impl Trait`'s supertraits r? `@oli-obk` Basically pass the TAIT's bounds through the same method that we're using to deduce a signature from infer var closure bounds. Does this need a new FCP? I see it as a logical extension of #101834, but happy to rfcbot a new one if it does.
2022-11-15Auto merge of #101168 - jachris:dataflow-const-prop, r=oli-obkbors-4/+12
Add new MIR constant propagation based on dataflow analysis The current constant propagation in `rustc_mir_transform/src/const_prop.rs` fails to handle many cases that would be expected from a constant propagation optimization. For example: ```rust let x = if true { 0 } else { 0 }; ``` This pull request adds a new constant propagation MIR optimization pass based on the existing dataflow analysis framework. Since most of the analysis is not unique to constant propagation, a generic framework has been extracted. It works on top of the existing framework and could be reused for other optimzations. Closes #80038. Closes #81605. ## Todo ### Essential - [x] [Writes to inactive enum variants](https://github.com/rust-lang/rust/pull/101168#pullrequestreview-1089493974). Resolved by rejecting the registration of places with downcast projections for now. Could be improved by flooding other variants if mutable access to a variant is observed. - [X] Handle [`StatementKind::CopyNonOverlapping`](https://github.com/rust-lang/rust/pull/101168#discussion_r957774914). Resolved by flooding the destination. - [x] Handle `UnsafeCell` / `!Freeze` correctly. - [X] Overflow propagation of `CheckedBinaryOp`: Decided to not propagate if overflow flag is `true` (`false` will still be propagated) - [x] More documentation in general. - [x] Arguments for correctness, documentation of necessary assumptions. - [x] Better performance, or alternatively, require `-Zmir-opt-level=3` for now. ### Extra - [x] Add explicit unreachability, i.e. upgrading the lattice from $\mathbb{P} \to \mathbb{V}$ to $\set{\bot} \cup (\mathbb{P} \to \mathbb{V})$. - [x] Use storage statements to improve precision. - [ ] Consider opening issue for duplicate diagnostics: https://github.com/rust-lang/rust/pull/101168#issuecomment-1276609950 - [ ] Flood moved-from places with $\bot$ (requires some changes for places with tracked projections). - [ ] Add downcast projections back in. - [ ] [Algebraic simplifications](https://github.com/rust-lang/rust/pull/101168#discussion_r957967878) (possibly with a shared API; done by old const prop). - [ ] Propagation through slices / arrays. - [ ] Find other optimizations that are done by old `const_prop.rs`, but not by this one.
2022-11-14Give precendence to regions from member constaints when inferring concrete ↵Camille GILLOT-6/+5
types.
2022-11-14Rollup merge of #104349 - rustaceanclub:master, r=oli-obkMatthias Krüger-2/+2
fix some typos in comments
2022-11-14Drop `relate_opaque_item_substs`.Camille GILLOT-23/+12
2022-11-14assert that we are (de)seiralizing ProvenanceMap correctlyRalf Jung-13/+13
2022-11-14Remove redundant graphviz escapingJannis Christopher Köhl-4/+3
2022-11-14Manually implement `Encodable` for ProvenanceMap to avoid serializing an ↵Oli Scherer-1/+16
always-none option
2022-11-14Auto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbinibors-1/+0
Bump bootstrap compiler to 1.66 This PR: - Bumps version placeholders to release - Bumps to latest beta - cfg-steps code r? `@pietroalbini`
2022-11-13Rollup merge of #104357 - RalfJung:is-sized, r=cjgillotMatthias Krüger-1/+1
add is_sized method on Abi and Layout, and use it This avoids the double negation of `!is_unsized()` that we have quite a lot.
2022-11-13Do not use `local_def_id` in `node_to_string`.Camille GILLOT-30/+24
2022-11-13Store a LocalDefId in hir::AnonConst.Camille GILLOT-3/+3
2022-11-13Store a LocalDefId in hir::GenericParam.Camille GILLOT-21/+14
2022-11-13Make user_provided_sigs a LocalDefIdMap.Camille GILLOT-2/+2
2022-11-13Store LocalDefId in hir::Closure.Camille GILLOT-2/+2
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-1/+1
2022-11-13fix some typos in commentscui fliter-2/+2
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-11-13Auto merge of #104282 - cjgillot:intern-span, r=compiler-errorsbors-45/+7
Hash spans when interning types Ignoring hash for spans creates an inconsistency between the `Hash` impl for `WithStableHash`, which takes them into account, and the `HashStable` impl which does not. cc `@compiler-errors` Fixes https://github.com/rust-lang/rust/issues/104271 Fixes https://github.com/rust-lang/rust/issues/104255 Fixes https://github.com/rust-lang/rust/issues/104238
2022-11-12Explain redundant mapping.Camille GILLOT-0/+4
2022-11-12Use variances for defining use diag.Camille GILLOT-53/+5
2022-11-12Inherit generics for impl-trait.Camille GILLOT-3/+23
2022-11-12Auto merge of #103530 - cjgillot:hir-lifetimes-direct, r=estebankbors-12/+10
Resolve lifetimes independently for each item-like. Now that the heavy-lifting is done on the AST and during lowering, we do not need to perform HIR lifetime resolution on a full item at once. Instead, we can treat each item-like independently, and look at `generics_of` the parent exceptionally for associated items.
2022-11-11Auto merge of #104293 - Manishearth:rollup-xj92d0k, r=Manishearthbors-0/+5
Rollup of 8 pull requests Successful merges: - #95292 (Allow specialized const trait impls.) - #100386 (Make `Sized` coinductive, again) - #102215 (Implement the `+whole-archive` modifier for `wasm-ld`) - #103468 (Fix unused lint and parser caring about spaces to won't produce invalid code) - #103531 (Suggest calling the instance method of the same name when method not found) - #103960 (piece of diagnostic migrate) - #104051 (update Miri) - #104129 (rustdoc: use javascript to layout notable traits popups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-11Skip stable hashing without incremental.Camille GILLOT-1/+3
2022-11-11Rollup merge of #103960 - AndyJado:var_path_only_diag, r=davidtwcoManish Goregaokar-0/+1
piece of diagnostic migrate r? `@davidtwco`
2022-11-11Rollup merge of #104202 - camsteffen:103748, r=estebankDylan DPC-1/+2
Fix ICE #103748 Fixes #103748
2022-11-11Use the interned stable hash as plain hash.Camille GILLOT-3/+1
2022-11-11Hash spans when interning.Camille GILLOT-6/+2
2022-11-11Do not rename bound variables when verbose-printing binders.Camille GILLOT-39/+5
2022-11-11Resolve lifetimes independently for each item-like.Camille GILLOT-10/+1
2022-11-11Tweak signatures in rustc_middle::hir::map.Camille GILLOT-2/+9
2022-11-10More nitsMichael Goulet-0/+4
2022-11-10Support DoubleEndedIterator for subst_iter and subst_iter_copiedMichael Goulet-9/+69
2022-11-10Rollup merge of #104235 - compiler-errors:more-ct-guar, r=oli-obkManish Goregaokar-5/+7
Use `const_error_with_guaranteed` more Better to pass down an ErrorGuaranteed rather than making a new one out of thin air, for some usages. Also for the ones where we *do* need to delay a bug, that delayed bug will have a more descriptive message.
2022-11-10Rollup merge of #104194 - BoxyUwU:early_binder_docs, r=compiler-errorsManish Goregaokar-0/+3
`EarlyBinder` docs
2022-11-10broken links go brrrrrBoxy-1/+1
2022-11-10Use const_error_with_guaranteed moreMichael Goulet-5/+7
2022-11-10Auto merge of #101990 - clubby789:dont-machine-apply-placeholder-method, ↵bors-0/+6
r=compiler-errors Fix auto-application of associated generic functions with placeholders Fixes #101920
2022-11-09Rollup merge of #103464 - JakobDegen:mir-parsing, r=oli-obkManish Goregaokar-0/+59
Add support for custom mir This implements rust-lang/compiler-team#564 . Details about the design, motivation, etc. can be found in there. r? ```@oli-obk```
2022-11-09Add domain size check to fix ICECameron Steffen-1/+2
2022-11-09docsBoxy-0/+3
2022-11-09Use `LayoutError`'s implementation of `IntoDiagnostic`SLASHLogin-4/+4
2022-11-09var_subdiag refinementAndyJado-0/+1
trim old
2022-11-09another optimization attemptRalf Jung-66/+83
2022-11-08Add support for custom MIR parsingJakob Degen-0/+59