From 3008f5711fbe40d1930ebc36e602c29d3fbec3eb Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 3 Aug 2019 20:48:55 +0200 Subject: Update dhall-lang submodule --- dhall/src/phase/typecheck.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dhall') diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index 9bb0e32..d9f6e09 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -1044,7 +1044,6 @@ mod spec_tests { tc_success!(tc_success_recordOfTypes, "recordOfTypes"); // tc_success!(tc_success_simple_access_0, "simple/access/0"); // tc_success!(tc_success_simple_access_1, "simple/access/1"); - // tc_success!(tc_success_simple_alternativesAreTypes, "simple/alternativesAreTypes"); // tc_success!(tc_success_simple_anonymousFunctionsInTypes, "simple/anonymousFunctionsInTypes"); // tc_success!(tc_success_simple_fieldsAreTypes, "simple/fieldsAreTypes"); // tc_success!(tc_success_simple_kindParameter, "simple/kindParameter"); @@ -1174,6 +1173,7 @@ mod spec_tests { ti_success!(ti_success_unit_ListReverse, "unit/ListReverse"); ti_success!(ti_success_unit_MergeEmptyUnion, "unit/MergeEmptyUnion"); ti_success!(ti_success_unit_MergeOne, "unit/MergeOne"); + ti_success!(ti_success_unit_MergeOneEmpty, "unit/MergeOneEmpty"); ti_success!(ti_success_unit_MergeOneWithAnnotation, "unit/MergeOneWithAnnotation"); ti_success!(ti_success_unit_Natural, "unit/Natural"); ti_success!(ti_success_unit_NaturalBuild, "unit/NaturalBuild"); @@ -1260,7 +1260,7 @@ mod spec_tests { ti_success!(ti_success_unit_TypeAnnotationSort, "unit/TypeAnnotationSort"); ti_success!(ti_success_unit_UnionConstructorEmptyField, "unit/UnionConstructorEmptyField"); ti_success!(ti_success_unit_UnionConstructorField, "unit/UnionConstructorField"); - ti_success!(ti_success_unit_UnionOne, "unit/UnionOne"); + ti_success!(ti_success_unit_UnionLiteralOne, "unit/UnionLiteralOne"); ti_success!(ti_success_unit_UnionTypeEmpty, "unit/UnionTypeEmpty"); ti_success!(ti_success_unit_UnionTypeKind, "unit/UnionTypeKind"); ti_success!(ti_success_unit_UnionTypeOne, "unit/UnionTypeOne"); -- cgit v1.2.3 From 2ad5973a32099ad8f79f247adc9d03340e2df4ab Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 3 Aug 2019 21:36:53 +0200 Subject: Update dhall-lang submodule --- dhall/src/phase/binary.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'dhall') diff --git a/dhall/src/phase/binary.rs b/dhall/src/phase/binary.rs index 96eaa6c..1812131 100644 --- a/dhall/src/phase/binary.rs +++ b/dhall/src/phase/binary.rs @@ -196,17 +196,15 @@ fn cbor_value_to_dhall( }; let hash = match hash { Null => None, - Array(vec) => match vec.as_slice() { - [String(protocol), String(hash)] => Some(Hash { - protocol: protocol.clone(), - hash: hash.clone(), - }), - _ => Err(DecodeError::WrongFormatError( - "import/hash".to_owned(), - ))?, + Bytes(bytes) => match bytes.as_slice() { + [18, 32, rest..] => Some(Hash::SHA256(rest.to_vec())), + _ => Err(DecodeError::WrongFormatError(format!( + "import/hash/unknown_multihash: {:?}", + bytes + )))?, }, _ => Err(DecodeError::WrongFormatError( - "import/hash".to_owned(), + "import/hash/should_be_bytes".to_owned(), ))?, }; let mut rest = rest.iter(); @@ -518,7 +516,7 @@ fn serialize_import(ser: S, import: &Import) -> Result where S: serde::ser::Serializer, { - use cbor::Value::{Array, Null, String, U64}; + use cbor::Value::{Bytes, Null, U64}; use serde::ser::SerializeSeq; let count = 4 + match &import.location_hashed.location { @@ -533,8 +531,10 @@ where let hash = match &import.location_hashed.hash { None => Null, - Some(h) => { - Array(vec![String(h.protocol.clone()), String(h.hash.clone())]) + Some(Hash::SHA256(h)) => { + let mut bytes = vec![18, 32]; + bytes.extend_from_slice(h); + Bytes(bytes) } }; ser_seq.serialize_element(&hash)?; -- cgit v1.2.3 From b85967fbe27505ae932be3b640dff5260fd32662 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 3 Aug 2019 22:15:49 +0200 Subject: Update dhall-lang submodule --- dhall/build.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'dhall') diff --git a/dhall/build.rs b/dhall/build.rs index 46bb3a4..3f09d47 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -35,11 +35,11 @@ fn dhall_files_in_dir<'a>( } fn make_test_module( - w: &mut impl Write, - mod_name: &str, - dir: &Path, - feature: &str, - mut exclude: impl FnMut(&str) -> bool, + w: &mut impl Write, // Where to output the generated code + mod_name: &str, // Name of the module, used in the output of `cargo test` + dir: &Path, // Directory containing the tests files + feature: &str, // Relevant variant of `dhall::tests::Feature` + mut exclude: impl FnMut(&str) -> bool, // Given a file name, whether to exclude it ) -> std::io::Result<()> { writeln!(w, "mod {} {{", mod_name)?; for (name, path) in dhall_files_in_dir(&dir.join("success/"), true) { @@ -67,6 +67,8 @@ fn make_test_module( } fn main() -> std::io::Result<()> { + // Tries to detect when the submodule gets updated; doesn't really work. + // To force regeneration of the test list, just `touch dhall-lang/.git` println!("cargo:rerun-if-changed=../dhall-lang/.git"); println!( "cargo:rerun-if-changed=../.git/modules/dhall-lang/refs/heads/master" @@ -129,6 +131,9 @@ fn main() -> std::io::Result<()> { path == "success/simple/integerToDouble" // Too slow || path == "success/remoteSystems" + // TODO: selection by expression + || path == "success/unit/RecordProjectionTypeEmpty" + || path == "success/unit/RecordProjectionTypeNonEmpty" }, )?; -- cgit v1.2.3