mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-17 10:52:57 +00:00
Make GenericParamsCollector::type_or_consts not unnecessarily pub(crate)
This commit is contained in:
parent
44f18c3d05
commit
9780734028
2 changed files with 15 additions and 10 deletions
|
|
@ -21,7 +21,7 @@ use triomphe::Arc;
|
|||
|
||||
use crate::{
|
||||
db::DefDatabase,
|
||||
generics::{GenericParams, GenericParamsCollector, TypeParamData, TypeParamProvenance},
|
||||
generics::{GenericParams, GenericParamsCollector},
|
||||
item_tree::{
|
||||
AssocItem, AttrOwner, Const, Either, Enum, ExternBlock, ExternCrate, Field, FieldParent,
|
||||
FieldsShape, FileItemTreeId, FnFlags, Function, GenericArgs, GenericItemSourceMapBuilder,
|
||||
|
|
@ -881,14 +881,7 @@ impl<'a> Ctx<'a> {
|
|||
|
||||
if let HasImplicitSelf::Yes(bounds) = has_implicit_self {
|
||||
// Traits and trait aliases get the Self type as an implicit first type parameter.
|
||||
generics.type_or_consts.alloc(
|
||||
TypeParamData {
|
||||
name: Some(Name::new_symbol_root(sym::Self_.clone())),
|
||||
default: None,
|
||||
provenance: TypeParamProvenance::TraitSelf,
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
generics.fill_self_param();
|
||||
// add super traits as bounds on Self
|
||||
// i.e., `trait Foo: Bar` is equivalent to `trait Foo where Self: Bar`
|
||||
let bound_target = Either::Left(body_ctx.alloc_type_ref_desugared(TypeRef::Path(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue