aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-20 17:50:34 +0000
committerAleksey Kladov <[email protected]>2019-11-20 17:50:34 +0000
commit12ec946216a3637685f30ae359bc955313595a22 (patch)
tree62cbd8b20865648660be5a7b9dd7a65486e54535 /crates/ra_hir_def/src
parentcb642fc578100c0945088accb85acb8f03d2e1fd (diff)
Simplify generic params
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/generics.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs
index f794eefbc..9e2e4c3cc 100644
--- a/crates/ra_hir_def/src/generics.rs
+++ b/crates/ra_hir_def/src/generics.rs
@@ -25,7 +25,6 @@ pub struct GenericParam {
25/// Data about the generic parameters of a function, struct, impl, etc. 25/// Data about the generic parameters of a function, struct, impl, etc.
26#[derive(Clone, PartialEq, Eq, Debug)] 26#[derive(Clone, PartialEq, Eq, Debug)]
27pub struct GenericParams { 27pub struct GenericParams {
28 pub def: GenericDefId,
29 pub parent_params: Option<Arc<GenericParams>>, 28 pub parent_params: Option<Arc<GenericParams>>,
30 pub params: Vec<GenericParam>, 29 pub params: Vec<GenericParam>,
31 pub where_predicates: Vec<WherePredicate>, 30 pub where_predicates: Vec<WherePredicate>,
@@ -56,7 +55,7 @@ impl GenericParams {
56 parent_params: Option<Arc<GenericParams>>, 55 parent_params: Option<Arc<GenericParams>>,
57 ) -> GenericParams { 56 ) -> GenericParams {
58 let mut generics = 57 let mut generics =
59 GenericParams { def, params: Vec::new(), parent_params, where_predicates: Vec::new() }; 58 GenericParams { params: Vec::new(), parent_params, where_predicates: Vec::new() };
60 let start = generics.parent_params.as_ref().map(|p| p.params.len()).unwrap_or(0) as u32; 59 let start = generics.parent_params.as_ref().map(|p| p.params.len()).unwrap_or(0) as u32;
61 // FIXME: add `: Sized` bound for everything except for `Self` in traits 60 // FIXME: add `: Sized` bound for everything except for `Self` in traits
62 match def { 61 match def {