Skip to content

Commit 8c4d1ae

Browse files
author
bors-servo
authored
Auto merge of #515 - fitzgen:monotone-framework, r=emilio
Discover which template type parameters are actually used This is just landing the initial analysis, and does not start leveraging this analysis's results instead of using the `Item::signature_contains_named_type` method yet. r? @emilio
2 parents f1caa10 + 12b2452 commit 8c4d1ae

File tree

4 files changed

+487
-0
lines changed

4 files changed

+487
-0
lines changed

src/ir/item.rs

+7
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,13 @@ impl Item {
472472
self.kind().as_type()
473473
}
474474

475+
/// Is this item a named template type parameter?
476+
pub fn is_named(&self) -> bool {
477+
self.as_type()
478+
.map(|ty| ty.is_named())
479+
.unwrap_or(false)
480+
}
481+
475482
/// Get a reference to this item's underlying `Function`. Panic if this is
476483
/// some other kind of item.
477484
pub fn expect_function(&self) -> &Function {

src/ir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub mod item;
1414
pub mod item_kind;
1515
pub mod layout;
1616
pub mod module;
17+
pub mod named;
1718
pub mod traversal;
1819
pub mod ty;
1920
pub mod var;

0 commit comments

Comments
 (0)