about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-09-25 13:04:00 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-09-25 13:04:00 -0500
commit78013f296acd79af84dede7dae1580fd36480c7c (patch)
tree3bc0d7fb7debb15d7f534f03a92e98f67f0f12dc /compiler/rustc_codegen_llvm/src
parent63cc2bb3d07d6c726dfcdc5f95cbe5ed4760641a (diff)
downloadrust-78013f296acd79af84dede7dae1580fd36480c7c.tar.gz
rust-78013f296acd79af84dede7dae1580fd36480c7c.zip
Don't anonymize bound region names during typeck
Once this anonymization has performed, we have no
way of recovering the original names during NLL
borrow checking. Keeping the original names allows
error messages in full NLL mode to contain the original
bound region names.

As a result, the typeck results may contain types that
differ only in the names used for their bound regions. However,
anonimization of bound regions does not guarantee that
all distinct types are unqual (e.g. not subtypes of each other).
For example, `for<'a> fn(&'a u32, &'a u32)` and
`for<'b, 'c> fn(&'b u32, &'c u32)` are subtypes of each other,
as explained here:

https://github.com/rust-lang/rust/blob/63cc2bb3d07d6c726dfcdc5f95cbe5ed4760641a/compiler/rustc_infer/src/infer/nll_relate/mod.rs#L682-L690

Therefore, any code handling types with higher-ranked regions already
needs to handle the case where two distinct `Ty`s are 'actually'
equal.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions