about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-24 19:56:43 +0000
committerbors <bors@rust-lang.org>2023-04-24 19:56:43 +0000
commit15ef5f552374e52ca3b578757880938e354b6cc0 (patch)
tree0bee996e82440681d68b09e10e303d213f112308 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
parent65ac9f4602b87e69bf17298f4cd72dc813d5554b (diff)
parent12ba5cab112a863e63e51d56e0660d999c86b679 (diff)
downloadrust-15ef5f552374e52ca3b578757880938e354b6cc0.tar.gz
rust-15ef5f552374e52ca3b578757880938e354b6cc0.zip
Auto merge of #14641 - lowr:fix/obligation-for-value-path, r=Veykril
Register obligations during path inference

Fixes #14635

When we infer path expressions that resolve to some generic item, we need to consider their generic bounds. For example, when we resolve a path `Into::into` to `fn into<?0, ?1>` (note that `?0` is the self type of trait ref), we should register an obligation `?0: Into<?1>` or else their relationship would be lost.

Relevant part in rustc is [`add_required_obligations_with_code()`] that's called in [`instantiate_value_path()`].

[`instantiate_value_path()`]: https://github.com/rust-lang/rust/blob/3462f79e94f466a56ddaccfcdd3a3d44dd1dda9f/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs#L1052
[`add_required_obligations_with_code()`]: https://github.com/rust-lang/rust/blob/3462f79e94f466a56ddaccfcdd3a3d44dd1dda9f/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs#L1411
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions