diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-09 21:21:27 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-09 21:21:27 +0100 |
commit | 5fbdf57c4fe7ee99ba94549766a2644431f61b26 (patch) | |
tree | 97eb439759494abecc9587a0473b9dc2e39b3a5b /crates/ra_hir/src/ty/traits | |
parent | 8316193647f256d3e623d3a86a503298aab91b8f (diff) | |
parent | 85fdf57dbd2cacba6320b55ef1cd57f7795c8ea5 (diff) |
Merge #1800
1800: make all traits non-enumerable r=flodiebold a=nikomatsakis
As discussed on Zulip, this actually matches the present behavior of rustc.
r? @flodiebold
Co-authored-by: Niko Matsakis <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/traits')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 8a127efa1..0367c6560 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, |
@@ -486,7 +478,7 @@ pub(crate) fn trait_datum_query( | |||
486 | associated_ty_ids: Vec::new(), | 478 | associated_ty_ids: Vec::new(), |
487 | where_clauses: Vec::new(), | 479 | where_clauses: Vec::new(), |
488 | flags: chalk_rust_ir::TraitFlags { | 480 | flags: chalk_rust_ir::TraitFlags { |
489 | non_enumerable: false, | 481 | non_enumerable: true, |
490 | auto: false, | 482 | auto: false, |
491 | marker: false, | 483 | marker: false, |
492 | upstream: true, | 484 | upstream: true, |
@@ -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, |