Skip to content

Commit fee3d9b

Browse files
committed
Updated docs.
1 parent 1a51e70 commit fee3d9b

File tree

5 files changed

+5
-50
lines changed

5 files changed

+5
-50
lines changed

Cargo.toml

+1-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ members = [
1212
"hugr-llvm",
1313
"hugr-py",
1414
]
15-
default-members = [
16-
"hugr",
17-
"hugr-core",
18-
"hugr-passes",
19-
"hugr-cli",
20-
"hugr-model",
21-
"hugr-llvm",
22-
]
15+
default-members = ["hugr", "hugr-core", "hugr-passes", "hugr-cli", "hugr-model"]
2316

2417
[workspace.package]
2518
rust-version = "1.75"

hugr-core/src/extension.rs

+2-26
Original file line numberDiff line numberDiff line change
@@ -806,14 +806,6 @@ impl ExtensionSet {
806806
self.0.insert(extension.clone());
807807
}
808808

809-
/// Adds a type var (which must have been declared as a [TypeParam::Extensions]) to this set
810-
pub fn insert_type_var(&mut self, idx: usize) {
811-
// Represent type vars as string representation of variable index.
812-
// This is not a legal IdentList or ExtensionId so should not conflict.
813-
self.0
814-
.insert(ExtensionId::new_unchecked(idx.to_string().as_str()));
815-
}
816-
817809
/// Returns `true` if the set contains the given extension.
818810
pub fn contains(&self, extension: &ExtensionId) -> bool {
819811
self.0.contains(extension)
@@ -836,14 +828,6 @@ impl ExtensionSet {
836828
set
837829
}
838830

839-
/// An ExtensionSet containing a single type variable
840-
/// (which must have been declared as a [TypeParam::Extensions])
841-
pub fn type_var(idx: usize) -> Self {
842-
let mut set = Self::new();
843-
set.insert_type_var(idx);
844-
set
845-
}
846-
847831
/// Returns the union of two extension sets.
848832
pub fn union(mut self, other: Self) -> Self {
849833
self.0.extend(other.0);
@@ -994,16 +978,8 @@ pub mod test {
994978
type Strategy = BoxedStrategy<Self>;
995979

996980
fn arbitrary_with(_: Self::Parameters) -> Self::Strategy {
997-
(
998-
hash_set(0..10usize, 0..3),
999-
hash_set(any::<ExtensionId>(), 0..3),
1000-
)
1001-
.prop_map(|(vars, extensions)| {
1002-
ExtensionSet::union_over(
1003-
std::iter::once(extensions.into_iter().collect::<ExtensionSet>())
1004-
.chain(vars.into_iter().map(ExtensionSet::type_var)),
1005-
)
1006-
})
981+
hash_set(any::<ExtensionId>(), 0..3)
982+
.prop_map(|extensions| extensions.into_iter().collect::<ExtensionSet>())
1007983
.boxed()
1008984
}
1009985
}

hugr-core/src/hugr/views.rs

-5
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,6 @@ pub trait HugrView: HugrInternals {
460460
}
461461

462462
/// Check the validity of the underlying HUGR.
463-
///
464-
/// This includes checking consistency of extension requirements between
465-
/// connected nodes and between parents and children.
466-
/// See [`HugrView::validate_no_extensions`] for a version that doesn't check
467-
/// extension requirements.
468463
fn validate(&self) -> Result<(), ValidationError> {
469464
self.base_hugr().validate()
470465
}

hugr-core/src/types/signature.rs

-8
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ impl<RV: MaybeRV> FuncTypeBase<RV> {
106106
}
107107

108108
/// Returns a registry with the concrete extensions used by this signature.
109-
///
110-
/// Note that extension type parameters are not included, as they have not
111-
/// been instantiated yet.
112-
///
113-
/// This method only returns extensions actually used by the types in the
114-
/// signature. The extension deltas added via [`Self::with_extension_delta`]
115-
/// refer to _runtime_ extensions, which may not be in all places that
116-
/// manipulate a HUGR.
117109
pub fn used_extensions(&self) -> Result<ExtensionRegistry, ExtensionCollectionError> {
118110
let mut used = WeakExtensionRegistry::default();
119111
let mut missing = ExtensionSet::new();

hugr-core/src/types/type_param.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub enum TypeArg {
180180
},
181181
/// Variable (used in type schemes or inside polymorphic functions),
182182
/// but not a [TypeArg::Type] (not even a row variable i.e. [TypeParam::List] of type)
183-
/// nor [TypeArg::Extensions] - see [TypeArg::new_var_use]
183+
/// - see [TypeArg::new_var_use]
184184
#[display("{v}")]
185185
Variable {
186186
#[allow(missing_docs)]
@@ -224,8 +224,7 @@ impl From<Vec<TypeArg>> for TypeArg {
224224
}
225225
}
226226

227-
/// Variable in a TypeArg, that is neither a [TypeArg::Extensions]
228-
/// nor a single [TypeArg::Type] (i.e. not a [Type::new_var_use]
227+
/// Variable in a TypeArg, that is not a single [TypeArg::Type] (i.e. not a [Type::new_var_use]
229228
/// - it might be a [Type::new_row_var_use]).
230229
#[derive(
231230
Clone, Debug, PartialEq, Eq, Hash, serde::Deserialize, serde::Serialize, derive_more::Display,

0 commit comments

Comments
 (0)