]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc/mir/mono.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc / mir / mono.rs
index 58f99667cb3a417d6dd7606d787600b83c371a81..34daf185b29527e182d47ee790835f1ead8ec6e3 100644 (file)
@@ -251,7 +251,7 @@ pub struct CodegenUnit<'tcx> {
     size_estimate: Option<usize>,
 }
 
-#[derive(Copy, Clone, PartialEq, Debug, RustcEncodable, RustcDecodable)]
+#[derive(Copy, Clone, PartialEq, Debug, RustcEncodable, RustcDecodable, HashStable)]
 pub enum Linkage {
     External,
     AvailableExternally,
@@ -266,33 +266,13 @@ pub enum Linkage {
     Common,
 }
 
-impl_stable_hash_for!(enum self::Linkage {
-    External,
-    AvailableExternally,
-    LinkOnceAny,
-    LinkOnceODR,
-    WeakAny,
-    WeakODR,
-    Appending,
-    Internal,
-    Private,
-    ExternalWeak,
-    Common
-});
-
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, PartialEq, Debug, HashStable)]
 pub enum Visibility {
     Default,
     Hidden,
     Protected,
 }
 
-impl_stable_hash_for!(enum self::Visibility {
-    Default,
-    Hidden,
-    Protected
-});
-
 impl<'tcx> CodegenUnit<'tcx> {
     pub fn new(name: Symbol) -> CodegenUnit<'tcx> {
         CodegenUnit {
@@ -486,7 +466,7 @@ impl CodegenUnitNameBuilder<'tcx> {
         if self.tcx.sess.opts.debugging_opts.human_readable_cgu_names {
             cgu_name
         } else {
-            let cgu_name = &cgu_name.as_str()[..];
+            let cgu_name = &cgu_name.as_str();
             Symbol::intern(&CodegenUnit::mangle_name(cgu_name))
         }
     }