Skip to content

Commit e294333

Browse files
authored
Merge pull request #173 from nikomatsakis/type-alias-bounds
type alias bounds and other miscellany
2 parents 9345ac4 + 6c43ec8 commit e294333

File tree

15 files changed

+87
-92
lines changed

15 files changed

+87
-92
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ena = "0.4"
1515
error-chain = "0.12.0"
1616
itertools = "0.7.8"
1717
lalrpop-intern = "0.14"
18-
petgraph = "0.4.5"
18+
petgraph = "0.4.13"
1919
rustyline = "1.0"
2020
serde = "1.0"
2121
serde_derive = "1.0"
@@ -30,7 +30,7 @@ version = "0.1.0"
3030
path = "chalk-macros"
3131

3232
[dependencies.chalk-engine]
33-
version = "0.7.0"
33+
version = "0.7.1"
3434
path = "chalk-engine"
3535

3636
[workspace]

chalk-engine/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chalk-engine"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "Core trait engine from Chalk project"
55
license = "Apache-2.0/MIT"
66
authors = ["Rust Compiler Team", "Chalk developers"]

chalk-engine/src/context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::fallible::Fallible;
2-
use crate::hh::HhGoal;
3-
use crate::{DelayedLiteral, ExClause, SimplifiedAnswer};
1+
use fallible::Fallible;
2+
use hh::HhGoal;
3+
use {DelayedLiteral, ExClause, SimplifiedAnswer};
44
use std::fmt::Debug;
55
use std::hash::Hash;
66

7-
crate mod prelude;
7+
pub(crate) mod prelude;
88

99
/// The "context" in which the SLG solver operates. It defines all the
1010
/// types that the SLG solver may need to refer to, as well as a few

chalk-engine/src/context/prelude.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![allow(unused_imports)] // rustc bug
22

3-
crate use super::Context;
4-
crate use super::ContextOps;
5-
crate use super::AggregateOps;
6-
crate use super::ResolventOps;
7-
crate use super::TruncateOps;
8-
crate use super::InferenceTable;
3+
pub(crate) use super::Context;
4+
pub(crate) use super::ContextOps;
5+
pub(crate) use super::AggregateOps;
6+
pub(crate) use super::ResolventOps;
7+
pub(crate) use super::TruncateOps;
8+
pub(crate) use super::InferenceTable;

chalk-engine/src/forest.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
use crate::{DepthFirstNumber, SimplifiedAnswer, TableIndex};
2-
use crate::context::prelude::*;
3-
use crate::context::AnswerStream;
4-
use crate::logic::RootSearchFail;
5-
use crate::stack::{Stack, StackIndex};
6-
use crate::tables::Tables;
7-
use crate::table::{Answer, AnswerIndex};
1+
use {DepthFirstNumber, SimplifiedAnswer, TableIndex};
2+
use context::prelude::*;
3+
use context::AnswerStream;
4+
use logic::RootSearchFail;
5+
use stack::{Stack, StackIndex};
6+
use tables::Tables;
7+
use table::{Answer, AnswerIndex};
88

99
pub struct Forest<C: Context, CO: ContextOps<C>> {
1010
#[allow(dead_code)]
11-
crate context: CO,
12-
crate tables: Tables<C>,
13-
crate stack: Stack,
11+
pub(crate) context: CO,
12+
pub(crate) tables: Tables<C>,
13+
pub(crate) stack: Stack,
1414

1515
dfn: DepthFirstNumber,
1616
}

chalk-engine/src/hh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::context::Context;
1+
use context::Context;
22

33
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
44
/// A general goal; this is the full range of questions you can pose to Chalk.

chalk-engine/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@
4949
//! - HH: Hereditary harrop predicates. What Chalk deals in.
5050
//! Popularized by Lambda Prolog.
5151
52-
#![feature(crate_in_paths)]
53-
#![feature(crate_visibility_modifier)]
5452
#![feature(in_band_lifetimes)]
55-
#![feature(macro_vis_matcher)]
5653
#![feature(step_trait)]
5754
#![feature(non_modrs_mods)]
58-
#![feature(rustc_private)]
5955

6056
#[macro_use]
6157
extern crate chalk_macros;
@@ -65,7 +61,7 @@ extern crate stacker;
6561

6662
extern crate rustc_hash;
6763

68-
use crate::context::Context;
64+
use context::Context;
6965
use rustc_hash::FxHashSet;
7066
use std::cmp::min;
7167
use std::usize;

chalk-engine/src/logic.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use crate::{DelayedLiteral, DelayedLiteralSet, DepthFirstNumber, ExClause, Literal, Minimums,
1+
use {DelayedLiteral, DelayedLiteralSet, DepthFirstNumber, ExClause, Literal, Minimums,
22
TableIndex};
3-
use crate::fallible::NoSolution;
4-
use crate::context::{WithInstantiatedExClause, WithInstantiatedUCanonicalGoal, prelude::*};
5-
use crate::forest::Forest;
6-
use crate::hh::HhGoal;
7-
use crate::stack::StackIndex;
8-
use crate::strand::{CanonicalStrand, SelectedSubgoal, Strand};
9-
use crate::table::{Answer, AnswerIndex};
3+
use fallible::NoSolution;
4+
use context::{WithInstantiatedExClause, WithInstantiatedUCanonicalGoal, prelude::*};
5+
use forest::Forest;
6+
use hh::HhGoal;
7+
use stack::StackIndex;
8+
use strand::{CanonicalStrand, SelectedSubgoal, Strand};
9+
use table::{Answer, AnswerIndex};
1010
use rustc_hash::FxHashSet;
1111
use std::marker::PhantomData;
1212
use std::mem;
@@ -56,7 +56,8 @@ enum RecursiveSearchFail {
5656
QuantumExceeded,
5757
}
5858

59-
type StrandResult<C, T> = Result<T, StrandFail<C>>;
59+
#[allow(type_alias_bounds)]
60+
type StrandResult<C: Context, T> = Result<T, StrandFail<C>>;
6061

6162
/// Possible failures from pursuing a particular strand.
6263
#[derive(Debug)]
@@ -183,7 +184,7 @@ impl<C: Context, CO: ContextOps<C>> Forest<C, CO> {
183184
result.map(|()| EnsureSuccess::AnswerAvailable)
184185
}
185186

186-
crate fn answer(&self, table: TableIndex, answer: AnswerIndex) -> &Answer<C> {
187+
pub(crate) fn answer(&self, table: TableIndex, answer: AnswerIndex) -> &Answer<C> {
187188
self.tables[table].answer(answer).unwrap()
188189
}
189190

@@ -691,7 +692,7 @@ impl<C: Context, CO: ContextOps<C>> Forest<C, CO> {
691692
/// In terms of the NFTD paper, creating a new table corresponds
692693
/// to the *New Subgoal* step as well as the *Program Clause
693694
/// Resolution* steps.
694-
crate fn get_or_create_table_for_ucanonical_goal(
695+
pub(crate) fn get_or_create_table_for_ucanonical_goal(
695696
&mut self,
696697
goal: C::UCanonicalGoalInEnvironment,
697698
) -> TableIndex {
@@ -1166,7 +1167,7 @@ impl<C: Context, CO: ContextOps<C>> Forest<C, CO> {
11661167
depth: StackIndex,
11671168
strand: Strand<'_, C, impl Context>,
11681169
) -> StrandResult<C, ()> {
1169-
crate::maybe_grow_stack(|| self.pursue_strand(depth, strand))
1170+
::maybe_grow_stack(|| self.pursue_strand(depth, strand))
11701171
}
11711172

11721173
/// Invoked when we have found a successful answer to the given

chalk-engine/src/simplify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::fallible::Fallible;
2-
use crate::{ExClause, Literal};
3-
use crate::forest::Forest;
4-
use crate::hh::HhGoal;
5-
use crate::context::prelude::*;
1+
use fallible::Fallible;
2+
use {ExClause, Literal};
3+
use forest::Forest;
4+
use hh::HhGoal;
5+
use context::prelude::*;
66

77
impl<C: Context, CO: ContextOps<C>> Forest<C, CO> {
88
/// Simplifies an HH goal into a series of positive domain goals

0 commit comments

Comments
 (0)