From 62a104df983522de8fe06ff866a47b3938fbd561 Mon Sep 17 00:00:00 2001 From: Veera Date: Tue, 16 Apr 2024 18:15:37 -0400 Subject: [PATCH 1/9] Update Tests --- .../c-variadic/variadic-ffi-no-fixed-args.rs | 5 +- .../variadic-ffi-no-fixed-args.stderr | 8 -- .../variadic-ffi-semantic-restrictions.rs | 8 -- .../variadic-ffi-semantic-restrictions.stderr | 112 ++++++------------ 4 files changed, 39 insertions(+), 94 deletions(-) delete mode 100644 tests/ui/c-variadic/variadic-ffi-no-fixed-args.stderr diff --git a/tests/ui/c-variadic/variadic-ffi-no-fixed-args.rs b/tests/ui/c-variadic/variadic-ffi-no-fixed-args.rs index 588c15a182977..b8841e88c4f49 100644 --- a/tests/ui/c-variadic/variadic-ffi-no-fixed-args.rs +++ b/tests/ui/c-variadic/variadic-ffi-no-fixed-args.rs @@ -1,6 +1,9 @@ +//@ build-pass + +// Supported since C23 +// https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2975.pdf extern "C" { fn foo(...); -//~^ ERROR C-variadic function must be declared with at least one named argument } fn main() {} diff --git a/tests/ui/c-variadic/variadic-ffi-no-fixed-args.stderr b/tests/ui/c-variadic/variadic-ffi-no-fixed-args.stderr deleted file mode 100644 index e268ef3fa6814..0000000000000 --- a/tests/ui/c-variadic/variadic-ffi-no-fixed-args.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-no-fixed-args.rs:2:12 - | -LL | fn foo(...); - | ^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs index a2d2388ff5088..11126dbc65d25 100644 --- a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs +++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs @@ -8,14 +8,12 @@ fn f1_1(x: isize, ...) {} fn f1_2(...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic -//~| ERROR C-variadic function must be declared with at least one named argument extern "C" fn f2_1(x: isize, ...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic extern "C" fn f2_2(...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic -//~| ERROR C-variadic function must be declared with at least one named argument extern "C" fn f2_3(..., x: isize) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic @@ -26,7 +24,6 @@ extern "C" fn f3_1(x: isize, ...) {} extern "C" fn f3_2(...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic -//~| ERROR C-variadic function must be declared with at least one named argument extern "C" fn f3_3(..., x: isize) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic @@ -47,8 +44,6 @@ const extern "C" fn f4_3(..., x: isize, ...) {} //~| ERROR `...` must be the last argument of a C-variadic function extern "C" { - fn e_f1(...); - //~^ ERROR C-variadic function must be declared with at least one named argument fn e_f2(..., x: isize); //~^ ERROR `...` must be the last argument of a C-variadic function } @@ -60,7 +55,6 @@ impl X { //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic fn i_f2(...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic - //~| ERROR C-variadic function must be declared with at least one named argument fn i_f3(..., x: isize, ...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic //~| ERROR `...` must be the last argument of a C-variadic function @@ -80,10 +74,8 @@ trait T { //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic fn t_f3(...) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic - //~| ERROR C-variadic function must be declared with at least one named argument fn t_f4(...); //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic - //~| ERROR C-variadic function must be declared with at least one named argument fn t_f5(..., x: isize) {} //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic //~| ERROR `...` must be the last argument of a C-variadic function diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr index 6a65ed79d4fbc..f71e3863440f5 100644 --- a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr +++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr @@ -4,12 +4,6 @@ error: only foreign or `unsafe extern "C"` functions may be C-variadic LL | fn f1_1(x: isize, ...) {} | ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9 - | -LL | fn f1_2(...) {} - | ^^^ - error: only foreign or `unsafe extern "C"` functions may be C-variadic --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9 | @@ -17,91 +11,79 @@ LL | fn f1_2(...) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:13:30 + --> $DIR/variadic-ffi-semantic-restrictions.rs:12:30 | LL | extern "C" fn f2_1(x: isize, ...) {} | ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:16:20 - | -LL | extern "C" fn f2_2(...) {} - | ^^^ - error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:16:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:15:20 | LL | extern "C" fn f2_2(...) {} | ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:20:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:18:20 | LL | extern "C" fn f2_3(..., x: isize) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:20:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:18:20 | LL | extern "C" fn f2_3(..., x: isize) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:24:30 + --> $DIR/variadic-ffi-semantic-restrictions.rs:22:30 | LL | extern "C" fn f3_1(x: isize, ...) {} | ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:27:20 - | -LL | extern "C" fn f3_2(...) {} - | ^^^ - error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:27:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:25:20 | LL | extern "C" fn f3_2(...) {} | ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:31:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:28:20 | LL | extern "C" fn f3_3(..., x: isize) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:31:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:28:20 | LL | extern "C" fn f3_3(..., x: isize) {} | ^^^ error: functions cannot be both `const` and C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:35:1 + --> $DIR/variadic-ffi-semantic-restrictions.rs:32:1 | LL | const unsafe extern "C" fn f4_1(x: isize, ...) {} | ^^^^^ `const` because of this ^^^ C-variadic because of this error: functions cannot be both `const` and C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:39:1 + --> $DIR/variadic-ffi-semantic-restrictions.rs:36:1 | LL | const extern "C" fn f4_2(x: isize, ...) {} | ^^^^^ `const` because of this ^^^ C-variadic because of this error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:39:36 + --> $DIR/variadic-ffi-semantic-restrictions.rs:36:36 | LL | const extern "C" fn f4_2(x: isize, ...) {} | ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:44:26 + --> $DIR/variadic-ffi-semantic-restrictions.rs:41:26 | LL | const extern "C" fn f4_3(..., x: isize, ...) {} | ^^^ error: functions cannot be both `const` and C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:44:1 + --> $DIR/variadic-ffi-semantic-restrictions.rs:41:1 | LL | const extern "C" fn f4_3(..., x: isize, ...) {} | ^^^^^ ^^^ ^^^ C-variadic because of this @@ -110,67 +92,55 @@ LL | const extern "C" fn f4_3(..., x: isize, ...) {} | `const` because of this error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:44:26 + --> $DIR/variadic-ffi-semantic-restrictions.rs:41:26 | LL | const extern "C" fn f4_3(..., x: isize, ...) {} | ^^^ ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:50:13 - | -LL | fn e_f1(...); - | ^^^ - error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:52:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:47:13 | LL | fn e_f2(..., x: isize); | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:59:23 + --> $DIR/variadic-ffi-semantic-restrictions.rs:54:23 | LL | fn i_f1(x: isize, ...) {} | ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:61:13 - | -LL | fn i_f2(...) {} - | ^^^ - error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:61:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:56:13 | LL | fn i_f2(...) {} | ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:64:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:58:13 | LL | fn i_f3(..., x: isize, ...) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:64:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:58:13 | LL | fn i_f3(..., x: isize, ...) {} | ^^^ ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:67:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:61:13 | LL | fn i_f4(..., x: isize, ...) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:67:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:61:13 | LL | fn i_f4(..., x: isize, ...) {} | ^^^ ^^^ error: functions cannot be both `const` and C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:70:5 + --> $DIR/variadic-ffi-semantic-restrictions.rs:64:5 | LL | const fn i_f5(x: isize, ...) {} | ^^^^^ ^^^ C-variadic because of this @@ -178,73 +148,61 @@ LL | const fn i_f5(x: isize, ...) {} | `const` because of this error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:70:29 + --> $DIR/variadic-ffi-semantic-restrictions.rs:64:29 | LL | const fn i_f5(x: isize, ...) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:77:23 + --> $DIR/variadic-ffi-semantic-restrictions.rs:71:23 | LL | fn t_f1(x: isize, ...) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:79:23 + --> $DIR/variadic-ffi-semantic-restrictions.rs:73:23 | LL | fn t_f2(x: isize, ...); | ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:81:13 - | -LL | fn t_f3(...) {} - | ^^^ - error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:81:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:75:13 | LL | fn t_f3(...) {} | ^^^ -error: C-variadic function must be declared with at least one named argument - --> $DIR/variadic-ffi-semantic-restrictions.rs:84:13 - | -LL | fn t_f4(...); - | ^^^ - error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:84:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:77:13 | LL | fn t_f4(...); | ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:87:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:79:13 | LL | fn t_f5(..., x: isize) {} | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:87:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:79:13 | LL | fn t_f5(..., x: isize) {} | ^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:90:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:82:13 | LL | fn t_f6(..., x: isize); | ^^^ error: only foreign or `unsafe extern "C"` functions may be C-variadic - --> $DIR/variadic-ffi-semantic-restrictions.rs:90:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:82:13 | LL | fn t_f6(..., x: isize); | ^^^ error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time - --> $DIR/variadic-ffi-semantic-restrictions.rs:35:43 + --> $DIR/variadic-ffi-semantic-restrictions.rs:32:43 | LL | const unsafe extern "C" fn f4_1(x: isize, ...) {} | ^^^ - value is dropped here @@ -252,7 +210,7 @@ LL | const unsafe extern "C" fn f4_1(x: isize, ...) {} | the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time - --> $DIR/variadic-ffi-semantic-restrictions.rs:39:36 + --> $DIR/variadic-ffi-semantic-restrictions.rs:36:36 | LL | const extern "C" fn f4_2(x: isize, ...) {} | ^^^ - value is dropped here @@ -260,13 +218,13 @@ LL | const extern "C" fn f4_2(x: isize, ...) {} | the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time - --> $DIR/variadic-ffi-semantic-restrictions.rs:70:29 + --> $DIR/variadic-ffi-semantic-restrictions.rs:64:29 | LL | const fn i_f5(x: isize, ...) {} | ^^^ - value is dropped here | | | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 43 previous errors +error: aborting due to 36 previous errors For more information about this error, try `rustc --explain E0493`. From f005b451c2eeb018e3c2c6e6653636981cfa7f1a Mon Sep 17 00:00:00 2001 From: Veera Date: Tue, 16 Apr 2024 18:53:05 -0400 Subject: [PATCH 2/9] Support C23's Variadics Without a Named Parameter This PR removes the static check that disallowed extern functions with ellipsis (varargs) as the only parameter since this is now valid in C23. Also, adds a doc comment for `check_decl_cvariadic_pos()` and fixes the name of the function (`varadic` -> `variadic`). --- compiler/rustc_ast_passes/messages.ftl | 3 --- compiler/rustc_ast_passes/src/ast_validation.rs | 12 +++++------- compiler/rustc_ast_passes/src/errors.rs | 7 ------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_ast_passes/messages.ftl b/compiler/rustc_ast_passes/messages.ftl index a3731e94276b5..f578165f369cb 100644 --- a/compiler/rustc_ast_passes/messages.ftl +++ b/compiler/rustc_ast_passes/messages.ftl @@ -97,9 +97,6 @@ ast_passes_fn_body_extern = incorrect function inside `extern` block ast_passes_fn_param_c_var_args_not_last = `...` must be the last argument of a C-variadic function -ast_passes_fn_param_c_var_args_only = - C-variadic function must be declared with at least one named argument - ast_passes_fn_param_doc_comment = documentation comments cannot be applied to function parameters .label = doc comments are not allowed here diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 495e90e967b93..63aed6493dc49 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -365,7 +365,7 @@ impl<'a> AstValidator<'a> { fn check_fn_decl(&self, fn_decl: &FnDecl, self_semantic: SelfSemantic) { self.check_decl_num_args(fn_decl); - self.check_decl_cvaradic_pos(fn_decl); + self.check_decl_cvariadic_pos(fn_decl); self.check_decl_attrs(fn_decl); self.check_decl_self_param(fn_decl, self_semantic); } @@ -380,13 +380,11 @@ impl<'a> AstValidator<'a> { } } - fn check_decl_cvaradic_pos(&self, fn_decl: &FnDecl) { + /// Emits an error if a function declaration has a variadic parameter in the + /// beginning or middle of parameter list. + /// Example: `fn foo(..., x: i32)` will emit an error. + fn check_decl_cvariadic_pos(&self, fn_decl: &FnDecl) { match &*fn_decl.inputs { - [Param { ty, span, .. }] => { - if let TyKind::CVarArgs = ty.kind { - self.dcx().emit_err(errors::FnParamCVarArgsOnly { span: *span }); - } - } [ps @ .., _] => { for Param { ty, span, .. } in ps { if let TyKind::CVarArgs = ty.kind { diff --git a/compiler/rustc_ast_passes/src/errors.rs b/compiler/rustc_ast_passes/src/errors.rs index f397c949e0486..0e4599f55ba5b 100644 --- a/compiler/rustc_ast_passes/src/errors.rs +++ b/compiler/rustc_ast_passes/src/errors.rs @@ -92,13 +92,6 @@ pub struct FnParamTooMany { pub max_num_args: usize, } -#[derive(Diagnostic)] -#[diag(ast_passes_fn_param_c_var_args_only)] -pub struct FnParamCVarArgsOnly { - #[primary_span] - pub span: Span, -} - #[derive(Diagnostic)] #[diag(ast_passes_fn_param_c_var_args_not_last)] pub struct FnParamCVarArgsNotLast { From 531dae1cdfaea537f7f1d5ff7db6bd2adb4d414a Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 12 May 2024 14:22:12 +0000 Subject: [PATCH 3/9] Only allow immutable statics with #[linkage] --- compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 12 ++++++++++++ tests/ui/issues/issue-33992.rs | 3 --- .../linkage-attr/linkage-attr-mutable-static.rs | 15 +++++++++++++++ .../linkage-attr-mutable-static.stderr | 10 ++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 tests/ui/linkage-attr/linkage-attr-mutable-static.rs create mode 100644 tests/ui/linkage-attr/linkage-attr-mutable-static.stderr diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index c28b0d644e675..b479b0376684b 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -327,6 +327,18 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs { } else { codegen_fn_attrs.linkage = linkage; } + if tcx.is_mutable_static(did.into()) { + let mut diag = tcx.dcx().struct_span_err( + attr.span, + "mutable statics are not allowed with `#[linkage]`", + ); + diag.note( + "making the static mutable would allow changing which symbol the \ + static references rather than make the target of the symbol \ + mutable", + ); + diag.emit(); + } } } sym::link_section => { diff --git a/tests/ui/issues/issue-33992.rs b/tests/ui/issues/issue-33992.rs index 177ff234bb291..495751436e127 100644 --- a/tests/ui/issues/issue-33992.rs +++ b/tests/ui/issues/issue-33992.rs @@ -5,9 +5,6 @@ #![feature(linkage)] -#[linkage = "common"] -pub static mut TEST1: u32 = 0u32; - #[linkage = "external"] pub static TEST2: bool = true; diff --git a/tests/ui/linkage-attr/linkage-attr-mutable-static.rs b/tests/ui/linkage-attr/linkage-attr-mutable-static.rs new file mode 100644 index 0000000000000..a7109c6d930bc --- /dev/null +++ b/tests/ui/linkage-attr/linkage-attr-mutable-static.rs @@ -0,0 +1,15 @@ +//! The symbols are resolved by the linker. It doesn't make sense to change +//! them at runtime, so deny mutable statics with #[linkage]. + +#![feature(linkage)] + +fn main() { + extern "C" { + #[linkage = "weak"] //~ ERROR mutable statics are not allowed with `#[linkage]` + static mut ABC: *const u8; + } + + unsafe { + assert_eq!(ABC as usize, 0); + } +} diff --git a/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr b/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr new file mode 100644 index 0000000000000..4db41b6239382 --- /dev/null +++ b/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr @@ -0,0 +1,10 @@ +error: mutable statics are not allowed with `#[linkage]` + --> $DIR/linkage-attr-mutable-static.rs:8:9 + | +LL | #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ + | + = note: making the static mutable would allow changing which symbol the static references rather than make the target of the symbol mutable + +error: aborting due to 1 previous error + From c58b7c9c81cf150bf307ca13375f12fb1c8f6420 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 23 May 2024 19:48:54 -0400 Subject: [PATCH 4/9] Don't skip inner const when looking for body for suggestion --- compiler/rustc_hir_typeck/src/coercion.rs | 9 +++------ .../return/dont-suggest-through-inner-const.rs | 9 +++++++++ .../dont-suggest-through-inner-const.stderr | 17 +++++++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 tests/ui/return/dont-suggest-through-inner-const.rs create mode 100644 tests/ui/return/dont-suggest-through-inner-const.stderr diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index 11a1c65b74956..ebdc558282a91 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1871,11 +1871,8 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> { // If this is due to a block, then maybe we forgot a `return`/`break`. if due_to_block && let Some(expr) = expression - && let Some((parent_fn_decl, parent_id)) = fcx - .tcx - .hir() - .parent_iter(block_or_return_id) - .find_map(|(_, node)| Some((node.fn_decl()?, node.associated_body()?.0))) + && let Some(parent_fn_decl) = + fcx.tcx.hir().fn_decl_by_hir_id(fcx.tcx.local_def_id_to_hir_id(fcx.body_id)) { fcx.suggest_missing_break_or_return_expr( &mut err, @@ -1884,7 +1881,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> { expected, found, block_or_return_id, - parent_id, + fcx.body_id, ); } diff --git a/tests/ui/return/dont-suggest-through-inner-const.rs b/tests/ui/return/dont-suggest-through-inner-const.rs new file mode 100644 index 0000000000000..b2347dedd52d1 --- /dev/null +++ b/tests/ui/return/dont-suggest-through-inner-const.rs @@ -0,0 +1,9 @@ +const fn f() -> usize { + //~^ ERROR mismatched types + const FIELD: usize = loop { + 0 + //~^ ERROR mismatched types + }; +} + +fn main() {} diff --git a/tests/ui/return/dont-suggest-through-inner-const.stderr b/tests/ui/return/dont-suggest-through-inner-const.stderr new file mode 100644 index 0000000000000..6aeee74b0adf9 --- /dev/null +++ b/tests/ui/return/dont-suggest-through-inner-const.stderr @@ -0,0 +1,17 @@ +error[E0308]: mismatched types + --> $DIR/dont-suggest-through-inner-const.rs:4:9 + | +LL | 0 + | ^ expected `()`, found integer + +error[E0308]: mismatched types + --> $DIR/dont-suggest-through-inner-const.rs:1:17 + | +LL | const fn f() -> usize { + | - ^^^^^ expected `usize`, found `()` + | | + | implicitly returns `()` as its body has no tail or `return` expression + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. From 278212342ec2b2659c0e5b6e0038642fb6f37347 Mon Sep 17 00:00:00 2001 From: SparrowLii Date: Sat, 25 May 2024 10:38:18 +0800 Subject: [PATCH 5/9] cleanup dependence of `ExtCtxt` in transcribe when macro expansion --- compiler/rustc_expand/src/mbe/macro_rules.rs | 3 +- compiler/rustc_expand/src/mbe/transcribe.rs | 60 ++++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 8f18055f83817..8349727ade7fb 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -224,7 +224,8 @@ fn expand_macro<'cx>( let arm_span = rhses[i].span(); // rhs has holes ( `$id` and `$(...)` that need filled) - let tts = match transcribe(cx, &named_matches, rhs, rhs_span, transparency) { + let id = cx.current_expansion.id; + let tts = match transcribe(psess, &named_matches, rhs, rhs_span, transparency, id) { Ok(tts) => tts, Err(err) => { let guar = err.emit(); diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index 3901b82eb52ec..5c2b9198a89da 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -1,4 +1,3 @@ -use crate::base::ExtCtxt; use crate::errors::{ CountRepetitionMisplaced, MetaVarExprUnrecognizedVar, MetaVarsDifSeqMatchers, MustRepeatOnce, NoSyntaxVarsExprRepeat, VarStillRepeating, @@ -9,12 +8,13 @@ use rustc_ast::mut_visit::{self, MutVisitor}; use rustc_ast::token::{self, Delimiter, Token, TokenKind}; use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree}; use rustc_data_structures::fx::FxHashMap; -use rustc_errors::{pluralize, Diag, PResult}; +use rustc_errors::{pluralize, Diag, DiagCtxt, PResult}; use rustc_parse::parser::ParseNtResult; use rustc_span::hygiene::{LocalExpnId, Transparency}; use rustc_span::symbol::{sym, Ident, MacroRulesNormalizedIdent}; use rustc_span::{with_metavar_spans, Span, SyntaxContext}; +use rustc_session::parse::ParseSess; use smallvec::{smallvec, SmallVec}; use std::mem; @@ -99,11 +99,12 @@ impl<'a> Iterator for Frame<'a> { /// /// Along the way, we do some additional error checking. pub(super) fn transcribe<'a>( - cx: &ExtCtxt<'a>, + psess: &'a ParseSess, interp: &FxHashMap, src: &mbe::Delimited, src_span: DelimSpan, transparency: Transparency, + expand_id: LocalExpnId, ) -> PResult<'a, TokenStream> { // Nothing for us to transcribe... if src.tts.is_empty() { @@ -137,8 +138,9 @@ pub(super) fn transcribe<'a>( // again, and we are done transcribing. let mut result: Vec = Vec::new(); let mut result_stack = Vec::new(); - let mut marker = Marker(cx.current_expansion.id, transparency, Default::default()); + let mut marker = Marker(expand_id, transparency, Default::default()); + let dcx = &psess.dcx; loop { // Look at the last frame on the stack. // If it still has a TokenTree we have not looked at yet, use that tree. @@ -201,9 +203,7 @@ pub(super) fn transcribe<'a>( seq @ mbe::TokenTree::Sequence(_, seq_rep) => { match lockstep_iter_size(seq, interp, &repeats) { LockstepIterSize::Unconstrained => { - return Err(cx - .dcx() - .create_err(NoSyntaxVarsExprRepeat { span: seq.span() })); + return Err(dcx.create_err(NoSyntaxVarsExprRepeat { span: seq.span() })); } LockstepIterSize::Contradiction(msg) => { @@ -211,9 +211,9 @@ pub(super) fn transcribe<'a>( // happens when two meta-variables are used in the same repetition in a // sequence, but they come from different sequence matchers and repeat // different amounts. - return Err(cx - .dcx() - .create_err(MetaVarsDifSeqMatchers { span: seq.span(), msg })); + return Err( + dcx.create_err(MetaVarsDifSeqMatchers { span: seq.span(), msg }) + ); } LockstepIterSize::Constraint(len, _) => { @@ -227,9 +227,7 @@ pub(super) fn transcribe<'a>( // FIXME: this really ought to be caught at macro definition // time... It happens when the Kleene operator in the matcher and // the body for the same meta-variable do not match. - return Err(cx - .dcx() - .create_err(MustRepeatOnce { span: sp.entire() })); + return Err(dcx.create_err(MustRepeatOnce { span: sp.entire() })); } } else { // 0 is the initial counter (we have done 0 repetitions so far). `len` @@ -259,7 +257,7 @@ pub(super) fn transcribe<'a>( MatchedSingle(ParseNtResult::Tt(tt)) => { // `tt`s are emitted into the output stream directly as "raw tokens", // without wrapping them into groups. - maybe_use_metavar_location(cx, &stack, sp, tt, &mut marker) + maybe_use_metavar_location(psess, &stack, sp, tt, &mut marker) } MatchedSingle(ParseNtResult::Ident(ident, is_raw)) => { marker.visit_span(&mut sp); @@ -280,7 +278,7 @@ pub(super) fn transcribe<'a>( } MatchedSeq(..) => { // We were unable to descend far enough. This is an error. - return Err(cx.dcx().create_err(VarStillRepeating { span: sp, ident })); + return Err(dcx.create_err(VarStillRepeating { span: sp, ident })); } }; result.push(tt) @@ -299,7 +297,7 @@ pub(super) fn transcribe<'a>( // Replace meta-variable expressions with the result of their expansion. mbe::TokenTree::MetaVarExpr(sp, expr) => { - transcribe_metavar_expr(cx, expr, interp, &mut marker, &repeats, &mut result, sp)?; + transcribe_metavar_expr(dcx, expr, interp, &mut marker, &repeats, &mut result, sp)?; } // If we are entering a new delimiter, we push its contents to the `stack` to be @@ -359,7 +357,7 @@ pub(super) fn transcribe<'a>( /// combine with each other and not with tokens outside of the sequence. /// - The metavariable span comes from a different crate, then we prefer the more local span. fn maybe_use_metavar_location( - cx: &ExtCtxt<'_>, + psess: &ParseSess, stack: &[Frame<'_>], mut metavar_span: Span, orig_tt: &TokenTree, @@ -397,7 +395,7 @@ fn maybe_use_metavar_location( && insert(mspans, dspan.entire(), metavar_span) }), }; - if no_collision || cx.source_map().is_imported(metavar_span) { + if no_collision || psess.source_map().is_imported(metavar_span) { return orig_tt.clone(); } @@ -558,7 +556,7 @@ fn lockstep_iter_size( /// * `[ $( ${count(foo, 1)} ),* ]` will return an error because `${count(foo, 1)}` is /// declared inside a single repetition and the index `1` implies two nested repetitions. fn count_repetitions<'a>( - cx: &ExtCtxt<'a>, + dcx: &'a DiagCtxt, depth_user: usize, mut matched: &NamedMatch, repeats: &[(usize, usize)], @@ -595,7 +593,7 @@ fn count_repetitions<'a>( .and_then(|el| el.checked_sub(repeats.len())) .unwrap_or_default(); if depth_user > depth_max { - return Err(out_of_bounds_err(cx, depth_max + 1, sp.entire(), "count")); + return Err(out_of_bounds_err(dcx, depth_max + 1, sp.entire(), "count")); } // `repeats` records all of the nested levels at which we are currently @@ -611,7 +609,7 @@ fn count_repetitions<'a>( } if let MatchedSingle(_) = matched { - return Err(cx.dcx().create_err(CountRepetitionMisplaced { span: sp.entire() })); + return Err(dcx.create_err(CountRepetitionMisplaced { span: sp.entire() })); } count(depth_user, depth_max, matched) @@ -619,7 +617,7 @@ fn count_repetitions<'a>( /// Returns a `NamedMatch` item declared on the LHS given an arbitrary [Ident] fn matched_from_ident<'ctx, 'interp, 'rslt>( - cx: &ExtCtxt<'ctx>, + dcx: &'ctx DiagCtxt, ident: Ident, interp: &'interp FxHashMap, ) -> PResult<'ctx, &'rslt NamedMatch> @@ -628,12 +626,12 @@ where { let span = ident.span; let key = MacroRulesNormalizedIdent::new(ident); - interp.get(&key).ok_or_else(|| cx.dcx().create_err(MetaVarExprUnrecognizedVar { span, key })) + interp.get(&key).ok_or_else(|| dcx.create_err(MetaVarExprUnrecognizedVar { span, key })) } /// Used by meta-variable expressions when an user input is out of the actual declared bounds. For /// example, index(999999) in an repetition of only three elements. -fn out_of_bounds_err<'a>(cx: &ExtCtxt<'a>, max: usize, span: Span, ty: &str) -> Diag<'a> { +fn out_of_bounds_err<'a>(dcx: &'a DiagCtxt, max: usize, span: Span, ty: &str) -> Diag<'a> { let msg = if max == 0 { format!( "meta-variable expression `{ty}` with depth parameter \ @@ -645,11 +643,11 @@ fn out_of_bounds_err<'a>(cx: &ExtCtxt<'a>, max: usize, span: Span, ty: &str) -> must be less than {max}" ) }; - cx.dcx().struct_span_err(span, msg) + dcx.struct_span_err(span, msg) } fn transcribe_metavar_expr<'a>( - cx: &ExtCtxt<'a>, + dcx: &'a DiagCtxt, expr: &MetaVarExpr, interp: &FxHashMap, marker: &mut Marker, @@ -664,8 +662,8 @@ fn transcribe_metavar_expr<'a>( }; match *expr { MetaVarExpr::Count(original_ident, depth) => { - let matched = matched_from_ident(cx, original_ident, interp)?; - let count = count_repetitions(cx, depth, matched, repeats, sp)?; + let matched = matched_from_ident(dcx, original_ident, interp)?; + let count = count_repetitions(dcx, depth, matched, repeats, sp)?; let tt = TokenTree::token_alone( TokenKind::lit(token::Integer, sym::integer(count), None), visited_span(), @@ -674,7 +672,7 @@ fn transcribe_metavar_expr<'a>( } MetaVarExpr::Ignore(original_ident) => { // Used to ensure that `original_ident` is present in the LHS - let _ = matched_from_ident(cx, original_ident, interp)?; + let _ = matched_from_ident(dcx, original_ident, interp)?; } MetaVarExpr::Index(depth) => match repeats.iter().nth_back(depth) { Some((index, _)) => { @@ -683,7 +681,7 @@ fn transcribe_metavar_expr<'a>( visited_span(), )); } - None => return Err(out_of_bounds_err(cx, repeats.len(), sp.entire(), "index")), + None => return Err(out_of_bounds_err(dcx, repeats.len(), sp.entire(), "index")), }, MetaVarExpr::Len(depth) => match repeats.iter().nth_back(depth) { Some((_, length)) => { @@ -692,7 +690,7 @@ fn transcribe_metavar_expr<'a>( visited_span(), )); } - None => return Err(out_of_bounds_err(cx, repeats.len(), sp.entire(), "len")), + None => return Err(out_of_bounds_err(dcx, repeats.len(), sp.entire(), "len")), }, } Ok(()) From ce677681562ca15518c697097b4a77d0f68e2983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 25 May 2024 12:05:49 +0200 Subject: [PATCH 6/9] crashes: increment the number of tracked ones --- tests/crashes/123255.rs | 13 +++++++++++++ tests/crashes/123276.rs | 25 +++++++++++++++++++++++++ tests/crashes/123887.rs | 15 +++++++++++++++ tests/crashes/125013-1.rs | 5 +++++ tests/crashes/125013-2.rs | 16 ++++++++++++++++ tests/crashes/125014.rs | 17 +++++++++++++++++ tests/crashes/125059.rs | 12 ++++++++++++ tests/crashes/125323.rs | 6 ++++++ tests/crashes/125370.rs | 16 ++++++++++++++++ tests/crashes/125432.rs | 17 +++++++++++++++++ tests/crashes/125476.rs | 3 +++ tests/crashes/125512.rs | 10 ++++++++++ tests/crashes/125520.rs | 16 ++++++++++++++++ 13 files changed, 171 insertions(+) create mode 100644 tests/crashes/123255.rs create mode 100644 tests/crashes/123276.rs create mode 100644 tests/crashes/123887.rs create mode 100644 tests/crashes/125013-1.rs create mode 100644 tests/crashes/125013-2.rs create mode 100644 tests/crashes/125014.rs create mode 100644 tests/crashes/125059.rs create mode 100644 tests/crashes/125323.rs create mode 100644 tests/crashes/125370.rs create mode 100644 tests/crashes/125432.rs create mode 100644 tests/crashes/125476.rs create mode 100644 tests/crashes/125512.rs create mode 100644 tests/crashes/125520.rs diff --git a/tests/crashes/123255.rs b/tests/crashes/123255.rs new file mode 100644 index 0000000000000..a94a2a0422e7e --- /dev/null +++ b/tests/crashes/123255.rs @@ -0,0 +1,13 @@ +//@ known-bug: rust-lang/rust#123255 +//@ edition:2021 +#![crate_type = "lib"] + +pub fn a() {} + +mod handlers { + pub struct C(&()); + pub fn c() -> impl Fn() -> C { + let a1 = (); + || C((crate::a(), a1).into()) + } +} diff --git a/tests/crashes/123276.rs b/tests/crashes/123276.rs new file mode 100644 index 0000000000000..d2246f595838d --- /dev/null +++ b/tests/crashes/123276.rs @@ -0,0 +1,25 @@ +//@ known-bug: rust-lang/rust#123276 +//@ edition:2021 + +async fn create_task() { + _ = Some(async { bind(documentation_filter()) }); +} + +async fn bind>(_: F) {} + +fn documentation_filter() -> impl Filter { + AndThen +} + +trait Filter { + type Future; +} + +struct AndThen; + +impl Filter for AndThen +where + Foo: Filter, +{ + type Future = (); +} diff --git a/tests/crashes/123887.rs b/tests/crashes/123887.rs new file mode 100644 index 0000000000000..68e2fb0325c3d --- /dev/null +++ b/tests/crashes/123887.rs @@ -0,0 +1,15 @@ +//@ known-bug: rust-lang/rust#123887 +//@ compile-flags: -Clink-dead-code + +#![feature(extern_types)] +#![feature(unsized_fn_params)] + +extern "C" { + pub type ExternType; +} + +impl ExternType { + pub fn f(self) {} +} + +pub fn main() {} diff --git a/tests/crashes/125013-1.rs b/tests/crashes/125013-1.rs new file mode 100644 index 0000000000000..ae66d7a146698 --- /dev/null +++ b/tests/crashes/125013-1.rs @@ -0,0 +1,5 @@ +//@ known-bug: rust-lang/rust#125013 +//@ edition:2021 +use io::{self as std}; +use std::ops::Deref::{self as io}; +pub fn main() {} diff --git a/tests/crashes/125013-2.rs b/tests/crashes/125013-2.rs new file mode 100644 index 0000000000000..a14c8a76b63ee --- /dev/null +++ b/tests/crashes/125013-2.rs @@ -0,0 +1,16 @@ +//@ known-bug: rust-lang/rust#125013 +//@ edition:2021 +mod a { + pub mod b { + pub mod c { + pub trait D {} + } + } +} + +use a::*; + +use e as b; +use b::c::D as e; + +fn main() { } diff --git a/tests/crashes/125014.rs b/tests/crashes/125014.rs new file mode 100644 index 0000000000000..b29042ee5983a --- /dev/null +++ b/tests/crashes/125014.rs @@ -0,0 +1,17 @@ +//@ known-bug: rust-lang/rust#125014 +//@ compile-flags: -Znext-solver=coherence +#![feature(specialization)] + +trait Foo {} + +impl Foo for ::Output {} + +impl Foo for u32 {} + +trait Assoc { + type Output; +} +impl Output for u32 {} +impl Assoc for ::Output { + default type Output = bool; +} diff --git a/tests/crashes/125059.rs b/tests/crashes/125059.rs new file mode 100644 index 0000000000000..7e9f7414816e8 --- /dev/null +++ b/tests/crashes/125059.rs @@ -0,0 +1,12 @@ +//@ known-bug: rust-lang/rust#125059 +#![feature(deref_patterns)] +#![allow(incomplete_features)] + +fn simple_vec(vec: Vec) -> u32 { + (|| match Vec::::new() { + deref!([]) => 100, + _ => 2000, + })() +} + +fn main() {} diff --git a/tests/crashes/125323.rs b/tests/crashes/125323.rs new file mode 100644 index 0000000000000..180b7bbad097d --- /dev/null +++ b/tests/crashes/125323.rs @@ -0,0 +1,6 @@ +//@ known-bug: rust-lang/rust#125323 +fn main() { + for _ in 0..0 { + [(); loop {}]; + } +} diff --git a/tests/crashes/125370.rs b/tests/crashes/125370.rs new file mode 100644 index 0000000000000..8640d88a5d7f9 --- /dev/null +++ b/tests/crashes/125370.rs @@ -0,0 +1,16 @@ +//@ known-bug: rust-lang/rust#125370 + +type Field3 = i64; + +#[repr(C)] +union DummyUnion { + field3: Field3, +} + +const UNION: DummyUnion = loop {}; + +const fn read_field2() -> Field2 { + const FIELD2: Field2 = loop { + UNION.field3 + }; +} diff --git a/tests/crashes/125432.rs b/tests/crashes/125432.rs new file mode 100644 index 0000000000000..659bb3ce21dea --- /dev/null +++ b/tests/crashes/125432.rs @@ -0,0 +1,17 @@ +//@ known-bug: rust-lang/rust#125432 + +fn separate_arms() { + // Here both arms perform assignments, but only one is illegal. + + let mut x = None; + match x { + None => { + // It is ok to reassign x here, because there is in + // fact no outstanding loan of x! + x = Some(0); + } + Some(right) => consume(right), + } +} + +fn main() {} diff --git a/tests/crashes/125476.rs b/tests/crashes/125476.rs new file mode 100644 index 0000000000000..c6cb4db7d231b --- /dev/null +++ b/tests/crashes/125476.rs @@ -0,0 +1,3 @@ +//@ known-bug: rust-lang/rust#125476 +pub struct Data([u8; usize::MAX >> 16]); +const _: &'static [Data] = &[]; diff --git a/tests/crashes/125512.rs b/tests/crashes/125512.rs new file mode 100644 index 0000000000000..1672b24a11437 --- /dev/null +++ b/tests/crashes/125512.rs @@ -0,0 +1,10 @@ +//@ known-bug: rust-lang/rust#125512 +//@ edition:2021 +#![feature(object_safe_for_dispatch)] +trait B { + fn f(a: A) -> A; +} +trait A { + fn concrete(b: B) -> B; +} +fn main() {} diff --git a/tests/crashes/125520.rs b/tests/crashes/125520.rs new file mode 100644 index 0000000000000..c6756053c210a --- /dev/null +++ b/tests/crashes/125520.rs @@ -0,0 +1,16 @@ +//@ known-bug: #125520 +#![feature(generic_const_exprs)] + +struct Outer(); +impl Outer +where + [(); A + (B * 2)]:, +{ + fn i() -> Self { + Self + } +} + +fn main() { + Outer::<1, 1>::o(); +} From bebcb4e4b85f0414da3aef50dfc5abded1ad9f55 Mon Sep 17 00:00:00 2001 From: Urgau Date: Sat, 25 May 2024 13:56:19 +0200 Subject: [PATCH 7/9] Also mention my-self for check-cfg docs changes --- triagebot.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/triagebot.toml b/triagebot.toml index 2e45b257f8126..303c2fccc0754 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -794,6 +794,9 @@ cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"] [mentions."src/doc/rustc/src/check-cfg.md"] cc = ["@Urgau"] +[mentions."src/doc/rustc/src/check-cfg"] +cc = ["@Urgau"] + [mentions."src/doc/rustc/src/platform-support"] cc = ["@Nilstrieb"] From 91b3ef5b4a36e16347dbf128b4da64078babae70 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Sat, 25 May 2024 22:55:50 -0700 Subject: [PATCH 8/9] Notify T-rustdoc for beta-accepted and stable-accepted too Otherwise, it's unclear when the nomination label is removed whether the backport was accepted, thus nomination removed, or if the backport was rejected, thus nomination removed. --- triagebot.toml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/triagebot.toml b/triagebot.toml index 2e45b257f8126..877f6af4ec73e 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -452,6 +452,19 @@ message_on_remove = "PR #{number}'s beta-nomination has been removed." message_on_close = "PR #{number} has been closed. Thanks for participating!" message_on_reopen = "PR #{number} has been reopened. Pinging @*T-rustdoc*." +# FIXME: Patch triagebot to support `notify-zulip.