Update Chalk

This commit is contained in:
Florian Diebold 2019-05-01 23:26:42 +02:00
parent 0f34568924
commit 0bcf47b22b
4 changed files with 39 additions and 34 deletions

46
Cargo.lock generated
View file

@ -146,9 +146,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "chalk-engine"
version = "0.9.0"
source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a"
source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
dependencies = [
"chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -156,17 +156,17 @@ dependencies = [
[[package]]
name = "chalk-ir"
version = "0.1.0"
source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a"
source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
dependencies = [
"chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
"lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "chalk-macros"
version = "0.1.1"
source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a"
source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -174,22 +174,22 @@ dependencies = [
[[package]]
name = "chalk-rust-ir"
version = "0.1.0"
source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a"
source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
dependencies = [
"chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
]
[[package]]
name = "chalk-solve"
version = "0.1.0"
source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a"
source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
dependencies = [
"chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
"chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
"derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ena 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1074,9 +1074,9 @@ name = "ra_hir"
version = "0.1.0"
dependencies = [
"arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-solve 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)",
"chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
"chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
"ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)",
"insta 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1997,11 +1997,11 @@ dependencies = [
"checksum cargo_metadata 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "178d62b240c34223f265a4c1e275e37d62da163d421fc8d7f7e3ee340f803c57"
"checksum cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5e5f3fee5eeb60324c2781f1e41286bdee933850fff9b3c672587fed5ec58c83"
"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4"
"checksum chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>"
"checksum chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>"
"checksum chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>"
"checksum chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>"
"checksum chalk-solve 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>"
"checksum chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
"checksum chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
"checksum chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
"checksum chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
"checksum chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878"
"checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902"
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"

View file

@ -21,12 +21,9 @@ tt = { path = "../ra_tt", package = "ra_tt" }
test_utils = { path = "../test_utils" }
ra_prof = { path = "../ra_prof" }
# chalk-solve = { git = "https://github.com/rust-lang/chalk.git" }
# chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" }
# chalk-ir = { git = "https://github.com/rust-lang/chalk.git" }
chalk-solve = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" }
chalk-rust-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" }
chalk-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" }
chalk-solve = { git = "https://github.com/rust-lang/chalk.git" }
chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" }
chalk-ir = { git = "https://github.com/rust-lang/chalk.git" }
[dev-dependencies]
flexi_logger = "0.11.0"

View file

@ -202,7 +202,6 @@ fn iterate_trait_method_candidates<T>(
}
}
known_implemented = true;
// TODO the self type is now canonicalized...
if let Some(result) = callback(&ty.value, m) {
return Some(result);
}

View file

@ -40,9 +40,7 @@ impl ToChalk for Ty {
Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"),
// FIXME this is clearly incorrect, but probably not too incorrect
// and I'm not sure what to actually do with Ty::Unknown
Ty::Unknown => {
PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty()
},
Ty::Unknown => PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty(),
}
}
fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self {
@ -189,7 +187,9 @@ where
fundamental: false,
};
let where_clauses = Vec::new(); // FIXME add where clauses
let trait_datum_bound = chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags };
let associated_ty_ids = Vec::new(); // FIXME add associated tys
let trait_datum_bound =
chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags, associated_ty_ids };
let trait_datum = TraitDatum { binders: make_binders(trait_datum_bound, bound_vars.len()) };
Arc::new(trait_datum)
}
@ -289,6 +289,15 @@ where
debug!("split_projection {:?}", projection);
unimplemented!()
}
fn custom_clauses(&self) -> Vec<chalk_ir::ProgramClause> {
debug!("custom_clauses");
vec![]
}
fn all_structs(&self) -> Vec<chalk_ir::StructId> {
debug!("all_structs");
// FIXME
vec![]
}
}
fn id_from_chalk<T: InternKey>(chalk_id: chalk_ir::RawId) -> T {