diff options
author | Niko Matsakis <[email protected]> | 2019-09-09 20:24:24 +0100 |
---|---|---|
committer | Niko Matsakis <[email protected]> | 2019-09-09 20:24:24 +0100 |
commit | 65582933cff313f131c71515a4dd98237c9a73b8 (patch) | |
tree | 16702ea52d5962ee4766316ab4dc668d98056444 | |
parent | 7258523a519207a033dedde8c498debe8da4a15e (diff) |
make all traits non-enumerable
As discussed on Zulip, this actually matches the present behavior of
rustc.
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 8a127efa1..e3fc362e1 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -356,14 +356,6 @@ fn make_binders<T>(value: T, num_vars: usize) -> chalk_ir::Binders<T> { | |||
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | fn is_non_enumerable_trait(db: &impl HirDatabase, trait_: Trait) -> bool { | ||
360 | let name = trait_.name(db).unwrap_or_else(crate::Name::missing).to_string(); | ||
361 | match &*name { | ||
362 | "Sized" => true, | ||
363 | _ => false, | ||
364 | } | ||
365 | } | ||
366 | |||
367 | fn convert_where_clauses( | 359 | fn convert_where_clauses( |
368 | db: &impl HirDatabase, | 360 | db: &impl HirDatabase, |
369 | def: GenericDef, | 361 | def: GenericDef, |
@@ -503,7 +495,7 @@ pub(crate) fn trait_datum_query( | |||
503 | let flags = chalk_rust_ir::TraitFlags { | 495 | let flags = chalk_rust_ir::TraitFlags { |
504 | auto: trait_.is_auto(db), | 496 | auto: trait_.is_auto(db), |
505 | upstream: trait_.module(db).krate(db) != Some(krate), | 497 | upstream: trait_.module(db).krate(db) != Some(krate), |
506 | non_enumerable: is_non_enumerable_trait(db, trait_), | 498 | non_enumerable: true, |
507 | // FIXME set these flags correctly | 499 | // FIXME set these flags correctly |
508 | marker: false, | 500 | marker: false, |
509 | fundamental: false, | 501 | fundamental: false, |