Skip to content

Commit ad211ce

Browse files
committed
Auto merge of rust-lang#135202 - GuillaumeGomez:rollup-9xgs39t, r=GuillaumeGomez
Rollup of 9 pull requests Successful merges: - rust-lang#135081 (bootstrap: Build jemalloc with support for 64K pages) - rust-lang#135174 ([AIX] Port test case run-make/reproducible-build ) - rust-lang#135177 (llvm: Ignore error value that is always false) - rust-lang#135182 (Transmute from NonNull to pointer when elaborating a box deref (MCP807)) - rust-lang#135187 (apply a workaround fix for the release roadblock) - rust-lang#135189 (Remove workaround from pull request template) - rust-lang#135193 (don't bless `proc_macro_deps.rs` unless it's necessary) - rust-lang#135198 (Avoid naming variables `str`) - rust-lang#135199 (Eliminate an unnecessary `Symbol::to_string`; use `as_str`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents fb546ee + 225ffeb commit ad211ce

File tree

32 files changed

+148
-96
lines changed

32 files changed

+148
-96
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ tracking issue or there are none, feel free to ignore this.
77
This PR will get automatically assigned to a reviewer. In case you would like
88
a specific user to review your work, you can assign it to them by using
99
10-
r\? <reviewer name> (with the `\` removed)
10+
r? <reviewer name>
1111
-->
1212
<!-- homu-ignore:end -->

compiler/rustc_borrowck/src/region_infer/values.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,12 @@ fn pretty_print_region_elements(elements: impl IntoIterator<Item = RegionElement
544544

545545
return result;
546546

547-
fn push_location_range(str: &mut String, location1: Location, location2: Location) {
547+
fn push_location_range(s: &mut String, location1: Location, location2: Location) {
548548
if location1 == location2 {
549-
str.push_str(&format!("{location1:?}"));
549+
s.push_str(&format!("{location1:?}"));
550550
} else {
551551
assert_eq!(location1.block, location2.block);
552-
str.push_str(&format!(
552+
s.push_str(&format!(
553553
"{:?}[{}..={}]",
554554
location1.block, location1.statement_index, location2.statement_index
555555
));

compiler/rustc_codegen_gcc/src/back/lto.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,7 @@ pub unsafe fn optimize_thin_module(
660660
{
661661
let _timer =
662662
cgcx.prof.generic_activity_with_arg("LLVM_thin_lto_rename", thin_module.name());
663-
if !llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target) {
664-
return Err(write::llvm_err(&dcx, LlvmError::PrepareThinLtoModule));
665-
}
663+
unsafe { llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target) };
666664
save_temp_bitcode(cgcx, &module, "thin-lto-after-rename");
667665
}
668666

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,7 @@ pub(crate) unsafe fn optimize_thin_module(
737737
{
738738
let _timer =
739739
cgcx.prof.generic_activity_with_arg("LLVM_thin_lto_rename", thin_module.name());
740-
if unsafe {
741-
!llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target)
742-
} {
743-
return Err(write::llvm_err(dcx, LlvmError::PrepareThinLtoModule));
744-
}
740+
unsafe { llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target) };
745741
save_temp_bitcode(cgcx, &module, "thin-lto-after-rename");
746742
}
747743

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ unsafe extern "C" {
23742374
Data: &ThinLTOData,
23752375
Module: &Module,
23762376
Target: &TargetMachine,
2377-
) -> bool;
2377+
);
23782378
pub fn LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool;
23792379
pub fn LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool;
23802380
pub fn LLVMRustPrepareThinLTOImport(

compiler/rustc_const_eval/src/interpret/operand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
704704
pub fn read_str(&self, mplace: &MPlaceTy<'tcx, M::Provenance>) -> InterpResult<'tcx, &str> {
705705
let len = mplace.len(self)?;
706706
let bytes = self.read_bytes_ptr_strip_provenance(mplace.ptr(), Size::from_bytes(len))?;
707-
let str = std::str::from_utf8(bytes).map_err(|err| err_ub!(InvalidStr(err)))?;
708-
interp_ok(str)
707+
let s = std::str::from_utf8(bytes).map_err(|err| err_ub!(InvalidStr(err)))?;
708+
interp_ok(s)
709709
}
710710

711711
/// Read from a local of the current frame. Convenience method for [`InterpCx::local_at_frame_to_op`].

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,9 @@ where
10171017
/// This is allocated in immutable global memory and deduplicated.
10181018
pub fn allocate_str_dedup(
10191019
&mut self,
1020-
str: &str,
1020+
s: &str,
10211021
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::Provenance>> {
1022-
let bytes = str.as_bytes();
1022+
let bytes = s.as_bytes();
10231023
let ptr = self.allocate_bytes_dedup(bytes)?;
10241024

10251025
// Create length metadata for the string.

compiler/rustc_lint/src/nonstandard_style.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,18 @@ declare_lint! {
234234
declare_lint_pass!(NonSnakeCase => [NON_SNAKE_CASE]);
235235

236236
impl NonSnakeCase {
237-
fn to_snake_case(mut str: &str) -> String {
237+
fn to_snake_case(mut name: &str) -> String {
238238
let mut words = vec![];
239239
// Preserve leading underscores
240-
str = str.trim_start_matches(|c: char| {
240+
name = name.trim_start_matches(|c: char| {
241241
if c == '_' {
242242
words.push(String::new());
243243
true
244244
} else {
245245
false
246246
}
247247
});
248-
for s in str.split('_') {
248+
for s in name.split('_') {
249249
let mut last_upper = false;
250250
let mut buf = String::new();
251251
if s.is_empty() {

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,20 +1389,14 @@ static bool clearDSOLocalOnDeclarations(Module &Mod, TargetMachine &TM) {
13891389
return ClearDSOLocalOnDeclarations;
13901390
}
13911391

1392-
extern "C" bool LLVMRustPrepareThinLTORename(const LLVMRustThinLTOData *Data,
1392+
extern "C" void LLVMRustPrepareThinLTORename(const LLVMRustThinLTOData *Data,
13931393
LLVMModuleRef M,
13941394
LLVMTargetMachineRef TM) {
13951395
Module &Mod = *unwrap(M);
13961396
TargetMachine &Target = *unwrap(TM);
13971397

13981398
bool ClearDSOLocal = clearDSOLocalOnDeclarations(Mod, Target);
1399-
bool error = renameModuleForThinLTO(Mod, Data->Index, ClearDSOLocal);
1400-
1401-
if (error) {
1402-
LLVMRustSetLastError("renameModuleForThinLTO failed");
1403-
return false;
1404-
}
1405-
return true;
1399+
renameModuleForThinLTO(Mod, Data->Index, ClearDSOLocal);
14061400
}
14071401

14081402
extern "C" bool

compiler/rustc_log/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ pub fn init_logger(cfg: LoggerConfig) -> Result<(), Error> {
130130

131131
let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);
132132
match cfg.backtrace {
133-
Ok(str) => {
133+
Ok(backtrace_target) => {
134134
let fmt_layer = tracing_subscriber::fmt::layer()
135135
.with_writer(io::stderr)
136136
.without_time()
137-
.event_format(BacktraceFormatter { backtrace_target: str });
137+
.event_format(BacktraceFormatter { backtrace_target });
138138
let subscriber = subscriber.with(fmt_layer);
139139
tracing::subscriber::set_global_default(subscriber).unwrap();
140140
}

0 commit comments

Comments
 (0)