Use Symbol in Name

This commit is contained in:
Lukas Wirth 2024-07-12 15:57:54 +02:00
parent 843806b79f
commit 3fe815b0f3
75 changed files with 750 additions and 755 deletions

View file

@ -6,9 +6,9 @@ use crate::{lower::LowerCtx, type_ref::ConstRef};
use hir_expand::{
mod_path::resolve_crate_root,
name::{name, AsName},
name::{AsName, Name},
};
use intern::Interned;
use intern::{sym, Interned};
use syntax::ast::{self, AstNode, HasGenericArgs, HasTypeBounds};
use crate::{
@ -60,7 +60,7 @@ pub(super) fn lower_path(ctx: &LowerCtx<'_>, mut path: ast::Path) -> Option<Path
segments.push(name);
}
ast::PathSegmentKind::SelfTypeKw => {
segments.push(name![Self]);
segments.push(Name::new_symbol_root(sym::Self_));
}
ast::PathSegmentKind::Type { type_ref, trait_ref } => {
assert!(path.qualifier().is_none()); // this can only occur at the first segment
@ -268,7 +268,7 @@ fn lower_generic_args_from_fn_path(
let bindings = if let Some(ret_type) = ret_type {
let type_ref = TypeRef::from_ast_opt(ctx, ret_type.ty());
Box::new([AssociatedTypeBinding {
name: name![Output],
name: Name::new_symbol_root(sym::Output),
args: None,
type_ref: Some(type_ref),
bounds: Box::default(),
@ -277,7 +277,7 @@ fn lower_generic_args_from_fn_path(
// -> ()
let type_ref = TypeRef::Tuple(Vec::new());
Box::new([AssociatedTypeBinding {
name: name![Output],
name: Name::new_symbol_root(sym::Output),
args: None,
type_ref: Some(type_ref),
bounds: Box::default(),