Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beta] Rollup backports #53880

Merged
merged 4 commits into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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