Add TyCtxt
wrappers to sort its methods into groups and improve documentation
#603
Closed
1 of 3 tasks
Labels
major-change
A proposal to make a major change to rustc
T-compiler
Add this label so rfcbot knows to poll the compiler team
Proposal
Current
TyCtxt
documentation is quite hard to navigate, particularly because of the sheer amount of methods. The same goes for autocomplete, etc.I propose to add transparent wrapper(s) around
TyCtxt
in order to improve this situation. Then, instead of.some_method()
you'd write.group().some_method()
. As an example, See rust-lang/rust#109186, which adds a wrapper for "make" methods, such that you write.mk().slice(t)
instead of.mk_slice(t)
:Pros:
Cons:
.group()
mk_foo
is a verb phrase with an obvious meaning, which is good for function names.mk().foo()
is... not that.mk
should really be calledmcx
to follow the existing convention for things liketcx
andicx
, butmcx().foo()
doesn't work."Mentors or Reviewers
@oli-obk
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: