|
38 | 38 |
|
39 | 39 | use rustc::dep_graph::DepGraph;
|
40 | 40 | use rustc::hir::map::definitions::{DefKey, DefPathData, Definitions};
|
41 |
| -use rustc::{bug, span_bug}; |
42 | 41 | use rustc_ast::ast;
|
43 | 42 | use rustc_ast::ast::*;
|
44 | 43 | use rustc_ast::attr;
|
@@ -675,7 +674,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
675 | 674 | fn expect_full_res(&mut self, id: NodeId) -> Res<NodeId> {
|
676 | 675 | self.resolver.get_partial_res(id).map_or(Res::Err, |pr| {
|
677 | 676 | if pr.unresolved_segments() != 0 {
|
678 |
| - bug!("path not fully resolved: {:?}", pr); |
| 677 | + panic!("path not fully resolved: {:?}", pr); |
679 | 678 | }
|
680 | 679 | pr.base_res()
|
681 | 680 | })
|
@@ -1343,7 +1342,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
1343 | 1342 | }
|
1344 | 1343 | }
|
1345 | 1344 | }
|
1346 |
| - TyKind::MacCall(_) => bug!("`TyKind::MacCall` should have been expanded by now"), |
| 1345 | + TyKind::MacCall(_) => panic!("`TyKind::MacCall` should have been expanded by now"), |
1347 | 1346 | TyKind::CVarArgs => {
|
1348 | 1347 | self.sess.delay_span_bug(
|
1349 | 1348 | t.span,
|
@@ -1578,7 +1577,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
1578 | 1577 | hir::LifetimeName::Param(param_name) => {
|
1579 | 1578 | (param_name, hir::LifetimeParamKind::Explicit)
|
1580 | 1579 | }
|
1581 |
| - _ => bug!("expected `LifetimeName::Param` or `ParamName::Plain`"), |
| 1580 | + _ => panic!("expected `LifetimeName::Param` or `ParamName::Plain`"), |
1582 | 1581 | };
|
1583 | 1582 |
|
1584 | 1583 | self.output_lifetime_params.push(hir::GenericParam {
|
@@ -2099,7 +2098,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
2099 | 2098 | | hir::LifetimeName::Underscore
|
2100 | 2099 | | hir::LifetimeName::Static => hir::ParamName::Plain(lt.name.ident()),
|
2101 | 2100 | hir::LifetimeName::ImplicitObjectLifetimeDefault => {
|
2102 |
| - span_bug!( |
| 2101 | + self.sess.diagnostic().span_bug( |
2103 | 2102 | param.ident.span,
|
2104 | 2103 | "object-lifetime-default should not occur here",
|
2105 | 2104 | );
|
@@ -2166,7 +2165,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
2166 | 2165 | ) -> hir::TraitRef<'hir> {
|
2167 | 2166 | let path = match self.lower_qpath(p.ref_id, &None, &p.path, ParamMode::Explicit, itctx) {
|
2168 | 2167 | hir::QPath::Resolved(None, path) => path,
|
2169 |
| - qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath), |
| 2168 | + qpath => panic!("lower_trait_ref: unexpected QPath `{:?}`", qpath), |
2170 | 2169 | };
|
2171 | 2170 | hir::TraitRef { path, hir_ref_id: self.lower_node_id(p.ref_id) }
|
2172 | 2171 | }
|
|
0 commit comments