Skip to content
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

Allow printing lifetime placeholders #557

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chalk-solve/src/display/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ impl<I: Interner> RenderAsRust<I> for LifetimeData<I> {
match self {
LifetimeData::BoundVar(v) => write!(f, "'{}", s.display_bound_var(v)),
LifetimeData::InferenceVar(_) => write!(f, "'_"),
LifetimeData::Placeholder(_) => unreachable!(
"cannot print placeholder variables; these should only be in goals not programs"
),
// Note: placeholders should not occur in programs, but are currently used by
// rust-analyzer, because lifetimes are not implemented yet.
LifetimeData::Placeholder(ix) => write!(f, "_placeholder_{}_{}", ix.ui.counter, ix.idx),
detrumi marked this conversation as resolved.
Show resolved Hide resolved
// Matching the void ensures at compile time that this code is
// unreachable
LifetimeData::Phantom(void, _) => match *void {},
Expand Down