Skip to content

Conversation

@bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Oct 27, 2020

close #6191

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@flodiebold
Copy link
Member

Hm. That actually is the opposite from what I expected -- we want to use valid syntax when printing to source code, i.e. not use the placeholder syntax; on the other hand, the hir_ty tests should be unaffected by this fix because we want to represent the types accurately there. The problem is probably that inlay hints don't actually use DisplayTarget::SourceCode, of course. We may need a third DisplayTarget for use in the hir_ty tests, and then we'd use the placeholder syntax only in that one 🤔

@bnjjj
Copy link
Contributor Author

bnjjj commented Oct 27, 2020

Oops I'm sorry I misunderstood. I will update to fit with your needs ASAP

@flodiebold
Copy link
Member

No worries, I missed that inlay hints don't actually use DisplayTarget::SourceCode...

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
383..388 'inner': Map<|&f64| -> f64>
401..404 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
407..416 'from_iter': fn from_iter<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>, Repeat<Map<|&f64| -> f64>>>(Repeat<Map<|&f64| -> f64>>) -> Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
407..416 'from_iter': fn from_iter<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>, Repeat<Map<|&f64| -> f64>>>(Repeat<Map<|&f64| -> f64>>) -> Vec<<Repeat<Map<|&f64| -> f64>> as IntoIterator>::Item>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is surprising. are we still calling display somewhere in check_infer?

let y: <RefMutL<T> as ApplyL>::Out = no_matter;
y;
} //^ ApplyL::Out<T>
} //^ <T as ApplyL>::Out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Copy link
Member

@flodiebold flodiebold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bors r+

ret.display_truncated(f.db, f.max_size)
} else {
ret.display(f.db)
if f.display_target.is_test() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, these seem like they were already bugs. We should be reusing the whole HirFormatter. Anyway, we can look into that separately.

@bors
Copy link
Contributor

bors bot commented Oct 28, 2020

@bors bors bot merged commit e341832 into rust-lang:master Oct 28, 2020
bors bot added a commit that referenced this pull request Oct 28, 2020
6396: refactor(hir_ty): do not override DisplayTarget in hir_fmt r=flodiebold a=bnjjj

Linked to bug discovery from #6387

The main goal is to not use `display()` method inside `hir_fmt` to not override any parameters (like `DisplayTarget`). 
cc @flodiebold 

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Associated type incorrectly annotated with generic syntax

3 participants