Skip to content

Commit

Permalink
Auto merge of #53880 - pietroalbini:beta-backports, r=pietroalbini
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
bors committed Sep 1, 2018
2 parents 1daa912 + 1aa4bbb commit b4ec8d4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ impl<'a> Builder<'a> {
// compiler, but for tools we just use the precompiled libraries that
// we've downloaded
let use_snapshot = mode == Mode::ToolBootstrap;
assert!(!use_snapshot || stage == 0);
assert!(!use_snapshot || stage == 0 || self.local_rebuild);

let maybe_sysroot = self.sysroot(compiler);
let sysroot = if use_snapshot {
Expand Down
3 changes: 2 additions & 1 deletion src/libstd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> {
} else {
build.file("../libbacktrace/elf.c");

if target.contains("64") {
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();
if pointer_width == "64" {
build.define("BACKTRACE_ELF_SIZE", "64");
} else {
build.define("BACKTRACE_ELF_SIZE", "32");
Expand Down
9 changes: 1 addition & 8 deletions src/libsyntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,7 @@ impl Mark {

#[inline]
pub fn set_expn_info(self, info: ExpnInfo) {
HygieneData::with(|data| {
let old_info = &mut data.marks[self.0 as usize].expn_info;
if let Some(old_info) = old_info {
panic!("expansion info is reset for the mark {}\nold: {:#?}\nnew: {:#?}",
self.0, old_info, info);
}
*old_info = Some(info);
})
HygieneData::with(|data| data.marks[self.0 as usize].expn_info = Some(info))
}

#[inline]
Expand Down
17 changes: 17 additions & 0 deletions src/test/ui/hygiene/expansion-info-reset.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// FIXME: Investigate why expansion info for a single expansion id is reset from
// `MacroBang(format_args)` to `MacroAttribute(derive(Clone))` (issue #52363).

fn main() {
format_args!({ #[derive(Clone)] struct S; });
//~^ ERROR format argument must be a string literal
}
12 changes: 12 additions & 0 deletions src/test/ui/hygiene/expansion-info-reset.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error: format argument must be a string literal
--> $DIR/expansion-info-reset.rs:15:18
|
LL | format_args!({ #[derive(Clone)] struct S; });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: you might be missing a string literal to format with
|
LL | format_args!("{}", { #[derive(Clone)] struct S; });
| ^^^^^

error: aborting due to previous error

0 comments on commit b4ec8d4

Please sign in to comment.