Support $crate in item and expr place.

This commit is contained in:
uHOOCCOOHu 2019-09-27 01:59:38 +08:00
parent 8cd23a4fb8
commit 2ecb126f5c
No known key found for this signature in database
GPG key ID: CED392DE0C483D00
14 changed files with 268 additions and 37 deletions

View file

@ -132,6 +132,7 @@ impl GenericParams {
fn fill_params(&mut self, params: ast::TypeParamList, start: u32) {
for (idx, type_param) in params.type_params().enumerate() {
let name = type_param.name().map_or_else(Name::missing, |it| it.as_name());
// FIXME: Use `Path::from_src`
let default = type_param.default_type().and_then(|t| t.path()).and_then(Path::from_ast);
let param = GenericParam { idx: idx as u32 + start, name: name.clone(), default };