summary refs log tree commit diff
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2022-04-06 11:03:07 +0300
committerK900 <me@0upti.me>2022-04-06 13:03:23 +0300
commit6eb00a41a0850e10e6a12021332a147dd97578a5 (patch)
tree8333d9ea16452c488dd3819dbdee9fee42e4353b
parentb6966d911da89e5a7301aaef8b4f0a44c77e103c (diff)
downloadnixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.tar
nixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.tar.gz
nixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.tar.bz2
nixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.tar.lz
nixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.tar.xz
nixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.tar.zst
nixpkgs-6eb00a41a0850e10e6a12021332a147dd97578a5.zip
rustfmt: actually fix the failing test
It only runs on nightly, but the next commits will show
why this is useful.
-rw-r--r--pkgs/development/compilers/rust/rustfmt-fix-self-tests.patch13
-rw-r--r--pkgs/development/compilers/rust/rustfmt.nix3
2 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/development/compilers/rust/rustfmt-fix-self-tests.patch b/pkgs/development/compilers/rust/rustfmt-fix-self-tests.patch
new file mode 100644
index 00000000000..b60332daef4
--- /dev/null
+++ b/pkgs/development/compilers/rust/rustfmt-fix-self-tests.patch
@@ -0,0 +1,13 @@
+--- a/src/tools/rustfmt/src/ignore_path.rs
++++ b/src/tools/rustfmt/src/ignore_path.rs
+@@ -37,9 +37,9 @@
+     #[nightly_only_test]
+     #[test]
+     fn test_ignore_path_set() {
+-        use std::path::{Path, PathBuf};
+         use crate::config::{Config, FileName};
+         use crate::ignore_path::IgnorePathSet;
++        use std::path::{Path, PathBuf};
+ 
+         let config =
+             Config::from_toml(r#"ignore = ["foo.rs", "bar_dir/*"]"#, Path::new("")).unwrap();
diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix
index f8ac8bf39df..9922d60ef70 100644
--- a/pkgs/development/compilers/rust/rustfmt.nix
+++ b/pkgs/development/compilers/rust/rustfmt.nix
@@ -21,6 +21,9 @@ rustPlatform.buildRustPackage rec {
   CFG_RELEASE = rustPlatform.rust.rustc.version;
   CFG_RELEASE_CHANNEL = "stable";
 
+  # FIXME: seems fixed upstream, remove after the next update
+  patches = [ ./rustfmt-fix-self-tests.patch ];
+
   meta = with lib; {
     description = "A tool for formatting Rust code according to style guidelines";
     homepage = "https://github.com/rust-lang-nursery/rustfmt";