about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-19 21:03:12 +0000
committerbors <bors@rust-lang.org>2018-08-19 21:03:12 +0000
commitf28f648a9699db67b86735f97d609c3dd06f9ded (patch)
treea561c965a0e6d3303a21517e51979892b2067b0b /src/libstd
parent3ac79c718475fd29b8be34dde667b683390c2aee (diff)
parent8895e3bcb091fb94ae49a199358da4951a5665c6 (diff)
downloadrust-f28f648a9699db67b86735f97d609c3dd06f9ded.tar.gz
rust-f28f648a9699db67b86735f97d609c3dd06f9ded.zip
Auto merge of #53316 - tristanburgess:52895_existential_type_ICE, r=oli-obk
52985: cause cycle err on inf trait normalization

Issue: #52985
 - If an existential type is defined, but no user code infers the
concrete type behind the existential type, normalization would
infinitely recurse on this existential type which is only defined in
terms of itself.
  - Instead of raising an inf recurse error, we cause a cycle error to
help highlight that the issue is that the type is only defined in terms
of itself.
  - Three known potential improvements:
    - If type folding itself was exposed as a query, used by
normalization and other mechanisms, cases that would cause infinite recursion would
automatically cause a cycle error.
    - The span for the cycle error should be improved to point to user
code that fails to allow inference of the concrete type of the existential type,
assuming that this error occurs because no user code can allow inference the
concrete type.
    - A mechanism to extend the cycle error with a helpful note would be nice. Currently,
the error is built and maintained by src/librustc/ty/query/plumbing,
with no known way to extend the information that the error gets built
with.

r? @oli-obk
Diffstat (limited to 'src/libstd')
0 files changed, 0 insertions, 0 deletions