]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #17226 : P1start/rustdoc-colour
authorAlex Crichton <alex@alexcrichton.com>
Wed, 17 Sep 2014 15:48:53 +0000 (08:48 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 17 Sep 2014 15:48:53 +0000 (08:48 -0700)
1  2 
src/librustc/middle/resolve.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/mod.rs
src/librustdoc/html/static/main.js

index d4fe3c265f518dd92a69b3f7acbfbba3566d2386,191f7113cc90d05a904053baad03401d136a832c..861ac2ffe60d7b60422dce2c916ba299bd753b58
@@@ -1252,7 -1252,7 +1252,7 @@@ impl<'a> Resolver<'a> 
                                     sp);
  
                  name_bindings.define_type
-                     (DefTy(local_def(item.id)), sp, is_public);
+                     (DefTy(local_def(item.id), false), sp, is_public);
                  parent
              }
  
                                     sp);
  
                  name_bindings.define_type
-                     (DefTy(local_def(item.id)), sp, is_public);
+                     (DefTy(local_def(item.id), true), sp, is_public);
  
                  for variant in (*enum_definition).variants.iter() {
                      self.build_reduced_graph_for_variant(
                  let name_bindings = self.add_child(ident, parent.clone(), forbid, sp);
  
                  // Define a name in the type namespace.
-                 name_bindings.define_type(DefTy(local_def(item.id)), sp, is_public);
+                 name_bindings.define_type(DefTy(local_def(item.id), false), sp, is_public);
  
                  // If this is a newtype or unit-like struct, define a name
                  // in the value namespace as well
  
          match def {
            DefMod(def_id) | DefForeignMod(def_id) | DefStruct(def_id) |
-           DefTy(def_id) => {
+           DefTy(def_id, _) => {
              let type_def = child_name_bindings.type_def.borrow().clone();
              match type_def {
                Some(TypeNsDef { module_def: Some(module_def), .. }) => {
                                                    is_public,
                                                    DUMMY_SP)
            }
-           DefTy(_) => {
+           DefTy(..) => {
                debug!("(building reduced graph for external \
                        crate) building type {}", final_ident);
  
                                      import_span: Span,
                                      name: Name,
                                      namespace: Namespace) {
 -        if self.session.features.import_shadowing.get() {
 +        if self.session.features.borrow().import_shadowing {
              return
          }
  
                                                       &mut ImportResolution,
                                                       import_span: Span,
                                                       name: Name) {
 -        if self.session.features.import_shadowing.get() {
 +        if self.session.features.borrow().import_shadowing {
              return
          }
  
                                                     module: &Module,
                                                     name: Name,
                                                     span: Span) {
 -        if self.session.features.import_shadowing.get() {
 +        if self.session.features.borrow().import_shadowing {
              return
          }
  
                                                               module: &Module,
                                                               name: Name,
                                                               span: Span) {
 -        if self.session.features.import_shadowing.get() {
 +        if self.session.features.borrow().import_shadowing {
              return
          }
  
  
                          // If it's a typedef, give a note
                          match def {
-                             DefTy(_) => {
+                             DefTy(..) => {
                                  self.session.span_note(
                                                  trait_reference.path.span,
                                                  format!("`type` aliases cannot \
                  Some(ref t) => match t.node {
                      TyPath(ref path, None, path_id) => {
                          match this.resolve_path(id, path, TypeNS, true) {
-                             Some((DefTy(def_id), lp)) if this.structs.contains_key(&def_id) => {
+                             Some((DefTy(def_id, _), lp)) if this.structs.contains_key(&def_id) => {
                                  let def = DefStruct(def_id);
                                  debug!("(resolving struct) resolved `{}` to type {:?}",
                                         token::get_ident(path.segments
          if allowed == Everything {
              // Look for a field with the same name in the current self_type.
              match self.def_map.borrow().find(&node_id) {
-                  Some(&DefTy(did))
+                  Some(&DefTy(did, _))
                  | Some(&DefStruct(did))
                  | Some(&DefVariant(_, did, _)) => match self.structs.find(&did) {
                      None => {}
                          // structs, which wouldn't result in this error.)
                          match self.with_no_errors(|this|
                              this.resolve_path(expr.id, path, TypeNS, false)) {
-                             Some((DefTy(struct_id), _))
+                             Some((DefTy(struct_id, _), _))
                                if self.structs.contains_key(&struct_id) => {
                                  self.resolve_error(expr.span,
                                          format!("`{}` is a structure name, but \
index c46e95cf045f5eab247e77a88bc27b2e5431e6b0,a9b633d483b6a72c47178166335d828cce447e12..00678eb6380cae7b4821775e62c99cd584ecb44c
@@@ -235,7 -235,7 +235,7 @@@ fn ast_path_substs<'tcx, AC: AstConv<'t
      }
  
      if supplied_ty_param_count > required_ty_param_count
 -        && !this.tcx().sess.features.default_type_params.get() {
 +        && !this.tcx().sess.features.borrow().default_type_params {
          span_err!(this.tcx().sess, path.span, E0108,
              "default type parameters are experimental and possibly buggy");
          span_note!(this.tcx().sess, path.span,
@@@ -438,7 -438,7 +438,7 @@@ pub fn ast_ty_to_builtin_ty<'tcx, AC: A
              // FIXME(#12938): This is a hack until we have full support for
              // DST.
              match a_def {
-                 def::DefTy(did) | def::DefStruct(did)
+                 def::DefTy(did, _) | def::DefStruct(did)
                          if Some(did) == this.tcx().lang_items.owned_box() => {
                      if path.segments
                             .iter()
                                "not enough type parameters supplied to `Box<T>`");
                      Some(ty::mk_err())
                  }
-                 def::DefTy(did) | def::DefStruct(did)
+                 def::DefTy(did, _) | def::DefStruct(did)
                          if Some(did) == this.tcx().lang_items.gc() => {
                      if path.segments
                             .iter()
@@@ -833,7 -833,7 +833,7 @@@ pub fn ast_ty_to_ty<'tcx, AC: AstConv<'
                                       result.substs.clone(),
                                       bounds)
                      }
-                     def::DefTy(did) | def::DefStruct(did) => {
+                     def::DefTy(did, _) | def::DefStruct(did) => {
                          ast_path_to_ty(this, rscope, did, path).ty
                      }
                      def::DefTyParam(space, id, n) => {
index 12905763f522b442c0bee6350cbf62d43f15c725,3bda07e92070e33fb7eac6e0dfc5f593e7ec5666..0af20cf2bcced305bef8bb90a32a1f37628d2765
@@@ -2131,7 -2131,7 +2131,7 @@@ fn try_overloaded_call(fcx: &FnCtxt
          fcx.inh.method_map.borrow_mut().insert(method_call, method_callee);
          write_call(fcx, call_expression, output_type);
  
 -        if !fcx.tcx().sess.features.overloaded_calls.get() {
 +        if !fcx.tcx().sess.features.borrow().overloaded_calls {
              span_err!(fcx.tcx().sess, call_expression.span, E0056,
                  "overloaded calls are experimental");
              span_note!(fcx.tcx().sess, call_expression.span,
@@@ -4937,7 -4937,7 +4937,7 @@@ pub fn polytype_for_def(fcx: &FnCtxt
          return polytype_for_def(fcx, sp, *inner);
        }
        def::DefTrait(_) |
-       def::DefTy(_) |
+       def::DefTy(..) |
        def::DefPrimTy(_) |
        def::DefTyParam(..)=> {
          fcx.ccx.tcx.sess.span_bug(sp, "expected value, found type");
index ad9557bf2c1445f69fabe3616de355f9049865e4,dc18a08a4f862efdea2da621d3fad98e2baa31fa..6992a9665929586b553d9d851ef7af72a01f0155
          // `rustdoc::html::item_type::ItemType` type in Rust.
          var itemTypes = ["mod",
                           "struct",
-                          "type",
+                          "enum",
                           "fn",
                           "type",
                           "static",
  
          $(".method").each(function() {
             if ($(this).next().is(".docblock")) {
 -               $(this).children().first().after(toggle[0]);
 +               $(this).children().first().after(toggle.clone());
             }
          });