-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustdoc search: find types containing some other type #130204
Comments
We could update |
it could probably use similar logic, but maybe we should have a different prefix, like |
Personally, I would just treat (visible) fields as functions with one parameter and one return value. It's how fields work in Hoogle, and for good reason, since the "I have a TyCtxt and want an hir::Map" is a use case that hardly cares if it goes through a method, a free function, or a struct field. |
well, in haskell, field accessors are free functions. but yeah that's probably a good idea. |
if we're treating fields as unary functions, we should probably also treat constants and statics as nullary functions. |
…-func, r=notriddle Treat other items as functions for the purpose of type-based search specifically, constants and statics are nullary functions, and struct fields are unary functions. fixes rust-lang#130204 r? `@notriddle`
…-func, r=notriddle Treat other items as functions for the purpose of type-based search specifically, constants and statics are nullary functions, and struct fields are unary functions. fixes rust-lang#130204 r? `@notriddle`
Rollup merge of rust-lang#131806 - lolbinarycat:rustdoc-search-all-is-func, r=notriddle Treat other items as functions for the purpose of type-based search specifically, constants and statics are nullary functions, and struct fields are unary functions. fixes rust-lang#130204 r? ``@notriddle``
when searching through crates with many complicated and nested types, it is often useful to know how you can get an instance of some type. this is partially covered by the
-> SomeType
syntax, but in codebases where you are expected to directly access fields instead of using getter methods, this is insufficient.there should be a syntax to search for all types that use a given type in a field (not necessarily a struct, it could also be a union or enum).
tangentially related: #118912
The text was updated successfully, but these errors were encountered: