-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Do not expect infer/bound/placeholder/error in v0 symbol mangling #130485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
// Never cached (single-character). | ||
self.push("p"); | ||
return Ok(()); | ||
} | ||
|
||
ty::Unevaluated(..) => bug!("symbol_names: unexpected unnormalized alias"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be normalized
|
||
ty::Unevaluated(..) => bug!("symbol_names: unexpected unnormalized alias"), | ||
|
||
ty::ConstKind::Expr(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should either be normalized (expr), unconstructable (infer/placeholder), unreachable (bound) or already dealt with (error).
This comment has been minimized.
This comment has been minimized.
omg in the wild |
f4d1fb5
to
87bc2f7
Compare
OK, I clarified when aliases are encountered in v0 symbol mangling. What a mess tbh lol |
@bors r+ rollup |
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#130485 (Do not expect infer/bound/placeholder/error in v0 symbol mangling) - rust-lang#130567 (Register tool docs for compiletest) - rust-lang#130582 (rustdoc: use the correct span for doctests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130485 - compiler-errors:impossible-types, r=BoxyUwU Do not expect infer/bound/placeholder/error in v0 symbol mangling Infer/bound/placeholder/error are not encounterable during codegen. Let's make sure v0 symbol mangling doesn't "accidentally" handle them. As for aliases (namely: projections and uv consts) these may still be encounterable because of the way that we render the def paths of items. Specifically, when we have something like: ``` struct W<T>(T); impl<T> W<T> { fn x() { fn y() {} } } ``` The path of `y` is rendered like `crate_name::W<T>::x::y`. Specifically, since `y` doesn't inherit the generics of the impl, we use the *identity* substitutions for that impl. If the impl has any aliases, they will remain unnormalized if they're rigid. r? `@BoxyUwU`
Infer/bound/placeholder/error are not encounterable during codegen. Let's make sure v0 symbol mangling doesn't "accidentally" handle them.
As for aliases (namely: projections and uv consts) these may still be encounterable because of the way that we render the def paths of items. Specifically, when we have something like:
The path of
y
is rendered likecrate_name::W<T>::x::y
. Specifically, sincey
doesn't inherit the generics of the impl, we use the identity substitutions for that impl. If the impl has any aliases, they will remain unnormalized if they're rigid.r? @BoxyUwU