Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ca855e6

Browse files
committed
Auto merge of rust-lang#106708 - JohnTitor:rollup-xcmg5yv, r=JohnTitor
Rollup of 14 pull requests Successful merges: - rust-lang#105194 (Add comment to cleanup_kinds) - rust-lang#106521 (remove E0280) - rust-lang#106628 (Remove unneeded ItemId::Primitive variant) - rust-lang#106635 (std sync tests: better type name, clarifying comment) - rust-lang#106642 (Add test for rust-lang#106062) - rust-lang#106645 ([RFC 2397] Initial implementation) - rust-lang#106653 (Fix help docs for -Zallow-features) - rust-lang#106657 (Remove myself from rust-lang/rust reviewers) - rust-lang#106662 (specialize impl of `ToString` on `bool`) - rust-lang#106669 (create helper function for `rustc_lint_defs::Level` and remove it's duplicated code) - rust-lang#106671 (Change flags with a fixed default value from Option<bool> to bool) - rust-lang#106689 (Fix invalid files array re-creation in rustdoc-gui tester) - rust-lang#106690 (Fix scrolling for item declaration block) - rust-lang#106698 (Add compiler-errors to some trait system notification groups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents bf7ea0d + a804980 commit ca855e6

File tree

34 files changed

+455
-134
lines changed

34 files changed

+455
-134
lines changed

compiler/rustc_codegen_ssa/src/mir/analyze.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ impl CleanupKind {
261261
}
262262
}
263263

264+
/// MSVC requires unwinding code to be split to a tree of *funclets*, where each funclet can only
265+
/// branch to itself or to its parent. Luckily, the code we generates matches this pattern.
266+
/// Recover that structure in an analyze pass.
264267
pub fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKind> {
265268
fn discover_masters<'tcx>(
266269
result: &mut IndexVec<mir::BasicBlock, CleanupKind>,

compiler/rustc_error_codes/src/error_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ E0791: include_str!("./error_codes/E0791.md"),
574574
// E0274, // on_unimplemented #2
575575
// E0278, // requirement is not satisfied
576576
// E0279,
577-
E0280, // requirement is not satisfied
577+
// E0280, // changed to ICE
578578
// E0285, // overflow evaluation builtin bounds
579579
// E0296, // replaced with a generic attribute input check
580580
// E0298, // cannot compare constants

compiler/rustc_errors/src/diagnostic_impls.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,7 @@ impl IntoDiagnosticArg for type_ir::FloatTy {
179179

180180
impl IntoDiagnosticArg for Level {
181181
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
182-
DiagnosticArgValue::Str(Cow::Borrowed(match self {
183-
Level::Allow => "-A",
184-
Level::Warn => "-W",
185-
Level::ForceWarn(_) => "--force-warn",
186-
Level::Deny => "-D",
187-
Level::Forbid => "-F",
188-
Level::Expect(_) => {
189-
unreachable!("lints with the level of `expect` should not run this code");
190-
}
191-
}))
182+
DiagnosticArgValue::Str(Cow::Borrowed(self.to_cmd_flag()))
192183
}
193184
}
194185

compiler/rustc_feature/src/active.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ declare_features! (
374374
(active, deprecated_safe, "1.61.0", Some(94978), None),
375375
/// Allows having using `suggestion` in the `#[deprecated]` attribute.
376376
(active, deprecated_suggestion, "1.61.0", Some(94785), None),
377+
/// Controls errors in trait implementations.
378+
(active, do_not_recommend, "1.67.0", Some(51992), None),
377379
/// Tells rustdoc to automatically generate `#[doc(cfg(...))]`.
378380
(active, doc_auto_cfg, "1.58.0", Some(43781), None),
379381
/// Allows `#[doc(cfg(...))]`.

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,9 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
487487
experimental!(collapse_debuginfo)
488488
),
489489

490+
// RFC 2397
491+
gated!(do_not_recommend, Normal, template!(Word), WarnFollowing, experimental!(do_not_recommend)),
492+
490493
// ==========================================================================
491494
// Internal attributes: Stability, deprecation, and unsafe:
492495
// ==========================================================================

compiler/rustc_interface/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ fn test_unstable_options_tracking_hash() {
715715
tracked!(asm_comments, true);
716716
tracked!(assume_incomplete_release, true);
717717
tracked!(binary_dep_depinfo, true);
718-
tracked!(box_noalias, Some(false));
718+
tracked!(box_noalias, false);
719719
tracked!(
720720
branch_protection,
721721
Some(BranchProtection {
@@ -754,7 +754,7 @@ fn test_unstable_options_tracking_hash() {
754754
tracked!(mir_enable_passes, vec![("DestProp".to_string(), false)]);
755755
tracked!(mir_opt_level, Some(4));
756756
tracked!(move_size_limit, Some(4096));
757-
tracked!(mutable_noalias, Some(true));
757+
tracked!(mutable_noalias, false);
758758
tracked!(no_generate_arange_section, true);
759759
tracked!(no_jump_tables, true);
760760
tracked!(no_link, true);

compiler/rustc_lint_defs/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,19 @@ impl Level {
253253
}
254254
}
255255

256+
pub fn to_cmd_flag(self) -> &'static str {
257+
match self {
258+
Level::Warn => "-W",
259+
Level::Deny => "-D",
260+
Level::Forbid => "-F",
261+
Level::Allow => "-A",
262+
Level::ForceWarn(_) => "--force-warn",
263+
Level::Expect(_) => {
264+
unreachable!("the expect level does not have a commandline flag")
265+
}
266+
}
267+
}
268+
256269
pub fn is_error(self) -> bool {
257270
match self {
258271
Level::Allow | Level::Expect(_) | Level::Warn | Level::ForceWarn(_) => false,

compiler/rustc_middle/src/lint.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,7 @@ pub fn explain_lint_level_source(
234234
err.note_once(&format!("`#[{}({})]` on by default", level.as_str(), name));
235235
}
236236
LintLevelSource::CommandLine(lint_flag_val, orig_level) => {
237-
let flag = match orig_level {
238-
Level::Warn => "-W",
239-
Level::Deny => "-D",
240-
Level::Forbid => "-F",
241-
Level::Allow => "-A",
242-
Level::ForceWarn(_) => "--force-warn",
243-
Level::Expect(_) => {
244-
unreachable!("the expect level does not have a commandline flag")
245-
}
246-
};
237+
let flag = orig_level.to_cmd_flag();
247238
let hyphen_case_lint_name = name.replace('_', "-");
248239
if lint_flag_val.as_str() == name {
249240
err.note_once(&format!(

compiler/rustc_session/src/options.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ options! {
12411241

12421242
// tidy-alphabetical-start
12431243
allow_features: Option<Vec<String>> = (None, parse_opt_comma_list, [TRACKED],
1244-
"only allow the listed language features to be enabled in code (space separated)"),
1244+
"only allow the listed language features to be enabled in code (comma separated)"),
12451245
always_encode_mir: bool = (false, parse_bool, [TRACKED],
12461246
"encode MIR of all functions into the crate metadata (default: no)"),
12471247
asm_comments: bool = (false, parse_bool, [TRACKED],
@@ -1255,7 +1255,7 @@ options! {
12551255
binary_dep_depinfo: bool = (false, parse_bool, [TRACKED],
12561256
"include artifacts (sysroot, crate dependencies) used during compilation in dep-info \
12571257
(default: no)"),
1258-
box_noalias: Option<bool> = (None, parse_opt_bool, [TRACKED],
1258+
box_noalias: bool = (true, parse_bool, [TRACKED],
12591259
"emit noalias metadata for box (default: yes)"),
12601260
branch_protection: Option<BranchProtection> = (None, parse_branch_protection, [TRACKED],
12611261
"set options for branch target identification and pointer authentication on AArch64"),
@@ -1437,7 +1437,7 @@ options! {
14371437
"use line numbers relative to the function in mir pretty printing"),
14381438
move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED],
14391439
"the size at which the `large_assignments` lint starts to be emitted"),
1440-
mutable_noalias: Option<bool> = (None, parse_opt_bool, [TRACKED],
1440+
mutable_noalias: bool = (true, parse_bool, [TRACKED],
14411441
"emit noalias metadata for mutable references (default: yes)"),
14421442
nll_facts: bool = (false, parse_bool, [UNTRACKED],
14431443
"dump facts from NLL analysis into side files (default: no)"),

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ symbols! {
613613
dispatch_from_dyn,
614614
div,
615615
div_assign,
616+
do_not_recommend,
616617
doc,
617618
doc_alias,
618619
doc_auto_cfg,

0 commit comments

Comments
 (0)