about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/std_example.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-13 12:19:22 +0200
committerGitHub <noreply@github.com>2023-07-13 12:19:22 +0200
commit893a5d2b32ff353fedb0d94aba850850990a0392 (patch)
treebb4df28af5d27b843b5bc4e6be8352ff107d3f28 /compiler/rustc_codegen_gcc/example/std_example.rs
parent33a2c2487ac5d9927830ea4c1844335c6b9f77db (diff)
parenta0710445626a299189a1b6a016b51f7f5cf6dd8f (diff)
downloadrust-893a5d2b32ff353fedb0d94aba850850990a0392.tar.gz
rust-893a5d2b32ff353fedb0d94aba850850990a0392.zip
Rollup merge of #113353 - compiler-errors:select-better, r=lcnr
Implement selection for `Unsize` for better coercion behavior

In order for much of coercion to succeed, we need to be able to deal with partial ambiguity of `Unsize` traits during selection. However, I pessimistically implemented selection in the new trait solver to just bail out with ambiguity if it was a built-in impl:
https://github.com/rust-lang/rust/blob/9227ff28aff55b252314076fcf21c9a66f10ac1e/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs#L126

This implements a proper "rematch" procedure for dealing with built-in `Unsize` goals, so that even if the goal is ambiguous, we are able to get nested obligations which are used in the coercion selection-like loop:
https://github.com/rust-lang/rust/blob/9227ff28aff55b252314076fcf21c9a66f10ac1e/compiler/rustc_hir_typeck/src/coercion.rs#L702

Second commit just moves a `resolve_vars_if_possible` call to fix a bug where we weren't detecting a trait upcasting to occur.

r? ``@lcnr``
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions