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

Add expansion info to crate metadata #43847

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
(kind of) fixed build.
  • Loading branch information
ibabushkin committed Oct 12, 2017
commit b79b450965d9452e7fab713f429ae6391860ad9d
2 changes: 1 addition & 1 deletion src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
@@ -274,7 +274,7 @@ impl<'a, 'tcx> SpecializedDecoder<Span> for DecodeContext<'a, 'tcx> {
let sess = if let Some(sess) = self.sess {
sess
} else {
return Ok(Span { lo, hi, ctxt });
return Ok(Span::new(lo, hi, ctxt));
};

let (lo, hi) = if lo > hi {
10 changes: 3 additions & 7 deletions src/libsyntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
@@ -189,10 +189,10 @@ impl HygieneData {

mark_queue.push_back(data.parent);
if let Some(ref info) = data.expn_info {
ctxt_queue.push_back(info.call_site.ctxt);
ctxt_queue.push_back(info.call_site.ctxt());

if let Some(span) = info.callee.span {
ctxt_queue.push_back(span.ctxt);
ctxt_queue.push_back(span.ctxt());
}
}

@@ -272,11 +272,7 @@ impl ImportedHygieneData {
}

pub fn translate_span(&self, external: Span) -> Span {
Span {
lo: external.lo,
hi: external.hi,
ctxt: self.translate_ctxt(external.ctxt),
}
Span::new(external.lo(), external.hi(), self.translate_ctxt(external.ctxt()))
}

fn translate_mark_data(&self, data: MarkData) -> MarkData {
2 changes: 1 addition & 1 deletion src/llvm
5 changes: 3 additions & 2 deletions src/test/compile-fail-fulldeps/auxiliary/macro_spans_lib.rs
Original file line number Diff line number Diff line change
@@ -8,18 +8,19 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[macro_export]
macro_rules! abc {
($name:ident) => {
mod $name {
macro_rules! $name {
($name2:ident) => {
struct $name {
$name2: u8,
$name2: $name,
}
}
}

$name!(AStruct)
$name!(some_field);
}
}
}
2 changes: 1 addition & 1 deletion src/test/compile-fail-fulldeps/macro-spans.rs
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@
#[macro_use]
extern crate macro_spans_lib;

abc!(Name)
abc!(Name); //~ ERROR recursive type `Name::Name` has infinite size
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test failed.

[00:56:33] ---- [compile-fail] compile-fail-fulldeps/macro-spans.rs stdout ----
[00:56:33] 	
[00:56:33] error: /checkout/src/test/compile-fail-fulldeps/macro-spans.rs:16: expected error not found: recursive type `Name::Name` has infinite size
[00:56:33] 
[00:56:33] error: 0 unexpected errors found, 1 expected errors not found
[00:56:33] status: exit code: 101
[00:56:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail-fulldeps/macro-spans.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail-fulldeps" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail-fulldeps/macro-spans.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail-fulldeps/macro-spans.stage2-x86_64-unknown-linux-gnu.compile-fail.libaux" "-A" "unused"
[00:56:33] not found errors (from test file): [
[00:56:33]     Error {
[00:56:33]         line_num: 16,
[00:56:33]         kind: Some(
[00:56:33]             Error
[00:56:33]         ),
[00:56:33]         msg: "recursive type `Name::Name` has infinite size"
[00:56:33]     }
[00:56:33] ]
[00:56:33] 
[00:56:33] thread '[compile-fail] compile-fail-fulldeps/macro-spans.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:1084:12
[00:56:33] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:56:33] 
[00:56:33] 
[00:56:33] failures:
[00:56:33]     [compile-fail] compile-fail-fulldeps/macro-spans.rs
[00:56:33] 
[00:56:33] test result: FAILED. 52 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out


fn main() { }
2 changes: 1 addition & 1 deletion src/tools/cargo
Submodule cargo updated 179 files
2 changes: 1 addition & 1 deletion src/tools/rls
Submodule rls updated from bfe80c to 93b47d
2 changes: 1 addition & 1 deletion src/tools/rust-installer