Add query for const_param_default
This commit is contained in:
parent
0e56a086f7
commit
9fe793ae5d
17 changed files with 108 additions and 27 deletions
|
@ -93,6 +93,12 @@ rustc_queries! {
|
|||
desc { |tcx| "computing the optional const parameter of `{}`", tcx.def_path_str(key.to_def_id()) }
|
||||
}
|
||||
|
||||
/// Given the def_id of a const-generic parameter, computes the associated default const
|
||||
/// parameter. i.e. `fn example<const N: usize=3>` called on N would return 3.
|
||||
query const_param_default(param: DefId) -> &'tcx ty::Const<'tcx> {
|
||||
desc { |tcx| "compute const default for a given parameter `{}`", tcx.def_path_str(param) }
|
||||
}
|
||||
|
||||
/// Records the type of every item.
|
||||
query type_of(key: DefId) -> Ty<'tcx> {
|
||||
desc { |tcx| "computing type of `{}`", tcx.def_path_str(key) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue