Skip to content

Commit 7ca0eb8

Browse files
committed
fix rebase mistakes
1 parent 2a0f2cd commit 7ca0eb8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ enum SelfSemantic {
3737
}
3838

3939
/// What is the context that prevents using `~const`?
40-
enum DisallowTildeConstContext<'a> {
40+
pub(crate) enum DisallowTildeConstContext<'a> {
4141
TraitObject,
4242
Fn(FnKind<'a>),
4343
}

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! Errors emitted by ast_passes.
22
3-
use rustc_ast::ParamKindOrd;
3+
use rustc_ast::{visit::FnKind, ParamKindOrd};
44
use rustc_errors::{fluent, AddToDiagnostic, Applicability, Diagnostic, SubdiagnosticMessage};
55
use rustc_macros::{Diagnostic, Subdiagnostic};
66
use rustc_span::{Span, Symbol};
77

8-
use crate::ast_validation::ForbiddenLetReason;
8+
use crate::ast_validation::{DisallowTildeConstContext, ForbiddenLetReason};
99

1010
#[derive(Diagnostic)]
1111
#[diag(ast_passes_forbidden_let)]
@@ -584,26 +584,26 @@ pub struct TraitObjectWithMaybe {
584584
#[derive(Diagnostic)]
585585
#[diag(ast_passes::forbidden_maybe_const)]
586586
#[note]
587-
pub struct ForbiddenMaybeConst {
587+
pub struct ForbiddenMaybeConst<'a, 'b> {
588588
#[primary_span]
589589
pub span: Span,
590590
#[subdiagnostic]
591-
pub reason: DisallowTildeConstContext,
591+
pub(crate) reason: &'a DisallowTildeConstContext<'b>,
592592
}
593593

594-
impl AddToDiagnostic for DisallowTildeConstContext {
594+
impl<'a> AddToDiagnostic for &'a DisallowTildeConstContext<'_> {
595595
fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, _: F)
596596
where
597597
F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,
598598
{
599599
match self {
600-
Self::TraitObject => {
600+
DisallowTildeConstContext::TraitObject => {
601601
diag.note(fluent::ast_passes::trait_object);
602602
}
603-
Self::Fn(FnKind::Closure(..)) => {
603+
DisallowTildeConstContext::Fn(FnKind::Closure(..)) => {
604604
diag.note(fluent::ast_passes::closure);
605605
}
606-
Self::Fn(FnKind::Fn(_, ident, ..)) => {
606+
DisallowTildeConstContext::Fn(FnKind::Fn(_, ident, ..)) => {
607607
diag.span_note(ident.span, fluent::ast_passes::fn_not_const);
608608
}
609609
}

0 commit comments

Comments
 (0)