Skip to content

Commit fb10e5c

Browse files
committed
Resolve some review comments
1 parent 410cdd7 commit fb10e5c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/librustc/middle/limits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_data_structures::sync::Once;
1818
// `ensure_sufficient_stack`.
1919
const RED_ZONE: usize = 100 * 1024; // 100k
2020

21-
// Ony the first stack that is pushed, grows exponentially (2^n * STACK_PER_RECURSION) from then
21+
// Only the first stack that is pushed, grows exponentially (2^n * STACK_PER_RECURSION) from then
2222
// on. This flag has performance relevant characteristics. Don't set it too high.
2323
const STACK_PER_RECURSION: usize = 1 * 1024 * 1024; // 1MB
2424

@@ -27,7 +27,7 @@ const STACK_PER_RECURSION: usize = 1 * 1024 * 1024; // 1MB
2727
/// from this.
2828
///
2929
/// Should not be sprinkled around carelessly, as it causes a little bit of overhead.
30-
pub fn ensure_sufficient_stack<R, F: FnOnce() -> R>(f: F) -> R {
30+
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
3131
stacker::maybe_grow(RED_ZONE, STACK_PER_RECURSION, f)
3232
}
3333

src/librustc_ast_lowering/expr.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
22

3-
use rustc::bug;
43
use rustc::middle::limits::ensure_sufficient_stack;
4+
use rustc::{bug, span_bug};
55
use rustc_ast::ast::*;
66
use rustc_ast::attr;
77
use rustc_ast::ptr::P as AstP;
@@ -210,9 +210,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
210210
ExprKind::Yield(ref opt_expr) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
211211
ExprKind::Err => hir::ExprKind::Err,
212212
ExprKind::Try(ref sub_expr) => self.lower_expr_try(e.span, sub_expr),
213-
214213
ExprKind::ForLoop(..) | ExprKind::Paren(_) => {
215-
span_bug!(e.span, "Should be handled by `lower_expr`")
214+
span_bug!(e.span, "Should have been handled by `lower_expr`")
216215
}
217216
ExprKind::MacCall(_) => span_bug!(e.span, "Shouldn't exist here"),
218217
}

src/librustc_ast_lowering/pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
8585
// If we reach here the `..` pattern is not semantically allowed.
8686
self.ban_illegal_rest_pat(p.span)
8787
}
88-
PatKind::Paren(_) => span_bug!(p.span, "Should be handled by `lower_pat`"),
88+
PatKind::Paren(_) => span_bug!(p.span, "Should have been handled by `lower_pat`"),
8989
PatKind::MacCall(_) => span_bug!(p.span, "Shouldn't exist here"),
9090
}
9191
}

0 commit comments

Comments
 (0)