aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-20 11:43:19 +0000
committerGitHub <[email protected]>2019-12-20 11:43:19 +0000
commit65377620245bda207145742595a7bd878e14f7ec (patch)
treed2016e6e3ce596e6a4b3e44f4894b5a411c62789 /crates/ra_hir
parent6e9335d311c058986c4bbef5aadbe208b87f63c7 (diff)
parentf42697e54b9d0a040011cb04c266d51710e249f1 (diff)
Merge #2608
2608: Support for nested traits r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 8dbc0d667..35e1f752b 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -269,7 +269,7 @@ pub struct Struct {
269 269
270impl Struct { 270impl Struct {
271 pub fn module(self, db: &impl DefDatabase) -> Module { 271 pub fn module(self, db: &impl DefDatabase) -> Module {
272 Module { id: self.id.lookup(db).container } 272 Module { id: self.id.lookup(db).container.module(db) }
273 } 273 }
274 274
275 pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> { 275 pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> {
@@ -290,7 +290,7 @@ impl Struct {
290 } 290 }
291 291
292 pub fn ty(self, db: &impl HirDatabase) -> Type { 292 pub fn ty(self, db: &impl HirDatabase) -> Type {
293 Type::from_def(db, self.id.lookup(db).container.krate, self.id) 293 Type::from_def(db, self.id.lookup(db).container.module(db).krate, self.id)
294 } 294 }
295 295
296 fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> { 296 fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> {
@@ -309,11 +309,11 @@ impl Union {
309 } 309 }
310 310
311 pub fn module(self, db: &impl DefDatabase) -> Module { 311 pub fn module(self, db: &impl DefDatabase) -> Module {
312 Module { id: self.id.lookup(db).container } 312 Module { id: self.id.lookup(db).container.module(db) }
313 } 313 }
314 314
315 pub fn ty(self, db: &impl HirDatabase) -> Type { 315 pub fn ty(self, db: &impl HirDatabase) -> Type {
316 Type::from_def(db, self.id.lookup(db).container.krate, self.id) 316 Type::from_def(db, self.id.lookup(db).container.module(db).krate, self.id)
317 } 317 }
318 318
319 pub fn fields(self, db: &impl HirDatabase) -> Vec<StructField> { 319 pub fn fields(self, db: &impl HirDatabase) -> Vec<StructField> {
@@ -337,7 +337,7 @@ pub struct Enum {
337 337
338impl Enum { 338impl Enum {
339 pub fn module(self, db: &impl DefDatabase) -> Module { 339 pub fn module(self, db: &impl DefDatabase) -> Module {
340 Module { id: self.id.lookup(db).container } 340 Module { id: self.id.lookup(db).container.module(db) }
341 } 341 }
342 342
343 pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> { 343 pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> {
@@ -357,7 +357,7 @@ impl Enum {
357 } 357 }
358 358
359 pub fn ty(self, db: &impl HirDatabase) -> Type { 359 pub fn ty(self, db: &impl HirDatabase) -> Type {
360 Type::from_def(db, self.id.lookup(db).container.krate, self.id) 360 Type::from_def(db, self.id.lookup(db).container.module(db).krate, self.id)
361 } 361 }
362} 362}
363 363
@@ -553,7 +553,7 @@ pub struct Trait {
553 553
554impl Trait { 554impl Trait {
555 pub fn module(self, db: &impl DefDatabase) -> Module { 555 pub fn module(self, db: &impl DefDatabase) -> Module {
556 Module { id: self.id.lookup(db).container } 556 Module { id: self.id.lookup(db).container.module(db) }
557 } 557 }
558 558
559 pub fn name(self, db: &impl DefDatabase) -> Name { 559 pub fn name(self, db: &impl DefDatabase) -> Name {