Skip to content

Commit 6b678c5

Browse files
committed
Auto merge of rust-lang#129359 - matthiaskrgr:rollup-nyre44t, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#128627 (Special case DUMMY_SP to emit line 0/column 0 locations on DWARF platforms.) - rust-lang#128843 (Minor Refactor: Remove a Redundant Conditional Check) - rust-lang#129179 (CFI: Erase regions when projecting ADT to its transparent non-1zst field) - rust-lang#129281 (Tweak unreachable lint wording) - rust-lang#129312 (Fix stability attribute of `impl !Error for &str`) - rust-lang#129332 (Avoid extra `cast()`s after `CStr::as_ptr()`) - rust-lang#129339 (Make `ArgAbi::make_indirect_force` more specific) - rust-lang#129344 (Use `bool` in favor of `Option<()>` for diagnostics) - rust-lang#129345 (Use shorthand field initialization syntax more aggressively in the compiler) - rust-lang#129355 (fix comment on PlaceMention semantics) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 982c6f8 + 9fd2832 commit 6b678c5

File tree

126 files changed

+985
-861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+985
-861
lines changed

compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
8686
// Multiple different abi names may actually be the same ABI
8787
// If the specified ABIs are not the same name, alert the user that they resolve to the same ABI
8888
let source_map = self.tcx.sess.source_map();
89-
let equivalent = (source_map.span_to_snippet(*prev_sp)
90-
!= source_map.span_to_snippet(*abi_span))
91-
.then_some(());
89+
let equivalent = source_map.span_to_snippet(*prev_sp)
90+
!= source_map.span_to_snippet(*abi_span);
9291

9392
self.dcx().emit_err(AbiSpecifiedMultipleTimes {
9493
abi_span: *abi_span,

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub struct AbiSpecifiedMultipleTimes {
184184
#[label]
185185
pub prev_span: Span,
186186
#[note]
187-
pub equivalent: Option<()>,
187+
pub equivalent: bool,
188188
}
189189

190190
#[derive(Diagnostic)]

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14211421
};
14221422
hir::FnHeader {
14231423
safety: self.lower_safety(h.safety, default_safety),
1424-
asyncness: asyncness,
1424+
asyncness,
14251425
constness: self.lower_constness(h.constness),
14261426
abi: self.lower_extern(h.ext),
14271427
}

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,8 @@ impl<'a> AstValidator<'a> {
562562
FnHeader { safety: _, coroutine_kind, constness, ext }: FnHeader,
563563
) {
564564
let report_err = |span| {
565-
self.dcx().emit_err(errors::FnQualifierInExtern {
566-
span: span,
567-
block: self.current_extern_span(),
568-
});
565+
self.dcx()
566+
.emit_err(errors::FnQualifierInExtern { span, block: self.current_extern_span() });
569567
};
570568
match coroutine_kind {
571569
Some(knd) => report_err(knd.span()),
@@ -963,14 +961,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
963961
self_ty,
964962
items,
965963
}) => {
966-
let error =
967-
|annotation_span, annotation, only_trait: bool| errors::InherentImplCannot {
968-
span: self_ty.span,
969-
annotation_span,
970-
annotation,
971-
self_ty: self_ty.span,
972-
only_trait: only_trait.then_some(()),
973-
};
964+
let error = |annotation_span, annotation, only_trait| errors::InherentImplCannot {
965+
span: self_ty.span,
966+
annotation_span,
967+
annotation,
968+
self_ty: self_ty.span,
969+
only_trait,
970+
};
974971

975972
self.with_in_trait_impl(None, |this| {
976973
this.visibility_not_permitted(
@@ -1195,7 +1192,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
11951192
} else if where_clauses.after.has_where_token {
11961193
self.dcx().emit_err(errors::WhereClauseAfterTypeAlias {
11971194
span: where_clauses.after.span,
1198-
help: self.session.is_nightly_build().then_some(()),
1195+
help: self.session.is_nightly_build(),
11991196
});
12001197
}
12011198
}

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ pub struct InherentImplCannot<'a> {
484484
#[label(ast_passes_type)]
485485
pub self_ty: Span,
486486
#[note(ast_passes_only_trait)]
487-
pub only_trait: Option<()>,
487+
pub only_trait: bool,
488488
}
489489

490490
#[derive(Diagnostic)]
@@ -528,7 +528,7 @@ pub struct WhereClauseAfterTypeAlias {
528528
#[primary_span]
529529
pub span: Span,
530530
#[help]
531-
pub help: Option<()>,
531+
pub help: bool,
532532
}
533533

534534
#[derive(Diagnostic)]

compiler/rustc_attr/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ pub fn find_deprecation(
846846
sess.dcx().emit_err(
847847
session_diagnostics::DeprecatedItemSuggestion {
848848
span: mi.span,
849-
is_nightly: sess.is_nightly_build().then_some(()),
849+
is_nightly: sess.is_nightly_build(),
850850
details: (),
851851
},
852852
);

compiler/rustc_attr/src/session_diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub(crate) struct DeprecatedItemSuggestion {
342342
pub span: Span,
343343

344344
#[help]
345-
pub is_nightly: Option<()>,
345+
pub is_nightly: bool,
346346

347347
#[note]
348348
pub details: (),

compiler/rustc_codegen_llvm/src/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn create_wrapper_function(
149149
}
150150
llvm::LLVMRustSetVisibility(callee, llvm::Visibility::Hidden);
151151

152-
let llbb = llvm::LLVMAppendBasicBlockInContext(llcx, llfn, c"entry".as_ptr().cast());
152+
let llbb = llvm::LLVMAppendBasicBlockInContext(llcx, llfn, c"entry".as_ptr());
153153

154154
let llbuilder = llvm::LLVMCreateBuilderInContext(llcx);
155155
llvm::LLVMPositionBuilderAtEnd(llbuilder, llbb);

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ pub(crate) fn run_pass_manager(
616616
llvm::LLVMRustAddModuleFlagU32(
617617
module.module_llvm.llmod(),
618618
llvm::LLVMModFlagBehavior::Error,
619-
c"LTOPostLink".as_ptr().cast(),
619+
c"LTOPostLink".as_ptr(),
620620
1,
621621
);
622622
}

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ unsafe fn embed_bitcode(
10311031
let llglobal = llvm::LLVMAddGlobal(
10321032
llmod,
10331033
common::val_ty(llconst),
1034-
c"rustc.embedded.module".as_ptr().cast(),
1034+
c"rustc.embedded.module".as_ptr(),
10351035
);
10361036
llvm::LLVMSetInitializer(llglobal, llconst);
10371037

@@ -1044,7 +1044,7 @@ unsafe fn embed_bitcode(
10441044
let llglobal = llvm::LLVMAddGlobal(
10451045
llmod,
10461046
common::val_ty(llconst),
1047-
c"rustc.embedded.cmdline".as_ptr().cast(),
1047+
c"rustc.embedded.cmdline".as_ptr(),
10481048
);
10491049
llvm::LLVMSetInitializer(llglobal, llconst);
10501050
let section = if is_apple {
@@ -1054,7 +1054,7 @@ unsafe fn embed_bitcode(
10541054
} else {
10551055
c".llvmcmd"
10561056
};
1057-
llvm::LLVMSetSection(llglobal, section.as_ptr().cast());
1057+
llvm::LLVMSetSection(llglobal, section.as_ptr());
10581058
llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage);
10591059
} else {
10601060
// We need custom section flags, so emit module-level inline assembly.
@@ -1107,7 +1107,7 @@ fn create_msvc_imps(
11071107
.collect::<Vec<_>>();
11081108

11091109
for (imp_name, val) in globals {
1110-
let imp = llvm::LLVMAddGlobal(llmod, ptr_ty, imp_name.as_ptr().cast());
1110+
let imp = llvm::LLVMAddGlobal(llmod, ptr_ty, imp_name.as_ptr());
11111111
llvm::LLVMSetInitializer(imp, val);
11121112
llvm::LLVMRustSetLinkage(imp, llvm::Linkage::ExternalLinkage);
11131113
}

0 commit comments

Comments
 (0)