Skip to content

Commit

Permalink
rustfmt: actually fix the failing test
Browse files Browse the repository at this point in the history
It only runs on nightly, but the next commits will show
why this is useful.
  • Loading branch information
K900 committed Apr 6, 2022
1 parent b6966d9 commit 6eb00a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkgs/development/compilers/rust/rustfmt-fix-self-tests.patch
Original file line number Diff line number Diff line change
@@ -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();
3 changes: 3 additions & 0 deletions pkgs/development/compilers/rust/rustfmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 6eb00a4

Please sign in to comment.