Yeet E0744

This commit is contained in:
Michael Goulet 2023-11-28 20:40:38 +00:00
parent f2c500bb43
commit dd5abb50cc
4 changed files with 8 additions and 15 deletions

View File

@ -653,3 +653,4 @@
// E0721, // `await` keyword // E0721, // `await` keyword
// E0723, // unstable feature in `const` context // E0723, // unstable feature in `const` context
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`. // E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
// E0744, // merged into E0728

View File

@ -1,8 +1,10 @@
#### Note: this error code is no longer emitted by the compiler.
An unsupported expression was used inside a const context. An unsupported expression was used inside a const context.
Erroneous code example: Erroneous code example:
```compile_fail,edition2018,E0744 ```ignore (removed error code)
const _: i32 = { const _: i32 = {
async { 0 }.await async { 0 }.await
}; };

View File

@ -17,7 +17,7 @@
use rustc_session::parse::feature_err; use rustc_session::parse::feature_err;
use rustc_span::{sym, Span, Symbol}; use rustc_span::{sym, Span, Symbol};
use crate::errors::{ExprNotAllowedInContext, SkippingConstChecks}; use crate::errors::SkippingConstChecks;
/// An expression that is not *always* legal in a const context. /// An expression that is not *always* legal in a const context.
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
@ -138,11 +138,10 @@ fn const_check_violated(&self, expr: NonConstExpr, span: Span) {
match missing_gates.as_slice() { match missing_gates.as_slice() {
[] => { [] => {
tcx.sess.emit_err(ExprNotAllowedInContext { span_bug!(
span, span,
expr: expr.name(), "we should not have reached this point, since `.await` is denied earlier"
context: const_kind.keyword_name(), );
});
} }
[missing_primary, ref missing_secondary @ ..] => { [missing_primary, ref missing_secondary @ ..] => {

View File

@ -1005,15 +1005,6 @@ pub struct FeaturePreviouslyDeclared<'a, 'b> {
pub prev_declared: &'b str, pub prev_declared: &'b str,
} }
#[derive(Diagnostic)]
#[diag(passes_expr_not_allowed_in_context, code = "E0744")]
pub struct ExprNotAllowedInContext<'a> {
#[primary_span]
pub span: Span,
pub expr: String,
pub context: &'a str,
}
pub struct BreakNonLoop<'a> { pub struct BreakNonLoop<'a> {
pub span: Span, pub span: Span,
pub head: Option<Span>, pub head: Option<Span>,