about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src
AgeCommit message (Collapse)AuthorLines
2022-08-01Rollup merge of #99911 - cjgillot:no-guess, r=davidtwcoMatthias Krüger-8/+3
Remove some uses of `guess_head_span` That function cuts a span at the first occurrence of `{`. Using `def_span` is almost always more precise.
2022-07-31provide a clearer explanation of scope breakingDing Xiang Fei-1/+3
2022-07-31Rollup merge of #99186 - camsteffen:closure-localdefid, r=cjgillotDylan DPC-14/+10
Use LocalDefId for closures more
2022-07-30Use LocalDefId for closures moreCameron Steffen-14/+10
2022-07-31break out to one scope higher for let-elseDing Xiang Fei-2/+17
2022-07-30Rollup merge of #99311 - kckeiks:clean-up-body-owner-methods, r=cjgillotDylan DPC-3/+3
change maybe_body_owned_by to take local def id Issue https://github.com/rust-lang/rust/issues/96341 r? `@cjgillot`
2022-07-30Rollup merge of #99518 - dingxiangfei2009:let-else-additional-tests, r=oli-obkYuki Okushi-42/+49
Let-else: break out scopes when a let-else pattern fails to match This PR will commit to a new behavior so that values from initializer expressions are dropped earlier when a let-else pattern fails to match. Fix #98672. Close #93951. cc `@camsteffen` `@est31`
2022-07-29Change enclosing_body_owner to return LocalDefIdMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Rename local_did to def_idMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-2/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Use DefKind instead of FnKind for recursion lint.Camille GILLOT-7/+2
2022-07-28Remove guess_head_span.Camille GILLOT-1/+1
2022-07-28Pass PatCtxt instead of passing MatchCtxt + Ty separatelyOli Scherer-25/+22
2022-07-28Don't pass (the rather large) `PatCtxt` by valueOli Scherer-17/+17
2022-07-28Move constructor into the branch that actually uses itOli Scherer-5/+5
2022-07-27Rollup merge of #99651 - compiler-errors:fn-and-raw-ptr-in-const-generics, ↵Guillaume Gomez-31/+29
r=oli-obk Deeply deny fn and raw ptrs in const generics I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter. We now reject both of these in the same way: ``` #![feature(adt_const_params)] #[derive(Eq, PartialEq)] struct Wrapper(); fn foo<const W: Wrapper>() {} fn foo2<const F: fn()>() {} ``` This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place. cc: ``@b-naber`` who introduced that test^ fixes #99641
2022-07-25avoid `&str`/`Symbol` to `String` conversionsTakayuki Maeda-1/+1
2022-07-25Remove non-descriptive boolean from search_for_structural_match_violationMichael Goulet-31/+29
2022-07-25Get rid of redundant NonStructuralMatchTyKindMichael Goulet-17/+11
2022-07-25Deeply deny fn and raw ptrs in const genericsMichael Goulet-1/+7
2022-07-21break out scopes when let-else fails to matchDing Xiang Fei-42/+49
2022-07-20Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"Oli Scherer-162/+175
This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.
2022-07-17use body's param-env when checking if type needs dropMichael Goulet-2/+2
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-15Infer wildcard type from other patterns at every pattern levelOli Scherer-26/+31
2022-07-15Move constructor into the branch that actually uses itOli Scherer-5/+5
2022-07-15Revert a hack that only ever worked on level deepOli Scherer-5/+1
2022-07-15Allow destructuring opaque types, since the patterns constrain the opaque typesOli Scherer-7/+38
2022-07-15Some tracing helpersOli Scherer-0/+3
2022-07-15Reuse a helper method instead of manually rolling itOli Scherer-3/+1
2022-07-15Remove early return that would likely have caused miscompilations if it ever ↵Oli Scherer-13/+3
happened
2022-07-15Pass one argument instead of fetching two fields of it at every call siteOli Scherer-100/+60
2022-07-15Add some tracing instrumentationOli Scherer-27/+29
2022-07-15Introduce opaque type to hidden type projectionOli Scherer-0/+2
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-3/+4
Rollup of 5 pull requests Successful merges: - #97720 (Always create elided lifetime parameters for functions) - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`) - #98705 (Implement `for<>` lifetime binder for closures) - #99126 (remove allow(rustc::potential_query_instability) in rustc_span) - #99139 (Give a better error when `x dist` fails for an optional tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-3/+4
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-14Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiserbors-1/+1
Rename `debugging_opts` to `unstable_opts` This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options r? `@Amanieu` cc `@nikic` `@joshtriplett`
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13assigning to a union field can never drop nowRalf Jung-17/+3
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-3/+4
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-11add tests for async awaitDing Xiang Fei-2/+2
2022-07-11move else block into the `Local` structDing Xiang Fei-7/+8
2022-07-11lower let-else in MIR insteadDing Xiang Fei-25/+116
2022-07-11Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-deadDylan DPC-1/+1
Implement `SourceMap::is_span_accessible` This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.
2022-07-11rename a methodTakayuki Maeda-1/+1
2022-07-11implement `is_accessible_span`Takayuki Maeda-1/+1
2022-07-11Deny floats even when adt_const_params is enabledMichael Goulet-26/+31
2022-07-10Determine match_has_guard from candidates instead of looking up thir table againAudun Halland-1/+1
2022-07-09tweak names and output and blessRalf Jung-1/+1
2022-07-09review feedbackRalf Jung-3/+3