Add enum variants to the type namespace

Change to resolve and update compiler and libs for uses.

[breaking-change]

Enum variants are now in both the value and type namespaces. This means that
if you have a variant with the same name as a type in scope in a module, you
will get a name clash and thus an error. The solution is to either rename the
type or the variant.
This commit is contained in:
Nick Cameron
2014-09-11 17:07:49 +12:00
parent af3889f697
commit ce0907e46e
72 changed files with 489 additions and 457 deletions

View File

@@ -177,7 +177,7 @@ pub struct Cache {
pub extern_locations: HashMap<ast::CrateNum, ExternalLocation>,
/// Cache of where documentation for primitives can be found.
pub primitive_locations: HashMap<clean::Primitive, ast::CrateNum>,
pub primitive_locations: HashMap<clean::PrimitiveType, ast::CrateNum>,
/// Set of definitions which have been inlined from external crates.
pub inlined: HashSet<ast::DefId>,
@@ -1637,7 +1637,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
_ => false,
}
})
.collect::<Vec<&clean::TraitItem>>();
.collect::<Vec<&clean::TraitMethod>>();
let provided = t.items.iter()
.filter(|m| {
match **m {
@@ -1645,7 +1645,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
_ => false,
}
})
.collect::<Vec<&clean::TraitItem>>();
.collect::<Vec<&clean::TraitMethod>>();
if t.items.len() == 0 {
try!(write!(w, "{{ }}"));
@@ -1671,7 +1671,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
// Trait documentation
try!(document(w, it));
fn trait_item(w: &mut fmt::Formatter, m: &clean::TraitItem)
fn trait_item(w: &mut fmt::Formatter, m: &clean::TraitMethod)
-> fmt::Result {
try!(write!(w, "<h3 id='{}.{}' class='method'>{}<code>",
shortty(m.item()),
@@ -2180,7 +2180,7 @@ fn item_macro(w: &mut fmt::Formatter, it: &clean::Item,
fn item_primitive(w: &mut fmt::Formatter,
it: &clean::Item,
_p: &clean::Primitive) -> fmt::Result {
_p: &clean::PrimitiveType) -> fmt::Result {
try!(document(w, it));
render_methods(w, it)
}