summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
AgeCommit message (Collapse)AuthorLines
2022-08-15Revert let_chains stabilizationNilstrieb-1/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. It was discovered that they are not implemented correctly, which does not make them ready for stabilization.
2022-08-04Rollup merge of #100095 - jackh726:early-binder, r=lcnrMatthias Krüger-16/+16
More EarlyBinder cleanups Each commit is independent r? types
2022-08-04Rollup merge of #100093 - wcampbell0x2a:unused-parens-for-match-arms, ↵Matthias Krüger-1/+1
r=petrochenkov Enable unused_parens for match arms Fixes: https://github.com/rust-lang/rust/issues/92751 Currently I can't get the `stderr` to work with `./x.py test`, but this should fix the issue. Help would be appreciated!
2022-08-04Enable unused_parens for match armswcampbell-1/+1
2022-08-04Auto merge of #100120 - matthiaskrgr:rollup-g6ycykq, r=matthiaskrgrbors-0/+45
Rollup of 6 pull requests Successful merges: - #98771 (Add support for link-flavor rust-lld for iOS, tvOS and watchOS) - #98835 (relate `closure_substs.parent_substs()` to parent fn in NLL) - #99746 (Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`) - #99786 (Recover from C++ style `enum struct`) - #99795 (Delay a bug when failed to normalize trait ref during specialization) - #100029 (Prevent ICE for `doc_alias` on match arm, statement, expression) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-03fix trailing whitespace in error messageklensy-1/+1
2022-08-03cosmetic changesAli MJ Al-Nasrawy-5/+11
2022-08-02Add bound_predicates_of and bound_explicit_predicates_ofJack Huey-16/+16
2022-08-02NLL: relate closure to parent fnAli MJ Al-Nasrawy-0/+39
2022-07-31Improve `cannot move out of` error messageObei Sideg-32/+100
2022-07-31Rollup merge of #99186 - camsteffen:closure-localdefid, r=cjgillotDylan DPC-44/+36
Use LocalDefId for closures more
2022-07-30Use LocalDefId for closures moreCameron Steffen-44/+36
2022-07-29Change enclosing_body_owner to return LocalDefIdMiguel Guarniz-2/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-2/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Auto merge of #99667 - ouz-a:some_branch, r=oli-obkbors-1/+1
Optimize `UnDerefer` Addresses the performance [issues](https://github.com/rust-lang/rust/pull/98145#issuecomment-1183548597) faced here. r? `@oli-obk`
2022-07-27Auto merge of #99725 - lcnr:dedup-region_bound_pairs, r=compiler-errorsbors-15/+16
use `FxIndexSet` for `region_bound_pairs` should help with #99217 and might generally be a perf improvement. r? types
2022-07-27Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkovGuillaume Gomez-2/+1
Clean up HIR-based lifetime resolution Based on https://github.com/rust-lang/rust/pull/97313. Fixes #98932. r? `@petrochenkov`
2022-07-27Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obkYuki Okushi-21/+0
Check that RPITs constrained by a recursive call in a closure are compatible Fixes #99073 Adapts a similar visitor pattern to `find_opaque_ty_constraints` (that we use to check TAITs), but with some changes: 0. Only walk the "OnlyBody" children, instead of all items in the RPIT's defining scope 1. Only walk through the body's children if we found a constraining usage 2. Don't actually do any inference, just do a comparison and error if they're mismatched ---- r? `@oli-obk` -- you know all this impl-trait stuff best... is this the right approach? I can explain the underlying issue better if you'd like, in case that might reveal a better solution. Not sure if it's possible to gather up the closure's defining usages of the RPIT while borrowck'ing the outer function, that might be a better place to put this check...
2022-07-26Replace LifetimeRes::Anonymous by LifetimeRes::Infer.Camille GILLOT-1/+1
2022-07-26Remove the distinction between LifetimeName::Implicit and ↵Camille GILLOT-1/+0
LifetimeName::Underscore.
2022-07-26Rollup merge of #99748 - compiler-errors:better-impl-trait-printing, r=fee1-deadDylan DPC-7/+16
Use full type name instead of just saying `impl Trait` in "captures lifetime" error I think this is very useful, especially when there's >1 `impl Trait`, and it just means passing around a bit more info that we already have access to.
2022-07-26Revert "Do not allow typeck children items to constrain outer RPITs"Michael Goulet-29/+0
This reverts commit e8d9f38141a0ee8ac5484783e1fb5c218f9d2eee.
2022-07-26Revert "use opaque_ty_origin_unchecked instead of destructuring HIR"Michael Goulet-4/+12
This reverts commit 5a4601fea56502e4f50df046c4205e678397599b.
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-7/+16
2022-07-25use `FxIndexSet` for `region_bound_pairs`lcnr-15/+16
2022-07-25avoid `&str`/`Symbol` to `String` conversionsTakayuki Maeda-5/+3
2022-07-24optimize un_dereferouz-a-1/+1
2022-07-20Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisabors-1/+1
Remove the unused StableSet and StableMap types from rustc_data_structures. The current implementation is not "stable" in the same sense that `HashStable` and `StableHasher` are stable, i.e. across compilation sessions. So, in my opinion, it's better to remove those types (which are basically unused anyway) than to give the wrong impression that these are safe for incr. comp. I plan to provide new "stable" collection types soon that can be used to replace `FxHashMap` and `FxHashSet` in query results (see [draft](https://github.com/michaelwoerister/rust/commit/69d03ac7a7d651a397ab793e9d78f8fce3edf7a6)). It's unsound that `HashMap` and `HashSet` implement `HashStable` (see https://github.com/rust-lang/rust/issues/98890 for a recent P-critical bug caused by this) -- so we should make some progress there.
2022-07-20Auto merge of #99506 - Dylan-DPC:rollup-q3msucx, r=Dylan-DPCbors-56/+86
Rollup of 7 pull requests Successful merges: - #98101 (stdlib support for Apple WatchOS) - #99345 (Do not allow typeck children items to constrain outer RPITs) - #99383 (Formalize defining_use_anchor) - #99436 (Add flag to configure `noalias` on `Box<T>`) - #99483 (Fix a numerical underflow in tuple wrap suggestion) - #99485 (Stop injecting `#[allow(unused_qualifications)]` in generated `derive` implementations) - #99486 (Refactor: remove a string comparison between types in `check_str_addition`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-1/+1
2022-07-20Rollup merge of #99383 - ouz-a:issue_57961, r=oli-obkDylan DPC-56/+65
Formalize defining_use_anchor This tackles issue #57961 Introduces new enum called `DefiningAnchor` that replaces `Option<LocalDefId>` of `defining_use_anchor`. Now every use of it is explicit and exhaustively matched, catching errors like one in the linked issue. This is not a perfect fix but it's a step in the right direction. r? `@oli-obk`
2022-07-20use def_idouz-a-1/+1
2022-07-20take opaq typesouz-a-56/+65
2022-07-20Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"Oli Scherer-38/+2
This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.
2022-07-19use opaque_ty_origin_unchecked instead of destructuring HIRMichael Goulet-12/+4
2022-07-19Do not allow typeck children items to constrain outer RPITsMichael Goulet-0/+29
2022-07-19Use LocalDefId in OpaqueTypeKeyMichael Goulet-11/+11
2022-07-18Auto merge of #99181 - lcnr:arenaGTrc, r=wesleywiserbors-4/+4
`arena > Rc` for query results The `Rc`s have to live for the whole duration as their count cannot go below 1 while stored as part of the query results. By storing them in an arena we should save a bit of memory because we don't have as many independent allocations and also don't have to clone the `Rc` anymore.
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-16Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, ↵Matthias Krüger-20/+15
r=compiler-errors Avoid some `Symbol` to `String` conversions This patch removes some Symbol to String conversions.
2022-07-16Rollup merge of #99258 - estebank:suggest-let, r=wesleywiserMatthias Krüger-2/+65
Provide structured suggestion for dropped temp value
2022-07-16Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebankMatthias Krüger-2/+38
Allow destructuring opaque types in their defining scopes fixes #96572 Before this PR, the following code snippet failed with an incomprehensible error, and similar code just ICEd in mir borrowck. ```rust type T = impl Copy; let foo: T = (1u32, 2u32); let (a, b) = foo; ``` The problem was that the last line created MIR projections of the form `foo.0` and `foo.1`, but `foo`'s type is `T`, which doesn't have fields (only its hidden type does). But the pattern supplies enough type information (a tuple of two different inference types) to bind a hidden type.
2022-07-17avoid some `Symbol` to `String` conversionsTakayuki Maeda-20/+15
2022-07-15Fix rebaseEsteban Küber-5/+3
2022-07-15Avoid incorrect suggestionEsteban Küber-3/+37
We check that there's a single level of block nesting to ensure always correct suggestions. If we don't, then we only provide a free-form message to avoid misleading users in cases like `src/test/ui/nll/borrowed-temporary-error.rs`. We could expand the analysis to suggest hoising all of the relevant parts of the users' code to make the code compile, but that could be too much.
2022-07-15Provide structured suggestion for dropped temp valueEsteban Küber-1/+32
2022-07-15Make destructuring a defining useOli Scherer-0/+8
2022-07-15Introduce opaque type to hidden type projectionOli Scherer-2/+30
2022-07-15provide `generic_param_scope` for region errorslcnr-1/+1
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-9/+9
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