mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-03 21:25:25 +00:00 
			
		
		
		
	Merge pull request #20219 from ChayimFriedman2/expr-store-mem
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
		
			
				
	
				metrics / build_metrics (push) Waiting to run
				
			
		
			
				
	
				metrics / generate_final_metrics (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (self) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
				
			
		
			
				
	
				rustdoc / rustdoc (push) Waiting to run
				
			
		
		
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	metrics / build_metrics (push) Waiting to run
				
			metrics / generate_final_metrics (push) Blocked by required conditions
				
			metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
				
			metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
				
			metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
				
			metrics / other_metrics (self) (push) Blocked by required conditions
				
			metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
				
			rustdoc / rustdoc (push) Waiting to run
				
			perf: Put the expression stuff in the expression store behind an `Option<Box>`
This commit is contained in:
		
						commit
						4b29a9d6ea
					
				
					 28 changed files with 456 additions and 308 deletions
				
			
		| 
						 | 
				
			
			@ -2036,7 +2036,7 @@ impl DefWithBody {
 | 
			
		|||
                    )
 | 
			
		||||
                }
 | 
			
		||||
                let mol = &borrowck_result.mutability_of_locals;
 | 
			
		||||
                for (binding_id, binding_data) in body.bindings.iter() {
 | 
			
		||||
                for (binding_id, binding_data) in body.bindings() {
 | 
			
		||||
                    if binding_data.problems.is_some() {
 | 
			
		||||
                        // We should report specific diagnostics for these problems, not `need-mut` and `unused-mut`.
 | 
			
		||||
                        continue;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -677,8 +677,7 @@ impl<'db> SemanticsImpl<'db> {
 | 
			
		|||
    pub fn rename_conflicts(&self, to_be_renamed: &Local, new_name: &Name) -> Vec<Local> {
 | 
			
		||||
        let body = self.db.body(to_be_renamed.parent);
 | 
			
		||||
        let resolver = to_be_renamed.parent.resolver(self.db);
 | 
			
		||||
        let starting_expr =
 | 
			
		||||
            body.binding_owners.get(&to_be_renamed.binding_id).copied().unwrap_or(body.body_expr);
 | 
			
		||||
        let starting_expr = body.binding_owner(to_be_renamed.binding_id).unwrap_or(body.body_expr);
 | 
			
		||||
        let mut visitor = RenameConflictsVisitor {
 | 
			
		||||
            body: &body,
 | 
			
		||||
            conflicts: FxHashSet::default(),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -242,11 +242,7 @@ impl<'db> SourceAnalyzer<'db> {
 | 
			
		|||
 | 
			
		||||
    fn binding_id_of_pat(&self, pat: &ast::IdentPat) -> Option<BindingId> {
 | 
			
		||||
        let pat_id = self.pat_id(&pat.clone().into())?;
 | 
			
		||||
        if let Pat::Bind { id, .. } = self.store()?.pats[pat_id.as_pat()?] {
 | 
			
		||||
            Some(id)
 | 
			
		||||
        } else {
 | 
			
		||||
            None
 | 
			
		||||
        }
 | 
			
		||||
        if let Pat::Bind { id, .. } = self.store()?[pat_id.as_pat()?] { Some(id) } else { None }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pub(crate) fn expr_adjustments(&self, expr: &ast::Expr) -> Option<&[Adjustment]> {
 | 
			
		||||
| 
						 | 
				
			
			@ -995,7 +991,7 @@ impl<'db> SourceAnalyzer<'db> {
 | 
			
		|||
        let parent_hir_path = path
 | 
			
		||||
            .parent_path()
 | 
			
		||||
            .and_then(|p| collector.lower_path(p, &mut ExprCollector::impl_trait_error_allocator));
 | 
			
		||||
        let store = collector.store.finish();
 | 
			
		||||
        let (store, _) = collector.store.finish();
 | 
			
		||||
 | 
			
		||||
        // Case where path is a qualifier of a use tree, e.g. foo::bar::{Baz, Qux} where we are
 | 
			
		||||
        // trying to resolve foo::bar.
 | 
			
		||||
| 
						 | 
				
			
			@ -1204,7 +1200,7 @@ impl<'db> SourceAnalyzer<'db> {
 | 
			
		|||
        let mut collector = ExprCollector::new(db, self.resolver.module(), self.file_id);
 | 
			
		||||
        let hir_path =
 | 
			
		||||
            collector.lower_path(path.clone(), &mut ExprCollector::impl_trait_error_allocator)?;
 | 
			
		||||
        let store = collector.store.finish();
 | 
			
		||||
        let (store, _) = collector.store.finish();
 | 
			
		||||
        Some(resolve_hir_path_(
 | 
			
		||||
            db,
 | 
			
		||||
            &self.resolver,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue