Skip to content

Commit b4ec8d4

Browse files
committed
Auto merge of #53880 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports Merged and approved: * #53653: Address two regressions * #53377: std: Use target_pointer_width for BACKTRACE_ELF_SIZE * #52969: rustbuild: fix local_rebuild r? @ghost
2 parents 1daa912 + 1aa4bbb commit b4ec8d4

File tree

5 files changed

+33
-10
lines changed

5 files changed

+33
-10
lines changed

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ impl<'a> Builder<'a> {
777777
// compiler, but for tools we just use the precompiled libraries that
778778
// we've downloaded
779779
let use_snapshot = mode == Mode::ToolBootstrap;
780-
assert!(!use_snapshot || stage == 0);
780+
assert!(!use_snapshot || stage == 0 || self.local_rebuild);
781781

782782
let maybe_sysroot = self.sysroot(compiler);
783783
let sysroot = if use_snapshot {

src/libstd/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> {
104104
} else {
105105
build.file("../libbacktrace/elf.c");
106106

107-
if target.contains("64") {
107+
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();
108+
if pointer_width == "64" {
108109
build.define("BACKTRACE_ELF_SIZE", "64");
109110
} else {
110111
build.define("BACKTRACE_ELF_SIZE", "32");

src/libsyntax_pos/hygiene.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,7 @@ impl Mark {
108108

109109
#[inline]
110110
pub fn set_expn_info(self, info: ExpnInfo) {
111-
HygieneData::with(|data| {
112-
let old_info = &mut data.marks[self.0 as usize].expn_info;
113-
if let Some(old_info) = old_info {
114-
panic!("expansion info is reset for the mark {}\nold: {:#?}\nnew: {:#?}",
115-
self.0, old_info, info);
116-
}
117-
*old_info = Some(info);
118-
})
111+
HygieneData::with(|data| data.marks[self.0 as usize].expn_info = Some(info))
119112
}
120113

121114
#[inline]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// FIXME: Investigate why expansion info for a single expansion id is reset from
12+
// `MacroBang(format_args)` to `MacroAttribute(derive(Clone))` (issue #52363).
13+
14+
fn main() {
15+
format_args!({ #[derive(Clone)] struct S; });
16+
//~^ ERROR format argument must be a string literal
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error: format argument must be a string literal
2+
--> $DIR/expansion-info-reset.rs:15:18
3+
|
4+
LL | format_args!({ #[derive(Clone)] struct S; });
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
help: you might be missing a string literal to format with
7+
|
8+
LL | format_args!("{}", { #[derive(Clone)] struct S; });
9+
| ^^^^^
10+
11+
error: aborting due to previous error
12+

0 commit comments

Comments
 (0)