On 7/8/13 4:14 AM, Corey Richardson wrote:
Given a rustc::middle::resolve::CrateMap, a syntax::ast_map::map, and
a syntax::ast::Ty, how can I determine what "real" type the given
ast::Ty refers to?

Typechecking uses the functions in `astconv.rs` (particularly `ast_ty_to_ty`) to transform an AST type into a type used for typechecking. I believe it writes the results into the type context, so you can retrieve it with `node_id_to_type` or similar.

For rustdoc purposes you may not need the same notion of a type as typechecking uses. In that case you can just look up the def ID that resolve resolved each `ty_path` to; it should always resolve to a struct, enum, or typedef. Be warned, resolve will not strip out typedefs; that's the job of `astconv`.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to