From dfe187d348aa74b47c4caaac112945adfd47456e Mon Sep 17 00:00:00 2001 From: ljedrz Date: Wed, 19 Dec 2018 17:36:39 +0100 Subject: [PATCH] query: simplify stack trimming in cycle_check --- src/librustc/ty/query/job.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs index 4ee5ef6b1fd0..709d6201d4f5 100644 --- a/src/librustc/ty/query/job.rs +++ b/src/librustc/ty/query/job.rs @@ -295,7 +295,7 @@ fn cycle_check<'tcx>(query: Lrc>, // We detected a query cycle, fix up the initial span and return Some // Remove previous stack entries - stack.splice(0..p, iter::empty()); + stack.drain(0..p); // Replace the span for the first query with the cycle cause stack[0].0 = span; Some(None)