From 7f00b33261d65849027245115d19954ea3e67c5b Mon Sep 17 00:00:00 2001
From: Alyssa Ross <hi@alyssa.is>
Date: Fri, 13 Mar 2020 21:20:37 +0000
Subject: [PATCH] rust_1_38, rust_1_42: drop patch version from attr

I find it extremely unlikely we'll ever package two different patch
versions of the same minor Rust version.  New patch versions should
generally be compatible, so we shouldn't give people the expectation
they'll be able to pin to one.  And by including the patch version in
the attribute name, we'd have to change the attribute every time a
patch version was released, which would unnecessarily create diff
noise and maintenance headaches for what should be a seamless upgrade.
---
 .../compilers/rust/{1_38_0.nix => 1_38.nix}      |  2 +-
 .../compilers/rust/{1_42_0.nix => 1_42.nix}      |  2 +-
 pkgs/top-level/aliases.nix                       |  2 ++
 pkgs/top-level/all-packages.nix                  | 16 ++++++++--------
 4 files changed, 12 insertions(+), 10 deletions(-)
 rename pkgs/development/compilers/rust/{1_38_0.nix => 1_38.nix} (95%)
 rename pkgs/development/compilers/rust/{1_42_0.nix => 1_42.nix} (97%)

diff --git a/pkgs/development/compilers/rust/1_38_0.nix b/pkgs/development/compilers/rust/1_38.nix
similarity index 95%
rename from pkgs/development/compilers/rust/1_38_0.nix
rename to pkgs/development/compilers/rust/1_38.nix
index 13d2139bffd..1521c961859 100644
--- a/pkgs/development/compilers/rust/1_38_0.nix
+++ b/pkgs/development/compilers/rust/1_38.nix
@@ -18,5 +18,5 @@ import ./default.nix {
     x86_64-apple-darwin = "b2310c97ffb964f253c4088c8d29865f876a49da2a45305493af5b5c7a3ca73d";
   };
 
-  selectRustPackage = pkgs: pkgs.rust_1_38_0;
+  selectRustPackage = pkgs: pkgs.rust_1_38;
 }
diff --git a/pkgs/development/compilers/rust/1_42_0.nix b/pkgs/development/compilers/rust/1_42.nix
similarity index 97%
rename from pkgs/development/compilers/rust/1_42_0.nix
rename to pkgs/development/compilers/rust/1_42.nix
index e18d89af6a1..8717aaf76a2 100644
--- a/pkgs/development/compilers/rust/1_42_0.nix
+++ b/pkgs/development/compilers/rust/1_42.nix
@@ -34,7 +34,7 @@ import ./default.nix {
     x86_64-apple-darwin = "b6504003ab70b11f278e0243a43ba9d6bf75e8ad6819b4058a2b6e3991cc8d7a";
   };
 
-  selectRustPackage = pkgs: pkgs.rust_1_42_0;
+  selectRustPackage = pkgs: pkgs.rust_1_42;
 
   rustcPatches = [
     ./0001-Allow-getting-no_std-from-the-config-file.patch
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 3a504f20d94..19bf75f20a0 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -385,6 +385,8 @@ mapAliases ({
   ruby_2_5_0 = throw "deprecated 2018-0213: use a newer version of ruby";
   rubyPackages_2_4 = throw "deprecated 2019-12: use a newer version of rubyPackages instead";
   rubygems = throw "deprecated 2016-03-02: rubygems is now bundled with ruby";
+  rust_1_38_0 = rust_1_38; # added 2020-03-13
+  rust_1_42_0 = rust_1_42; # added 2020-03-13
   rxvt_unicode-with-plugins = rxvt-unicode; # added 2020-02-02
   rxvt_unicode = rxvt-unicode-unwrapped; # added 2020-02-02
   urxvt_autocomplete_all_the_things = rxvt-unicode-plugins.autocomplete-all-the-things; # added 2020-02-02
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0606606a426..fbe7f665e2d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8825,17 +8825,17 @@ in
     inherit (darwin) apple_sdk;
   };
 
-  rust_1_42_0 = callPackage ../development/compilers/rust/1_42_0.nix {
+  rust_1_42 = callPackage ../development/compilers/rust/1_42.nix {
     inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
   };
-  rust_1_38_0 = callPackage ../development/compilers/rust/1_38_0.nix {
+  rust_1_38 = callPackage ../development/compilers/rust/1_38.nix {
     inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
   };
-  rust = rust_1_42_0;
+  rust = rust_1_42;
 
-  rustPackages_1_42_0 = rust_1_42_0.packages.stable;
-  rustPackages_1_38_0 = rust_1_38_0.packages.stable;
-  rustPackages = rustPackages_1_42_0;
+  rustPackages_1_42 = rust_1_42.packages.stable;
+  rustPackages_1_38 = rust_1_38.packages.stable;
+  rustPackages = rustPackages_1_42;
 
   inherit (rustPackages) cargo clippy rustc rustPlatform;
   inherit (rust) makeRustPlatform;
@@ -8918,7 +8918,7 @@ in
     inherit (darwin.apple_sdk.frameworks) Security;
   };
   rustracerd = callPackage ../development/tools/rust/racerd {
-    inherit (rustPackages_1_38_0) rustPlatform;
+    inherit (rustPackages_1_38) rustPlatform;
     inherit (darwin.apple_sdk.frameworks) Security;
   };
   rust-bindgen = callPackage ../development/tools/rust/bindgen { };
@@ -21905,7 +21905,7 @@ in
 
   thunderbird = callPackage ../applications/networking/mailreaders/thunderbird {
     inherit (gnome2) libIDL;
-    inherit (rustPackages_1_38_0) cargo rustc;
+    inherit (rustPackages_1_38) cargo rustc;
     libpng = libpng_apng;
     gtk3Support = true;
   };