use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
use rustc::bug;
+use rustc_ast::ast::*;
+use rustc_ast::attr;
+use rustc_ast::ptr::P as AstP;
use rustc_data_structures::thin_vec::ThinVec;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::Res;
use rustc_span::source_map::{respan, DesugaringKind, Span, Spanned};
use rustc_span::symbol::{sym, Symbol};
-use syntax::ast::*;
-use syntax::attr;
-use syntax::ptr::P as AstP;
impl<'hir> LoweringContext<'_, 'hir> {
fn lower_exprs(&mut self, exprs: &[AstP<Expr>]) -> &'hir [hir::Expr<'hir>] {
e2: Option<&Expr>,
lims: RangeLimits,
) -> hir::ExprKind<'hir> {
- use syntax::ast::RangeLimits::*;
+ use rustc_ast::ast::RangeLimits::*;
let path = match (e1, e2, lims) {
(None, None, HalfOpen) => sym::RangeFull,
let from_err_expr =
self.wrap_in_try_constructor(sym::from_error, unstable_span, from_expr, try_span);
let thin_attrs = ThinVec::from(attrs);
- let catch_scope = self.catch_scopes.last().map(|x| *x);
+ let catch_scope = self.catch_scopes.last().copied();
let ret_expr = if let Some(catch_node) = catch_scope {
let target_id = Ok(self.lower_node_id(catch_node));
self.arena.alloc(self.expr(