use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
-use rustc::bug;
use rustc_ast::ast::*;
use rustc_ast::attr;
use rustc_ast::ptr::P as AstP;
Some(movability)
}
Some(hir::GeneratorKind::Async(_)) => {
- bug!("non-`async` closure body turned `async` during lowering");
+ panic!("non-`async` closure body turned `async` during lowering");
}
None => {
if movability == Movability::Static {
use super::{ImplTraitContext, ImplTraitPosition, ImplTraitTypeIdVisitor};
use crate::Arena;
-use rustc::bug;
use rustc_ast::ast::*;
use rustc_ast::attr;
use rustc_ast::node_id::NodeMap;
self.lower_param_bounds(bounds, ImplTraitContext::disallowed()),
),
ItemKind::MacroDef(..) | ItemKind::MacCall(..) => {
- bug!("`TyMac` should have been expanded by now")
+ panic!("`TyMac` should have been expanded by now")
}
}
(generics, kind)
}
- AssocItemKind::MacCall(..) => bug!("macro item shouldn't exist at this point"),
+ AssocItemKind::MacCall(..) => panic!("macro item shouldn't exist at this point"),
};
hir::TraitItem {
};
(generics, kind)
}
- AssocItemKind::MacCall(..) => bug!("`TyMac` should have been expanded by now"),
+ AssocItemKind::MacCall(..) => panic!("`TyMac` should have been expanded by now"),
};
hir::ImplItem {
use rustc::dep_graph::DepGraph;
use rustc::hir::map::definitions::{DefKey, DefPathData, Definitions};
-use rustc::{bug, span_bug};
use rustc_ast::ast;
use rustc_ast::ast::*;
use rustc_ast::attr;
fn expect_full_res(&mut self, id: NodeId) -> Res<NodeId> {
self.resolver.get_partial_res(id).map_or(Res::Err, |pr| {
if pr.unresolved_segments() != 0 {
- bug!("path not fully resolved: {:?}", pr);
+ panic!("path not fully resolved: {:?}", pr);
}
pr.base_res()
})
}
}
}
- TyKind::MacCall(_) => bug!("`TyKind::MacCall` should have been expanded by now"),
+ TyKind::MacCall(_) => panic!("`TyKind::MacCall` should have been expanded by now"),
TyKind::CVarArgs => {
self.sess.delay_span_bug(
t.span,
hir::LifetimeName::Param(param_name) => {
(param_name, hir::LifetimeParamKind::Explicit)
}
- _ => bug!("expected `LifetimeName::Param` or `ParamName::Plain`"),
+ _ => panic!("expected `LifetimeName::Param` or `ParamName::Plain`"),
};
self.output_lifetime_params.push(hir::GenericParam {
| hir::LifetimeName::Underscore
| hir::LifetimeName::Static => hir::ParamName::Plain(lt.name.ident()),
hir::LifetimeName::ImplicitObjectLifetimeDefault => {
- span_bug!(
+ self.sess.diagnostic().span_bug(
param.ident.span,
"object-lifetime-default should not occur here",
);
) -> hir::TraitRef<'hir> {
let path = match self.lower_qpath(p.ref_id, &None, &p.path, ParamMode::Explicit, itctx) {
hir::QPath::Resolved(None, path) => path,
- qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
+ qpath => panic!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
};
hir::TraitRef { path, hir_ref_id: self.lower_node_id(p.ref_id) }
}
use super::{AnonymousLifetimeMode, ImplTraitContext, LoweringContext, ParamMode};
use super::{GenericArgsCtor, ParenthesizedGenericArgs};
-use rustc::span_bug;
use rustc_ast::ast::{self, *};
use rustc_errors::{struct_span_err, Applicability};
use rustc_hir as hir;
}
// We should've returned in the for loop above.
- span_bug!(
+
+ self.sess.diagnostic().span_bug(
p.span,
- "lower_qpath: no final extension segment in {}..{}",
- proj_start,
- p.segments.len()
- )
+ &format!(
+ "lower_qpath: no final extension segment in {}..{}",
+ proj_start,
+ p.segments.len()
+ ),
+ );
}
crate fn lower_path_extra(