about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2014-07-09 06:11:47 -0700
committerCorey Richardson <corey@octayn.net>2014-08-20 21:02:24 -0400
commit0cffa32c21b08cec443dd2d0388e39cf381b6bfc (patch)
treecbbe7e6ffe78579db0dd1395a8d4e23d596cf235 /src
parentc630d961667e9a1f35ea2c55c2558d8c9705ca44 (diff)
downloadrust-0cffa32c21b08cec443dd2d0388e39cf381b6bfc.tar.gz
rust-0cffa32c21b08cec443dd2d0388e39cf381b6bfc.zip
Add detailed note about Substs to ty_enum
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/ty.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index 83eb84a326a..5f4cc84fb61 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -790,6 +790,13 @@ pub enum sty {
     ty_int(ast::IntTy),
     ty_uint(ast::UintTy),
     ty_float(ast::FloatTy),
+    /// Substs here, possibly against intuition, *may* contain `ty_param`s.
+    /// That is, even after substitution it is possible that there are type
+    /// variables. This happens when the `ty_enum` corresponds to an enum
+    /// definition and not a concerete use of it. To get the correct `ty_enum`
+    /// from the tcx, use the `NodeId` from the `ast::Ty` and look it up in
+    /// the `ast_ty_to_ty_cache`. This is probably true for `ty_struct` as
+    /// well.`
     ty_enum(DefId, Substs),
     ty_box(t),
     ty_uniq(t),