From 415bdb005a61b14f72c5e0a0c7fac4dac07c349a Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Wed, 3 Jan 2024 11:06:39 +0000 Subject: [PATCH] chore: remove rustversion and devenv update to 1.75 stable --- Cargo.toml | 2 -- devenv.lock | 36 ++++++++++++++++++------------------ devenv.nix | 2 +- src/hugr/views.rs | 14 +++----------- src/hugr/views/tests.rs | 4 ---- 5 files changed, 22 insertions(+), 36 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ea4861062..c633a1222 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,6 @@ petgraph = { version = "0.6.3", default-features = false } context-iterators = "0.2.0" serde_json = "1.0.97" delegate = "0.12.0" -rustversion = "1.0.14" paste = "1.0" strum = "0.25.0" strum_macros = "0.25.3" @@ -68,4 +67,3 @@ harness = false [profile.dev.package] insta.opt-level = 3 -similar.opt-level = 3 diff --git a/devenv.lock b/devenv.lock index 3d6e2de22..7750dfcfa 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1700140236, - "narHash": "sha256-OpukFO0rRG2hJzD+pCQq+nSWuT9dBL6DSvADQaUlmFg=", + "lastModified": 1703939110, + "narHash": "sha256-GgjYWkkHQ8pUBwXX++ah+4d07DqOeCDaaQL6Ab86C50=", "owner": "cachix", "repo": "devenv", - "rev": "525d60c44de848a6b2dd468f6efddff078eb2af2", + "rev": "7354096fc026f79645fdac73e9aeea71a09412c3", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1700461394, - "narHash": "sha256-lBpjEshdBxeuJwc4+vh4jbO3AmhXbiFrkdWy2pABAAc=", + "lastModified": 1704262971, + "narHash": "sha256-3HB1yaMBBox3z9oXEiQuZzQhXegOc9P3FR6/XNsJGn0=", "owner": "nix-community", "repo": "fenix", - "rev": "5ad1b10123ca40c9d983fb0863403fd97a06c0f8", + "rev": "38aaea4e54dc3874a6355c10861bd8316a6f09f3", "type": "github" }, "original": { @@ -95,11 +95,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1700444282, - "narHash": "sha256-s/+tgT+Iz0LZO+nBvSms+xsMqvHt2LqYniG9r+CYyJc=", + "lastModified": 1704008649, + "narHash": "sha256-rGPSWjXTXTurQN9beuHdyJhB8O761w1Zc5BqSSmHvoM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3f21a22b5aafefa1845dec6f4a378a8f53d8681c", + "rev": "d44d59d2b5bd694cd9d996fd8c51d03e3e9ba7f7", "type": "github" }, "original": { @@ -111,11 +111,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1700403855, - "narHash": "sha256-Q0Uzjik9kUTN9pd/kp52XJi5kletBhy29ctBlAG+III=", + "lastModified": 1704018918, + "narHash": "sha256-erjg/HrpC9liEfm7oLqb8GXCqsxaFwIIPqCsknW5aFY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0c5678df521e1407884205fe3ce3cf1d7df297db", + "rev": "2c9c58e98243930f8cb70387934daa4bc8b00373", "type": "github" }, "original": { @@ -152,11 +152,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1700064067, - "narHash": "sha256-1ZWNDzhu8UlVCK7+DUN9dVQfiHX1bv6OQP9VxstY/gs=", + "lastModified": 1703939133, + "narHash": "sha256-Gxe+mfOT6bL7wLC/tuT2F+V+Sb44jNr8YsJ3cyIl4Mo=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e558068cba67b23b4fbc5537173dbb43748a17e8", + "rev": "9d3d7e18c6bc4473d7520200d4ddab12f8402d38", "type": "github" }, "original": { @@ -177,11 +177,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1700247620, - "narHash": "sha256-+Xg0qZLbC9dZx0Z6JbaVHR/BklAr2I83dzKLB8r41c8=", + "lastModified": 1704207973, + "narHash": "sha256-VEWsjIKtdinx5iyhfxuTHRijYBKSbO/8Gw1HPoWD9mQ=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "255eed40c45fcf108ba844b4ad126bdc4e7a18df", + "rev": "426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746", "type": "github" }, "original": { diff --git a/devenv.nix b/devenv.nix index f4a85aca5..bc9fdba1c 100644 --- a/devenv.nix +++ b/devenv.nix @@ -31,7 +31,7 @@ in # https://devenv.sh/languages/ # https://devenv.sh/reference/options/#languagesrustversion languages.rust = { - channel = "beta"; + channel = "stable"; enable = true; components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ]; }; diff --git a/src/hugr/views.rs b/src/hugr/views.rs index b9f798370..7e9e2e3c6 100644 --- a/src/hugr/views.rs +++ b/src/hugr/views.rs @@ -25,11 +25,11 @@ use portgraph::{multiportgraph, LinkView, MultiPortGraph, PortView}; use super::{Hugr, HugrError, NodeMetadata, NodeMetadataMap, NodeType, DEFAULT_NODETYPE}; use crate::ops::handle::NodeHandle; use crate::ops::{FuncDecl, FuncDefn, OpName, OpTag, OpTrait, OpType, DFG}; -#[rustversion::since(1.75)] // uses impl in return position + use crate::types::Type; use crate::types::{EdgeKind, FunctionType, PolyFuncType}; use crate::{Direction, IncomingPort, Node, OutgoingPort, Port}; -#[rustversion::since(1.75)] // uses impl in return position + use itertools::Either; /// A trait for inspecting HUGRs. @@ -183,7 +183,6 @@ pub trait HugrView: sealed::HugrInternals { /// Iterator over the nodes and ports connected to a port. fn linked_ports(&self, node: Node, port: impl Into) -> Self::PortLinks<'_>; - #[rustversion::since(1.75)] // uses impl in return position /// Iterator over all the nodes and ports connected to a node in a given direction. fn all_linked_ports( &self, @@ -205,7 +204,6 @@ pub trait HugrView: sealed::HugrInternals { } } - #[rustversion::since(1.75)] // uses impl in return position /// Iterator over all the nodes and ports connected to a node's inputs. fn all_linked_outputs(&self, node: Node) -> impl Iterator { self.all_linked_ports(node, Direction::Incoming) @@ -213,7 +211,6 @@ pub trait HugrView: sealed::HugrInternals { .unwrap() } - #[rustversion::since(1.75)] // uses impl in return position /// Iterator over all the nodes and ports connected to a node's outputs. fn all_linked_inputs(&self, node: Node) -> impl Iterator { self.all_linked_ports(node, Direction::Outgoing) @@ -411,7 +408,6 @@ pub trait HugrView: sealed::HugrInternals { .map(|(n, _)| n) } - #[rustversion::since(1.75)] // uses impl in return position /// If a node has a static output, return the targets. fn static_targets(&self, node: Node) -> Option> { Some(self.linked_inputs(node, self.get_optype(node).static_output_port()?)) @@ -423,7 +419,6 @@ pub trait HugrView: sealed::HugrInternals { self.get_optype(node).dataflow_signature() } - #[rustversion::since(1.75)] // uses impl in return position /// Iterator over all outgoing ports that have Value type, along /// with corresponding types. fn value_types(&self, node: Node, dir: Direction) -> impl Iterator { @@ -432,7 +427,6 @@ pub trait HugrView: sealed::HugrInternals { .flat_map(move |port| sig.port_type(port).map(|typ| (port, typ.clone()))) } - #[rustversion::since(1.75)] // uses impl in return position /// Iterator over all incoming ports that have Value type, along /// with corresponding types. fn in_value_types(&self, node: Node) -> impl Iterator { @@ -440,7 +434,6 @@ pub trait HugrView: sealed::HugrInternals { .map(|(p, t)| (p.as_incoming().unwrap(), t)) } - #[rustversion::since(1.75)] // uses impl in return position /// Iterator over all incoming ports that have Value type, along /// with corresponding types. fn out_value_types(&self, node: Node) -> impl Iterator { @@ -618,7 +611,6 @@ impl> HugrView for T { } } -#[rustversion::since(1.75)] // uses impl in return position /// Trait implementing methods on port iterators. pub trait PortIterator

: Iterator where @@ -636,7 +628,7 @@ where }) } } -#[rustversion::since(1.75)] // uses impl in return position + impl PortIterator

for I where I: Iterator, diff --git a/src/hugr/views/tests.rs b/src/hugr/views/tests.rs index 97fb50861..c248fda2b 100644 --- a/src/hugr/views/tests.rs +++ b/src/hugr/views/tests.rs @@ -69,7 +69,6 @@ fn dot_string(sample_hugr: (Hugr, BuildHandle, BuildHandle, BuildHandle)) { use itertools::Itertools; @@ -97,7 +96,6 @@ fn all_ports(sample_hugr: (Hugr, BuildHandle, BuildHandle