about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-07-02Auto merge of #91743 - cjgillot:enable_mir_inlining_inline_all, r=oli-obkbors-5/+26
Enable MIR inlining Continuation of https://github.com/rust-lang/rust/pull/82280 by `@wesleywiser.` #82280 has shown nice compile time wins could be obtained by enabling MIR inlining. Most of the issues in https://github.com/rust-lang/rust/issues/81567 are now fixed, except the interaction with polymorphization which is worked around specifically. I believe we can proceed with enabling MIR inlining in the near future (preferably just after beta branching, in case we discover new issues). Steps before merging: - [x] figure out the interaction with polymorphization; - [x] figure out how miri should deal with extern types; - [x] silence the extra arithmetic overflow warnings; - [x] remove the codegen fulfilment ICE; - [x] remove the type normalization ICEs while compiling nalgebra; - [ ] tweak the inlining threshold.
2022-07-02Rollup merge of #98766 - lcnr:mir-visit-pass_by_value, r=oli-obkDylan DPC-106/+149
cleanup mir visitor for `rustc::pass_by_value` by changing `& $($mutability)?` to `$(& $mutability)?` I also did some formatting changes because I started doing them for the visit methods I changed and then couldn't get myself to stop xx, I hope that's still fairly easy to review.
2022-07-02Rollup merge of #98639 - camsteffen:no-node-binding, r=compiler-errorsDylan DPC-4/+1
Factor out `hir::Node::Binding`
2022-07-01Auto merge of #98781 - GuillaumeGomez:rollup-798kb8u, r=GuillaumeGomezbors-0/+8
Rollup of 5 pull requests Successful merges: - #97249 (`<details>`/`<summary>` UI fixes) - #98418 (Allow macOS to build LLVM as shared library) - #98460 (Use CSS variables to handle theming) - #98497 (Improve some inference diagnostics) - #98708 (rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests) Failed merges: - #98761 (more `need_type_info` improvements) r? `@ghost` `@rustbot` modify labels: rollup
2022-07-01Don't point at Self type if we can't find an infer variable in ambiguous ↵Michael Goulet-0/+8
trait predicate
2022-07-01Shorten def_span for more items.Camille GILLOT-30/+90
2022-07-01Factor out hir::Node::BindingCameron Steffen-4/+1
2022-07-01cleanup mir visitor for `rustc::pass_by_value`lcnr-106/+149
2022-06-30Recover when failing to normalize closure signature.Camille GILLOT-5/+26
2022-06-30Make `evaluate_obligation` not succeed unconditionally if it registered new ↵Oli Scherer-9/+14
hidden types for opaque types
2022-06-30lint: port drop trait/glue diagnosticsDavid Wood-0/+6
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30middle: translation in `LintDiagnosticBuilder`David Wood-2/+3
Accept `DiagnosticMessage` in `LintDiagnosticBuilder::build` so that lints can be built with translatable diagnostic messages. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30Auto merge of #98649 - RalfJung:guardians-of-mir, r=oli-obkbors-1149/+1182
move MIR syntax into a dedicated file and ping some people whenever it changes Adding or changing MIR operations/statements/whatever should be under significant scrutiny wrt their wider impact, specified semantics, and so on. So let's start by putting all that into a dedicated file and pinging some people whenever that file changes. This PR only moves definitions around, and then fiddles with imports until it all works again.
2022-06-30Clarify MIR semantics of checked binary operationsTomasz Miąsko-4/+12
2022-06-29fix doc issuesRalf Jung-7/+7
2022-06-29Auto merge of #98520 - RalfJung:invalid, r=compiler-errorsbors-2/+4
interpret: adjust error from constructing an invalid value
2022-06-29move MIR syntax into a dedicated file and ping some people whenever it changesRalf Jung-1148/+1181
2022-06-29Rollup merge of #98665 - ChrisDenton:deprecated-suggestion, r=compiler-errorsMatthias Krüger-1/+1
Use verbose help for deprecation suggestion Fixes #98631 r? `@compiler-errors`
2022-06-29Rollup merge of #98643 - voidc:valtree-ref-pretty, r=lcnrMatthias Krüger-23/+11
Improve pretty printing of valtrees for references This implements the changes outlined in https://github.com/rust-lang/rust/issues/66451#issuecomment-1168859638. r? `@lcnr` Fixes #66451
2022-06-29pessimistically treat all function items as containing an opaque typeOli Scherer-0/+5
2022-06-29interpret: adjust error from constructing an invalid valueRalf Jung-2/+4
2022-06-29Use verbose help for deprecation suggestionChris Denton-1/+1
2022-06-29Improve doc comment of destructure_constDominik Stolz-1/+2
2022-06-28Fix trait object reborrow suggestionMichael Goulet-1/+1
2022-06-28Improve pretty printing of valtrees for referencesDominik Stolz-23/+10
2022-06-28make `get_relocations` privateRémy Rakic-6/+11
This limits access to the relocations data a bit (instead of increasing it just for the purposes of interning).
2022-06-28Do not fetch HIR to compute variances.Camille GILLOT-0/+9
2022-06-28Auto merge of #98222 - cjgillot:single-wf, r=michaelwoeristerbors-24/+26
Only keep a single query for well-formed checking There are currently 3 queries to perform wf checks on different item-likes. This complexity is not required. This PR replaces the query by: - one query per item; - one query to invoke it for a whole module. This allows to remove HIR `ParItemLikeVisitor`.
2022-06-27Rollup merge of #98576 - lcnr:region-stuff-cool-beans, r=jackh726Matthias Krüger-6/+2
small regions refactoring these commits should be fairly self-contained r? rust-lang/types
2022-06-27Rollup merge of #98506 - compiler-errors:object-safety-suggestions, r=oli-obkMatthias Krüger-38/+29
Fix span issues in object safety suggestions Fixes #98500
2022-06-27fold_region: remove unused parameterlcnr-6/+2
2022-06-27Rollup merge of #97780 - compiler-errors:field-wfcheck-before-sized, r=jackh726Matthias Krüger-1/+1
Check ADT field is well-formed before checking it is sized Fixes #96810. There is one diagnostics regression, in [`src/test/ui/generic-associated-types/bugs/issue-80626.stderr`](https://github.com/rust-lang/rust/pull/97780/files#diff-53795946378e78a0af23a10277c628ff79091c18090fdc385801ee70c1ba6963). I am not super concerned about it, since it's GAT related. We _could_ fix it, possibly by using the `FieldSized` obligation cause code instead of `BuiltinDerivedObligation`. But that would require changing `Sized` trait confirmation and the `adt_sized_constraint` query.
2022-06-27Auto merge of #98221 - cjgillot:single-coh, r=lcnrbors-3/+4
Perform coherence checking per impl. r? `@ghost`
2022-06-26Rollup merge of #98371 - compiler-errors:better-opaque-printing, r=oli-obkYuki Okushi-113/+120
Fix printing `impl trait` under binders Before, we would render `impl for<'a> Trait<'a>` like `impl Trait<for<'a> 'a>`, lol.
2022-06-25Fix span issues in object safety suggestionsMichael Goulet-38/+29
2022-06-25Rollup merge of #98311 - eggyal:reverse-folder-hierarchy, r=jackh726Matthias Krüger-55/+36
Reverse folder hierarchy #91318 introduced a trait for infallible folders distinct from the fallible version. For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible. Moreover the `Error` associated type was defined on the infallible trait! It's so absurd that it has me questioning whether I was entirely sane. This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation). This of course makes much more sense! It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs. There is one downside however: folders expose a `tcx` accessor method. Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate. Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate. If desired, I can submit that as a separate PR. r? ````@jackh726````
2022-06-24Use write! instead of p! to avoid having to use weird scopingMichael Goulet-25/+12
2022-06-24Fix printing impl trait under bindersMichael Goulet-113/+133
2022-06-24Rollup merge of #98280 - compiler-errors:better-call-closure-on-type-err, ↵Yuki Okushi-1/+1
r=estebank Improve suggestion for calling fn-like expr on type mismatch 1.) Suggest calling values of with RPIT types (and probably TAIT) when we expect `Ty` and have `impl Fn() -> Ty` 2.) Suggest calling closures even when they're not assigned to a local variable first 3.) Drive-by fix of a pretty-printing bug (`impl Fn()-> Ty` => `impl Fn() -> Ty`) r? ```@estebank```
2022-06-24Rollup merge of #96955 - Aaron1011:pretty-print-sort, r=petrochenkovYuki Okushi-11/+10
Remove (transitive) reliance on sorting by DefId in pretty-printer This moves us a step closer to removing the `PartialOrd/`Ord` impls for `DefId`. See #90317
2022-06-23Rollup merge of #98388 - rosehuds:master, r=davidtwcoMichael Goulet-4/+18
implement `iter_projections` function on `PlaceRef` this makes the api more flexible. the original function now calls the PlaceRef version to avoid duplicating the code.
2022-06-23Rollup merge of #98365 - jyn514:improve-obligation-errors-review-comments, ↵Michael Goulet-1/+15
r=eholk Address review comments from #98259 It got approved so fast I didn't have time to make changes xD r? ``@eholk``
2022-06-22Perform coherence checking per impl.Camille GILLOT-3/+4
2022-06-22Remove (transitive) reliance on sorting by DefId in pretty-printerAaron Hill-11/+10
This moves us a step closer to removing the `PartialOrd/`Ord` impls for `DefId`. See #90317
2022-06-22implement `iter_projections` function on `PlaceRef`Rose Hudson-4/+18
this makes the api more flexible. the original function now calls the PlaceRef version to avoid duplicating the code.
2022-06-22Rollup merge of #97895 - nbdd0121:unlikely, r=estebankYuki Okushi-1/+1
Simplify `likely!` and `unlikely!` macro The corresponding intrinsics have long been safe-to-call, so the unsafe block is no longer needed.
2022-06-22Rollup merge of #97818 - compiler-errors:rpit-error-spanned, r=oli-obkYuki Okushi-0/+3
Point at return expression for RPIT-related error Certainly this needs some diagnostic refining, but I wanted to show that it was possible first and foremost. Not sure if this is the right approach. Open to feedback. Fixes #80583
2022-06-22Fix parallel compiler.Camille GILLOT-0/+17
2022-06-21Point at return expression for RPIT-related errorMichael Goulet-0/+3
2022-06-21Improve suggestion for calling closure on type mismatchMichael Goulet-1/+1