More accurate #[derive] parsing

This now allows full paths to the derive macro
This commit is contained in:
Jonas Schievink 2020-12-19 01:09:48 +01:00
parent c7b7c37ea5
commit ea5cc8d07a
4 changed files with 60 additions and 27 deletions

View file

@ -9,11 +9,8 @@ use std::{
use crate::{body::LowerCtx, type_ref::LifetimeRef};
use base_db::CrateId;
use hir_expand::{
hygiene::Hygiene,
name::{AsName, Name},
};
use syntax::ast::{self};
use hir_expand::{hygiene::Hygiene, name::Name};
use syntax::ast;
use crate::{
type_ref::{TypeBound, TypeRef},
@ -56,11 +53,6 @@ impl ModPath {
ModPath { kind, segments }
}
/// Converts an `tt::Ident` into a single-identifier `Path`.
pub(crate) fn from_tt_ident(ident: &tt::Ident) -> ModPath {
ident.as_name().into()
}
/// Calls `cb` with all paths, represented by this use item.
pub(crate) fn expand_use_item(
item_src: InFile<ast::Use>,