Skip to content

Commit 7e7b624

Browse files
authored
Merge pull request #417 from jackh726/rustc_updates
Copy derives on intern types, from_fallible change, and linkcheck
2 parents eeaa60c + c6182a9 commit 7e7b624

File tree

3 files changed

+120
-89
lines changed

3 files changed

+120
-89
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ jobs:
4141
- name: Install mdbook-mermaid
4242
run: cd book && curl -L https://github.com/badboy/mdbook-mermaid/releases/download/0.2.2/mdbook-mermaid-0.2.2-x86_64-unknown-linux-gnu.tar.gz | tar xz
4343

44-
- name: Install mdbook-linkcheck
45-
run: |
46-
cd book
47-
curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.5.0/mdbook-linkcheck-v0.5.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
48-
# Add the book directory to the $PATH
49-
echo "::add-path::$GITHUB_WORKSPACE/book"
50-
5144
- name: Execute tests for Chalk book
5245
run: cd book && ./mdbook test
5346

@@ -85,3 +78,26 @@ jobs:
8578
8679
- name: Check formatting of all crates in the workspace
8780
run: cargo fmt --all -- --check
81+
82+
mdbook-linkcheck:
83+
name: Book link check
84+
runs-on: ubuntu-latest
85+
if: github.ref != 'refs/heads/master'
86+
steps:
87+
- name: Checkout the source code
88+
uses: actions/checkout@master
89+
with:
90+
fetch-depth: 1
91+
92+
- name: Install mdbook
93+
run: cd book && curl -L https://github.com/rust-lang/mdBook/releases/download/v0.3.7/mdbook-v0.3.7-x86_64-unknown-linux-gnu.tar.gz | tar xz
94+
95+
- name: Install mdbook-linkcheck
96+
run: |
97+
cd book
98+
curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.5.0/mdbook-linkcheck-v0.5.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
99+
# Add the book directory to the $PATH
100+
echo "::add-path::$GITHUB_WORKSPACE/book"
101+
102+
- name: Build Chalk book
103+
run: cd book && ./mdbook build

chalk-ir/src/interner.rs

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,10 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
506506
/// normally invoked directly; instead, you invoke
507507
/// `GoalsData::intern` (which will ultimately call this
508508
/// method).
509-
fn intern_goals(&self, data: impl IntoIterator<Item = Goal<Self>>) -> Self::InternedGoals;
509+
fn intern_goals<E>(
510+
&self,
511+
data: impl IntoIterator<Item = Result<Goal<Self>, E>>,
512+
) -> Result<Self::InternedGoals, E>;
510513

511514
/// Lookup the `GoalsData` that was interned to create a `InternedGoals`.
512515
fn goals_data<'a>(&self, goals: &'a Self::InternedGoals) -> &'a [Goal<Self>];
@@ -542,10 +545,10 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
542545
/// normally invoked directly; instead, you invoke
543546
/// `ProgramClauses::from` (which will ultimately call this
544547
/// method).
545-
fn intern_program_clauses(
548+
fn intern_program_clauses<E>(
546549
&self,
547-
data: impl IntoIterator<Item = ProgramClause<Self>>,
548-
) -> Self::InternedProgramClauses;
550+
data: impl IntoIterator<Item = Result<ProgramClause<Self>, E>>,
551+
) -> Result<Self::InternedProgramClauses, E>;
549552

550553
/// Lookup the `ProgramClauseData` that was interned to create a `ProgramClause`.
551554
fn program_clauses_data<'a>(
@@ -557,10 +560,10 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
557560
/// normally invoked directly; instead, you invoke
558561
/// `QuantifiedWhereClauses::from` (which will ultimately call this
559562
/// method).
560-
fn intern_quantified_where_clauses(
563+
fn intern_quantified_where_clauses<E>(
561564
&self,
562-
data: impl IntoIterator<Item = QuantifiedWhereClause<Self>>,
563-
) -> Self::InternedQuantifiedWhereClauses;
565+
data: impl IntoIterator<Item = Result<QuantifiedWhereClause<Self>, E>>,
566+
) -> Result<Self::InternedQuantifiedWhereClauses, E>;
564567

565568
/// Lookup the slice of `QuantifiedWhereClause` that was interned to
566569
/// create a `QuantifiedWhereClauses`.
@@ -573,10 +576,10 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
573576
/// normally invoked directly; instead, you invoke
574577
/// `ParameterKinds::from` (which will ultimately call this
575578
/// method).
576-
fn intern_parameter_kinds(
579+
fn intern_parameter_kinds<E>(
577580
&self,
578-
data: impl IntoIterator<Item = ParameterKind<()>>,
579-
) -> Self::InternedParameterKinds;
581+
data: impl IntoIterator<Item = Result<ParameterKind<()>, E>>,
582+
) -> Result<Self::InternedParameterKinds, E>;
580583

581584
/// Lookup the slice of `ParameterKind` that was interned to
582585
/// create a `ParameterKinds`.
@@ -589,10 +592,10 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
589592
/// normally invoked directly; instead, you invoke
590593
/// `CanonicalVarKinds::from` (which will ultimately call this
591594
/// method).
592-
fn intern_canonical_var_kinds(
595+
fn intern_canonical_var_kinds<E>(
593596
&self,
594-
data: impl IntoIterator<Item = ParameterKind<UniverseIndex>>,
595-
) -> Self::InternedCanonicalVarKinds;
597+
data: impl IntoIterator<Item = Result<ParameterKind<UniverseIndex>, E>>,
598+
) -> Result<Self::InternedCanonicalVarKinds, E>;
596599

597600
/// Lookup the slice of `ParameterKind` that was interned to
598601
/// create a `ParameterKinds`.
@@ -879,10 +882,10 @@ mod default {
879882
goal
880883
}
881884

882-
fn intern_goals(
885+
fn intern_goals<E>(
883886
&self,
884-
data: impl IntoIterator<Item = Goal<ChalkIr>>,
885-
) -> Vec<Goal<ChalkIr>> {
887+
data: impl IntoIterator<Item = Result<Goal<ChalkIr>, E>>,
888+
) -> Result<Vec<Goal<ChalkIr>>, E> {
886889
data.into_iter().collect()
887890
}
888891

@@ -915,10 +918,10 @@ mod default {
915918
clause
916919
}
917920

918-
fn intern_program_clauses(
921+
fn intern_program_clauses<E>(
919922
&self,
920-
data: impl IntoIterator<Item = ProgramClause<Self>>,
921-
) -> Vec<ProgramClause<Self>> {
923+
data: impl IntoIterator<Item = Result<ProgramClause<Self>, E>>,
924+
) -> Result<Vec<ProgramClause<Self>>, E> {
922925
data.into_iter().collect()
923926
}
924927

@@ -929,10 +932,10 @@ mod default {
929932
clauses
930933
}
931934

932-
fn intern_quantified_where_clauses(
935+
fn intern_quantified_where_clauses<E>(
933936
&self,
934-
data: impl IntoIterator<Item = QuantifiedWhereClause<Self>>,
935-
) -> Self::InternedQuantifiedWhereClauses {
937+
data: impl IntoIterator<Item = Result<QuantifiedWhereClause<Self>, E>>,
938+
) -> Result<Self::InternedQuantifiedWhereClauses, E> {
936939
data.into_iter().collect()
937940
}
938941

@@ -942,24 +945,27 @@ mod default {
942945
) -> &'a [QuantifiedWhereClause<Self>] {
943946
clauses
944947
}
945-
fn intern_parameter_kinds(
948+
fn intern_parameter_kinds<E>(
946949
&self,
947-
data: impl IntoIterator<Item = ParameterKind<()>>,
948-
) -> Self::InternedParameterKinds {
950+
data: impl IntoIterator<Item = Result<ParameterKind<()>, E>>,
951+
) -> Result<Self::InternedParameterKinds, E> {
949952
data.into_iter().collect()
950953
}
954+
951955
fn parameter_kinds_data<'a>(
952956
&self,
953957
parameter_kinds: &'a Self::InternedParameterKinds,
954958
) -> &'a [ParameterKind<()>] {
955959
parameter_kinds
956960
}
957-
fn intern_canonical_var_kinds(
961+
962+
fn intern_canonical_var_kinds<E>(
958963
&self,
959-
data: impl IntoIterator<Item = ParameterKind<UniverseIndex>>,
960-
) -> Self::InternedCanonicalVarKinds {
964+
data: impl IntoIterator<Item = Result<ParameterKind<UniverseIndex>, E>>,
965+
) -> Result<Self::InternedCanonicalVarKinds, E> {
961966
data.into_iter().collect()
962967
}
968+
963969
fn canonical_var_kinds_data<'a>(
964970
&self,
965971
canonical_var_kinds: &'a Self::InternedCanonicalVarKinds,

0 commit comments

Comments
 (0)