Skip to content

Commit 14dd5cd

Browse files
committed
---
yaml --- r: 277656 b: refs/heads/try c: eeb2f6d h: refs/heads/master
1 parent 50e25ff commit 14dd5cd

File tree

5 files changed

+54
-128
lines changed

5 files changed

+54
-128
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 102bab3d6811eb2ca672730e853add3b568c6210
4+
refs/heads/try: eeb2f6dde44a58513d15750d7df96488fc1f2e8d
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/mk/tests.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ ifdef CFG_ENABLE_DEBUGINFO_TESTS
616616
CTEST_RUSTC_FLAGS += -g
617617
endif
618618

619-
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
619+
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
620620
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
621621
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
622622
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
@@ -686,7 +686,7 @@ $(foreach host,$(CFG_HOST), \
686686

687687
define DEF_RUN_COMPILETEST
688688

689-
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
689+
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) = \
690690
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
691691
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
692692
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
@@ -779,7 +779,7 @@ $(foreach host,$(CFG_HOST), \
779779

780780
define DEF_RUN_PRETTY_TEST
781781

782-
PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
782+
PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) = \
783783
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
784784
--src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
785785
--build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \

branches/try/src/librustc_trans/debuginfo/metadata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,12 +1159,12 @@ fn prepare_struct_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
11591159
let struct_name = compute_debuginfo_type_name(cx, struct_type, false);
11601160
let struct_llvm_type = type_of::in_memory_type_of(cx, struct_type);
11611161

1162-
let (struct_def_id, variant, substs) = match struct_type.sty {
1163-
ty::TyStruct(def, substs) => (def.did, def.struct_variant(), substs),
1162+
let (variant, substs) = match struct_type.sty {
1163+
ty::TyStruct(def, substs) => (def.struct_variant(), substs),
11641164
_ => bug!("prepare_struct_metadata on a non-struct")
11651165
};
11661166

1167-
let (containing_scope, _) = get_namespace_and_span_for_item(cx, struct_def_id);
1167+
let (containing_scope, _) = get_namespace_and_span_for_item(cx, variant.did);
11681168

11691169
let struct_metadata_stub = create_struct_stub(cx,
11701170
struct_llvm_type,

branches/try/src/test/debuginfo/struct-namespace.rs

Lines changed: 0 additions & 70 deletions
This file was deleted.

branches/try/src/tools/compiletest/src/runtest.rs

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -880,62 +880,58 @@ fn cleanup_debug_info_options(options: &Option<String>) -> Option<String> {
880880

881881
fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String]) {
882882
let num_check_lines = check_lines.len();
883-
884-
let mut check_line_index = 0;
885-
for line in debugger_run_result.stdout.lines() {
886-
if check_line_index >= num_check_lines {
887-
break;
888-
}
889-
890-
if check_single_line(line, &(check_lines[check_line_index])[..]) {
891-
check_line_index += 1;
892-
}
893-
}
894-
if check_line_index != num_check_lines && num_check_lines > 0 {
895-
fatal_proc_rec(None, &format!("line not found in debugger output: {}",
896-
check_lines[check_line_index]),
897-
debugger_run_result);
898-
}
899-
900-
fn check_single_line(line: &str, check_line: &str) -> bool {
883+
if num_check_lines > 0 {
901884
// Allow check lines to leave parts unspecified (e.g., uninitialized
902-
// bits in the wrong case of an enum) with the notation "[...]".
903-
let line = line.trim();
904-
let check_line = check_line.trim();
905-
let can_start_anywhere = check_line.starts_with("[...]");
906-
let can_end_anywhere = check_line.ends_with("[...]");
907-
908-
let check_fragments: Vec<&str> = check_line.split("[...]")
909-
.filter(|frag| !frag.is_empty())
910-
.collect();
911-
if check_fragments.is_empty() {
912-
return true;
913-
}
914-
915-
let (mut rest, first_fragment) = if can_start_anywhere {
916-
match line.find(check_fragments[0]) {
917-
Some(pos) => (&line[pos + check_fragments[0].len() ..], 1),
918-
None => return false
919-
}
920-
} else {
921-
(line, 0)
922-
};
923-
924-
for fragment_index in first_fragment .. check_fragments.len() {
925-
let current_fragment = check_fragments[fragment_index];
926-
match rest.find(current_fragment) {
927-
Some(pos) => {
928-
rest = &rest[pos + current_fragment.len() .. ];
885+
// bits in the wrong case of an enum) with the notation "[...]".
886+
let check_fragments: Vec<Vec<String>> =
887+
check_lines.iter().map(|s| {
888+
s
889+
.trim()
890+
.split("[...]")
891+
.map(str::to_owned)
892+
.collect()
893+
}).collect();
894+
// check if each line in props.check_lines appears in the
895+
// output (in order)
896+
let mut i = 0;
897+
for line in debugger_run_result.stdout.lines() {
898+
let mut rest = line.trim();
899+
let mut first = true;
900+
let mut failed = false;
901+
for frag in &check_fragments[i] {
902+
let found = if first {
903+
if rest.starts_with(frag) {
904+
Some(0)
905+
} else {
906+
None
907+
}
908+
} else {
909+
rest.find(frag)
910+
};
911+
match found {
912+
None => {
913+
failed = true;
914+
break;
915+
}
916+
Some(i) => {
917+
rest = &rest[(i + frag.len())..];
918+
}
929919
}
930-
None => return false
920+
first = false;
921+
}
922+
if !failed && rest.is_empty() {
923+
i += 1;
924+
}
925+
if i == num_check_lines {
926+
// all lines checked
927+
break;
931928
}
932929
}
933-
934-
if !can_end_anywhere && !rest.is_empty() {
935-
return false;
930+
if i != num_check_lines {
931+
fatal_proc_rec(None, &format!("line not found in debugger output: {}",
932+
check_lines.get(i).unwrap()),
933+
debugger_run_result);
936934
}
937-
938-
return true;
939935
}
940936
}
941937

0 commit comments

Comments
 (0)