Skip to content

Commit dd5abb5

Browse files
Yeet E0744
1 parent f2c500b commit dd5abb5

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

compiler/rustc_error_codes/src/error_codes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -653,3 +653,4 @@ E0795: include_str!("./error_codes/E0795.md"),
653653
// E0721, // `await` keyword
654654
// E0723, // unstable feature in `const` context
655655
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
656+
// E0744, // merged into E0728

compiler/rustc_error_codes/src/error_codes/E0744.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
13
An unsupported expression was used inside a const context.
24

35
Erroneous code example:
46

5-
```compile_fail,edition2018,E0744
7+
```ignore (removed error code)
68
const _: i32 = {
79
async { 0 }.await
810
};

compiler/rustc_passes/src/check_const.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_middle::ty::TyCtxt;
1717
use rustc_session::parse::feature_err;
1818
use rustc_span::{sym, Span, Symbol};
1919

20-
use crate::errors::{ExprNotAllowedInContext, SkippingConstChecks};
20+
use crate::errors::SkippingConstChecks;
2121

2222
/// An expression that is not *always* legal in a const context.
2323
#[derive(Clone, Copy)]
@@ -138,11 +138,10 @@ impl<'tcx> CheckConstVisitor<'tcx> {
138138

139139
match missing_gates.as_slice() {
140140
[] => {
141-
tcx.sess.emit_err(ExprNotAllowedInContext {
141+
span_bug!(
142142
span,
143-
expr: expr.name(),
144-
context: const_kind.keyword_name(),
145-
});
143+
"we should not have reached this point, since `.await` is denied earlier"
144+
);
146145
}
147146

148147
[missing_primary, ref missing_secondary @ ..] => {

compiler/rustc_passes/src/errors.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1005,15 +1005,6 @@ pub struct FeaturePreviouslyDeclared<'a, 'b> {
10051005
pub prev_declared: &'b str,
10061006
}
10071007

1008-
#[derive(Diagnostic)]
1009-
#[diag(passes_expr_not_allowed_in_context, code = "E0744")]
1010-
pub struct ExprNotAllowedInContext<'a> {
1011-
#[primary_span]
1012-
pub span: Span,
1013-
pub expr: String,
1014-
pub context: &'a str,
1015-
}
1016-
10171008
pub struct BreakNonLoop<'a> {
10181009
pub span: Span,
10191010
pub head: Option<Span>,

0 commit comments

Comments
 (0)