Skip to content

Various functions taking a TyCtxt and a Span should be taking a TyCtxtAt #48425

Closed
@oli-obk

Description

@oli-obk

One example is the is_sized method on Ty. Internally it creates a tcx.at(span), when it could simply be taking exactly that TyCtxtAt as an argument. In miri I had to write ty.is_sized(tcx.tcx, param_env, tcx.span) which just feels a little riddiculous (taking apart the TyCtxtAt, just to have the method construct it back).

There's probably many other similar methods and functions that should be taking a TyCtxtAt

Metadata

Metadata

Assignees

Labels

E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions