diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 25716fe8c..2c7d94bce 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -3007,7 +3007,7 @@ impl<T, U> Into<U> for T where U: From<T> {} | |||
3007 | fn test() { S2.into()<|>; } | 3007 | fn test() { S2.into()<|>; } |
3008 | "#, | 3008 | "#, |
3009 | ); | 3009 | ); |
3010 | assert_eq!(t, "S1"); | 3010 | assert_eq!(t, "{unknown}"); |
3011 | } | 3011 | } |
3012 | 3012 | ||
3013 | #[test] | 3013 | #[test] |
@@ -3024,7 +3024,7 @@ impl<T, U: From<T>> Into<U> for T {} | |||
3024 | fn test() { S2.into()<|>; } | 3024 | fn test() { S2.into()<|>; } |
3025 | "#, | 3025 | "#, |
3026 | ); | 3026 | ); |
3027 | assert_eq!(t, "S1"); | 3027 | assert_eq!(t, "{unknown}"); |
3028 | } | 3028 | } |
3029 | 3029 | ||
3030 | #[test] | 3030 | #[test] |
@@ -3066,7 +3066,7 @@ impl<B, C> Trait for S<B, C> where C: FnX, B: SendX {} | |||
3066 | fn test() { (S {}).method()<|>; } | 3066 | fn test() { (S {}).method()<|>; } |
3067 | "#, | 3067 | "#, |
3068 | ); | 3068 | ); |
3069 | assert_eq!(t, "{unknown}"); | 3069 | assert_eq!(t, "()"); |
3070 | } | 3070 | } |
3071 | 3071 | ||
3072 | #[test] | 3072 | #[test] |
@@ -3546,11 +3546,11 @@ fn test(x: Trait, y: &Trait) -> u64 { | |||
3546 | [129; 132) 'bar': fn bar() -> {unknown} | 3546 | [129; 132) 'bar': fn bar() -> {unknown} |
3547 | [129; 134) 'bar()': {unknown} | 3547 | [129; 134) 'bar()': {unknown} |
3548 | [140; 141) 'x': {unknown} | 3548 | [140; 141) 'x': {unknown} |
3549 | [140; 147) 'x.foo()': {unknown} | 3549 | [140; 147) 'x.foo()': u64 |
3550 | [153; 154) 'y': &{unknown} | 3550 | [153; 154) 'y': &{unknown} |
3551 | [153; 160) 'y.foo()': {unknown} | 3551 | [153; 160) 'y.foo()': u64 |
3552 | [166; 167) 'z': {unknown} | 3552 | [166; 167) 'z': {unknown} |
3553 | [166; 173) 'z.foo()': {unknown} | 3553 | [166; 173) 'z.foo()': u64 |
3554 | "### | 3554 | "### |
3555 | ); | 3555 | ); |
3556 | } | 3556 | } |
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, |