Skip to content

Commit 0041345

Browse files
committed
---
yaml --- r: 274343 b: refs/heads/stable c: 7bd87c1 h: refs/heads/master i: 274341: 8e8831d 274339: 1a94875 274335: 9b8d8c2
1 parent b1a768e commit 0041345

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4532
-511
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 63b4639691d3d064218055a63473515aee14f64c
32+
refs/heads/stable: 7bd87c1f1b8afabcf1bafa14dd13c59f00b4f4be
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ do
14091409
make_dir $h/test/debuginfo-gdb
14101410
make_dir $h/test/debuginfo-lldb
14111411
make_dir $h/test/codegen
1412+
make_dir $h/test/codegen-units
14121413
make_dir $h/test/rustdoc
14131414
done
14141415

branches/stable/mk/tests.mk

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
310310
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
311311
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
312312
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
313+
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
313314
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
314315
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
315316

@@ -473,6 +474,7 @@ DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
473474
DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
474475
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
475476
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
477+
CODEGEN_UNITS_RS := $(wildcard $(S)src/test/codegen-units/*.rs)
476478
RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)
477479

478480
RPASS_TESTS := $(RPASS_RS)
@@ -488,6 +490,7 @@ PRETTY_TESTS := $(PRETTY_RS)
488490
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
489491
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
490492
CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
493+
CODEGEN_UNITS_TESTS := $(CODEGEN_UNITS_RS)
491494
RUSTDOCCK_TESTS := $(RUSTDOCCK_RS)
492495

493496
CTEST_SRC_BASE_rpass = run-pass
@@ -550,6 +553,11 @@ CTEST_BUILD_BASE_codegen = codegen
550553
CTEST_MODE_codegen = codegen
551554
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
552555

556+
CTEST_SRC_BASE_codegen-units = codegen-units
557+
CTEST_BUILD_BASE_codegen-units = codegen-units
558+
CTEST_MODE_codegen-units = codegen-units
559+
CTEST_RUNTOOL_codegen-units = $(CTEST_RUNTOOL)
560+
553561
CTEST_SRC_BASE_rustdocck = rustdoc
554562
CTEST_BUILD_BASE_rustdocck = rustdoc
555563
CTEST_MODE_rustdocck = rustdoc
@@ -673,6 +681,7 @@ CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
673681
$(S)src/etc/lldb_batchmode.py \
674682
$(S)src/etc/lldb_rust_formatters.py
675683
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
684+
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
676685
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
677686
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
678687
$(S)src/etc/htmldocck.py
@@ -739,7 +748,7 @@ endif
739748
endef
740749

741750
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
742-
bench debuginfo-gdb debuginfo-lldb codegen rustdocck
751+
bench debuginfo-gdb debuginfo-lldb codegen codegen-units rustdocck
743752

744753
$(foreach host,$(CFG_HOST), \
745754
$(eval $(foreach target,$(CFG_TARGET), \
@@ -917,6 +926,7 @@ TEST_GROUPS = \
917926
debuginfo-gdb \
918927
debuginfo-lldb \
919928
codegen \
929+
codegen-units \
920930
doc \
921931
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
922932
pretty \

branches/stable/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub enum Mode {
2525
DebugInfoLldb,
2626
Codegen,
2727
Rustdoc,
28+
CodegenUnits
2829
}
2930

3031
impl FromStr for Mode {
@@ -41,6 +42,7 @@ impl FromStr for Mode {
4142
"debuginfo-gdb" => Ok(DebugInfoGdb),
4243
"codegen" => Ok(Codegen),
4344
"rustdoc" => Ok(Rustdoc),
45+
"codegen-units" => Ok(CodegenUnits),
4446
_ => Err(()),
4547
}
4648
}
@@ -59,6 +61,7 @@ impl fmt::Display for Mode {
5961
DebugInfoLldb => "debuginfo-lldb",
6062
Codegen => "codegen",
6163
Rustdoc => "rustdoc",
64+
CodegenUnits => "codegen-units",
6265
}, f)
6366
}
6467
}

branches/stable/src/compiletest/runtest.rs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010

1111
use common::Config;
1212
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind};
13-
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc};
13+
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc, CodegenUnits};
1414
use errors;
1515
use header::TestProps;
1616
use header;
1717
use procsrv;
1818
use util::logv;
1919

2020
use std::env;
21+
use std::collections::HashSet;
2122
use std::fmt;
2223
use std::fs::{self, File};
2324
use std::io::BufReader;
@@ -56,6 +57,7 @@ pub fn run(config: Config, testfile: &Path) {
5657
DebugInfoLldb => run_debuginfo_lldb_test(&config, &props, &testfile),
5758
Codegen => run_codegen_test(&config, &props, &testfile),
5859
Rustdoc => run_rustdoc_test(&config, &props, &testfile),
60+
CodegenUnits => run_codegen_units_test(&config, &props, &testfile),
5961
}
6062
}
6163

@@ -1747,3 +1749,44 @@ fn run_rustdoc_test(config: &Config, props: &TestProps, testfile: &Path) {
17471749
fatal_proc_rec("htmldocck failed!", &res);
17481750
}
17491751
}
1752+
1753+
fn run_codegen_units_test(config: &Config, props: &TestProps, testfile: &Path) {
1754+
let proc_res = compile_test(config, props, testfile);
1755+
1756+
if !proc_res.status.success() {
1757+
fatal_proc_rec("compilation failed!", &proc_res);
1758+
}
1759+
1760+
check_no_compiler_crash(&proc_res);
1761+
1762+
let prefix = "TRANS_ITEM ";
1763+
1764+
let actual: HashSet<String> = proc_res
1765+
.stdout
1766+
.lines()
1767+
.filter(|line| line.starts_with(prefix))
1768+
.map(|s| (&s[prefix.len()..]).to_string())
1769+
.collect();
1770+
1771+
let expected: HashSet<String> = errors::load_errors(testfile)
1772+
.iter()
1773+
.map(|e| e.msg.trim().to_string())
1774+
.collect();
1775+
1776+
if actual != expected {
1777+
let mut missing: Vec<_> = expected.difference(&actual).collect();
1778+
missing.sort();
1779+
1780+
let mut too_much: Vec<_> = actual.difference(&expected).collect();
1781+
too_much.sort();
1782+
1783+
println!("Expected and actual sets of codegen-items differ.\n\
1784+
These items should have been contained but were not:\n\n\
1785+
{}\n\n\
1786+
These items were contained but should not have been:\n\n\
1787+
{}\n\n",
1788+
missing.iter().fold("".to_string(), |s1, s2| s1 + "\n" + s2),
1789+
too_much.iter().fold("".to_string(), |s1, s2| s1 + "\n" + s2));
1790+
panic!();
1791+
}
1792+
}

branches/stable/src/librustc/front/map/definitions.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,33 +196,33 @@ impl DefPathData {
196196

197197
PositionalField |
198198
Field(hir::StructFieldKind::UnnamedField(_)) => {
199-
InternedString::new("<field>")
199+
InternedString::new("{{field}}")
200200
}
201201

202202
// note that this does not show up in user printouts
203203
CrateRoot => {
204-
InternedString::new("<root>")
204+
InternedString::new("{{root}}")
205205
}
206206

207207
// note that this does not show up in user printouts
208208
InlinedRoot(_) => {
209-
InternedString::new("<inlined-root>")
209+
InternedString::new("{{inlined-root}}")
210210
}
211211

212212
Misc => {
213-
InternedString::new("?")
213+
InternedString::new("{{?}}")
214214
}
215215

216216
ClosureExpr => {
217-
InternedString::new("<closure>")
217+
InternedString::new("{{closure}}")
218218
}
219219

220220
StructCtor => {
221-
InternedString::new("<constructor>")
221+
InternedString::new("{{constructor}}")
222222
}
223223

224224
Initializer => {
225-
InternedString::new("<initializer>")
225+
InternedString::new("{{initializer}}")
226226
}
227227
}
228228
}

branches/stable/src/librustc/middle/cstore.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ pub trait CrateStore<'tcx> : Any {
223223
-> FoundAst<'tcx>;
224224
fn maybe_get_item_mir(&self, tcx: &ty::ctxt<'tcx>, def: DefId)
225225
-> Option<Mir<'tcx>>;
226+
fn is_item_mir_available(&self, def: DefId) -> bool;
227+
226228
// This is basically a 1-based range of ints, which is a little
227229
// silly - I may fix that.
228230
fn crates(&self) -> Vec<ast::CrateNum>;
@@ -401,6 +403,9 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
401403
-> FoundAst<'tcx> { unimplemented!() }
402404
fn maybe_get_item_mir(&self, tcx: &ty::ctxt<'tcx>, def: DefId)
403405
-> Option<Mir<'tcx>> { unimplemented!() }
406+
fn is_item_mir_available(&self, def: DefId) -> bool {
407+
unimplemented!()
408+
}
404409

405410
// This is basically a 1-based range of ints, which is a little
406411
// silly - I may fix that.

branches/stable/src/librustc/middle/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ impl<'tcx> ctxt<'tcx> {
563563
const_qualif_map: RefCell::new(NodeMap()),
564564
custom_coerce_unsized_kinds: RefCell::new(DefIdMap()),
565565
cast_kinds: RefCell::new(NodeMap()),
566-
fragment_infos: RefCell::new(DefIdMap()),
566+
fragment_infos: RefCell::new(DefIdMap())
567567
}, f)
568568
}
569569
}

branches/stable/src/librustc/middle/ty/maps.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use middle::def_id::DefId;
1313
use middle::ty;
1414
use std::marker::PhantomData;
1515
use std::rc::Rc;
16-
use syntax::attr;
16+
use syntax::{attr, ast};
1717

1818
macro_rules! dep_map_ty {
1919
($ty_name:ident : $node_name:ident ($key:ty) -> $value:ty) => {
@@ -42,3 +42,4 @@ dep_map_ty! { InherentImpls: InherentImpls(DefId) -> Rc<Vec<DefId>> }
4242
dep_map_ty! { ImplItems: ImplItems(DefId) -> Vec<ty::ImplOrTraitItemId> }
4343
dep_map_ty! { TraitItems: TraitItems(DefId) -> Rc<Vec<ty::ImplOrTraitItem<'tcx>>> }
4444
dep_map_ty! { ReprHints: ReprHints(DefId) -> Rc<Vec<attr::ReprAttr>> }
45+
dep_map_ty! { InlinedClosures: Hir(DefId) -> ast::NodeId }

branches/stable/src/librustc/mir/repr.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::{iter, u32};
2525
use std::ops::{Index, IndexMut};
2626

2727
/// Lowered representation of a single function.
28-
#[derive(RustcEncodable, RustcDecodable)]
28+
#[derive(Clone, RustcEncodable, RustcDecodable)]
2929
pub struct Mir<'tcx> {
3030
/// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
3131
/// that indexes into this vector.
@@ -146,7 +146,7 @@ pub enum BorrowKind {
146146

147147
// A "variable" is a binding declared by the user as part of the fn
148148
// decl, a let, etc.
149-
#[derive(RustcEncodable, RustcDecodable)]
149+
#[derive(Clone, RustcEncodable, RustcDecodable)]
150150
pub struct VarDecl<'tcx> {
151151
pub mutability: Mutability,
152152
pub name: Name,
@@ -155,7 +155,7 @@ pub struct VarDecl<'tcx> {
155155

156156
// A "temp" is a temporary that we place on the stack. They are
157157
// anonymous, always mutable, and have only a type.
158-
#[derive(RustcEncodable, RustcDecodable)]
158+
#[derive(Clone, RustcEncodable, RustcDecodable)]
159159
pub struct TempDecl<'tcx> {
160160
pub ty: Ty<'tcx>,
161161
}
@@ -171,7 +171,7 @@ pub struct TempDecl<'tcx> {
171171
//
172172
// there is only one argument, of type `(i32, u32)`, but two bindings
173173
// (`x` and `y`).
174-
#[derive(RustcEncodable, RustcDecodable)]
174+
#[derive(Clone, RustcEncodable, RustcDecodable)]
175175
pub struct ArgDecl<'tcx> {
176176
pub ty: Ty<'tcx>,
177177
}
@@ -207,14 +207,14 @@ impl Debug for BasicBlock {
207207
///////////////////////////////////////////////////////////////////////////
208208
// BasicBlock and Terminator
209209

210-
#[derive(Debug, RustcEncodable, RustcDecodable)]
210+
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
211211
pub struct BasicBlockData<'tcx> {
212212
pub statements: Vec<Statement<'tcx>>,
213213
pub terminator: Option<Terminator<'tcx>>,
214214
pub is_cleanup: bool,
215215
}
216216

217-
#[derive(RustcEncodable, RustcDecodable)]
217+
#[derive(Clone, RustcEncodable, RustcDecodable)]
218218
pub enum Terminator<'tcx> {
219219
/// block should have one successor in the graph; we jump there
220220
Goto {
@@ -481,13 +481,13 @@ impl<'tcx> Terminator<'tcx> {
481481
///////////////////////////////////////////////////////////////////////////
482482
// Statements
483483

484-
#[derive(RustcEncodable, RustcDecodable)]
484+
#[derive(Clone, RustcEncodable, RustcDecodable)]
485485
pub struct Statement<'tcx> {
486486
pub span: Span,
487487
pub kind: StatementKind<'tcx>,
488488
}
489489

490-
#[derive(Debug, RustcEncodable, RustcDecodable)]
490+
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
491491
pub enum StatementKind<'tcx> {
492492
Assign(Lvalue<'tcx>, Rvalue<'tcx>),
493493
Drop(DropKind, Lvalue<'tcx>),
@@ -721,7 +721,7 @@ pub enum Rvalue<'tcx> {
721721
InlineAsm(InlineAsm),
722722
}
723723

724-
#[derive(Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
724+
#[derive(Clone, Copy, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
725725
pub enum CastKind {
726726
Misc,
727727

branches/stable/src/librustc/session/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
643643
"keep the AST after lowering it to HIR"),
644644
show_span: Option<String> = (None, parse_opt_string,
645645
"show spans for compiler debugging (expr|pat|ty)"),
646+
print_trans_items: Option<String> = (None, parse_opt_string,
647+
"print the result of the translation item collection pass"),
646648
}
647649

648650
pub fn default_lib_output() -> CrateType {

0 commit comments

Comments
 (0)