Skip to content

Commit

Permalink
flake: remove redundant transitive dependencies (tweag#1986)
Browse files Browse the repository at this point in the history
* flake: remove redundant transitive dependencies

- add several more `follows` relationships for de-duplication

- update to latest rust-overlay flake which drops flake-utils dependency

- set `follows = ""` for a few unused dependencies.
    See NixOS/nix#7807

* delete `follows = ""` hacks

* delete one more `follows = ""` hack

* Fix new clippy 1.79 errors

---------

Co-authored-by: Yann Hamdaoui <[email protected]>
  • Loading branch information
jeremyschlatter and yannham authored Jul 4, 2024
1 parent 935519f commit 6b1fe61
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 229 deletions.
2 changes: 1 addition & 1 deletion core/src/error/suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ where
S: AsRef<str>,
I: AsRef<str>,
{
let mut max = std::f64::MIN;
let mut max = f64::MIN;
let mut arg_max: Option<&'syms str> = None;

if symbols.is_empty() {
Expand Down
4 changes: 3 additions & 1 deletion core/src/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ mod interner {
// deallocation, so references are valid until the arena drop, which is tied to the
// struct drop.
let in_string = unsafe {
std::mem::transmute(self.arena.lock().unwrap().alloc_str(string.as_ref()))
std::mem::transmute::<&'_ str, &'a str>(
self.arena.lock().unwrap().alloc_str(string.as_ref()),
)
};
let sym = Symbol(self.vec.len() as u32);
self.vec.push(in_string);
Expand Down
1 change: 0 additions & 1 deletion core/src/nix_ffi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg(feature = "nix-experimental")]
#[cxx::bridge]
mod internal {
unsafe extern "C++" {
Expand Down
2 changes: 1 addition & 1 deletion core/src/parser/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ pub fn mk_fun(pat: Pattern, body: RichTerm) -> Term {
/// either a space or a tab, counted from the beginning of the line. If a line is empty or consist
/// only of whitespace characters, it is ignored.
pub fn min_indent(chunks: &[StrChunk<RichTerm>]) -> usize {
let mut min: usize = std::usize::MAX;
let mut min: usize = usize::MAX;
let mut current = 0;
let mut start_line = true;

Expand Down
253 changes: 31 additions & 222 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,28 @@
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
topiary = {
url = "github:tweag/topiary";
inputs.nixpkgs.follows = "nixpkgs";
inputs = {
nixpkgs.follows = "nixpkgs";
crane.follows = "crane";
flake-utils.follows = "flake-utils";
rust-overlay.follows = "rust-overlay";
};
};
nix-input = {
url = "github:nixos/nix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "pre-commit-hooks/flake-compat";
pre-commit-hooks.follows = "pre-commit-hooks";
};
};
nix-input.url = "github:nixos/nix";
};

nixConfig = {
Expand Down

0 comments on commit 6b1fe61

Please sign in to comment.