Skip to content

Commit 0dd2747

Browse files
---
yaml --- r: 234411 b: refs/heads/tmp c: b4afa8e h: refs/heads/master i: 234409: 29d041d 234407: 5b59ab4 v: v3
1 parent f78db48 commit 0dd2747

Some content is hidden

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

58 files changed

+148
-6405
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 6f142404d6f9e0b2ea87c4f58806bf763eb42d83
28+
refs/heads/tmp: b4afa8e2e5677ee18ecb138a53697a0275d6ebd0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/mk/crates.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ TARGET_CRATES := libc std flate arena term \
5454
log graphviz core rbml alloc \
5555
rustc_unicode rustc_bitflags \
5656
alloc_system
57-
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
57+
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
@@ -70,12 +70,11 @@ DEPS_std := core libc rand alloc collections rustc_unicode \
7070
DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags
7272
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
73-
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
73+
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
7474
rustc_trans rustc_privacy rustc_lint rustc_front
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7777
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
78-
DEPS_rustc_mir := rustc rustc_front syntax
7978
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
8079
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
8180
DEPS_rustc_resolve := rustc rustc_front log syntax

branches/tmp/mk/main.mk

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ RUST_LIB_FLAGS_ST3 += -C prefer-dynamic
172172
# by not emitting them.
173173
RUSTFLAGS_STAGE0 += -Z no-landing-pads
174174

175-
# Enable MIR to "always build" for crates where this works. This is
176-
# just temporary while MIR is being actively built up -- it's just a
177-
# poor man's unit testing infrastructure. Anyway we only want this for
178-
# stage1/stage2.
179-
define ADD_MIR_FLAG
180-
RUSTFLAGS1_$(1) += -Z always-build-mir
181-
RUSTFLAGS2_$(1) += -Z always-build-mir
182-
endef
183-
$(foreach crate,$(TARGET_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate))))
184-
$(foreach crate,$(RUSTC_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate))))
185-
$(foreach crate,$(HOST_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate))))
186-
187175
# platform-specific auto-configuration
188176
include $(CFG_SRC_DIR)mk/platform.mk
189177

branches/tmp/mk/target.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
9393
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
9494
$$(LLVM_STDCPP_RUSTFLAGS_$(2)) \
9595
$$(RUSTFLAGS_$(4)) \
96-
$$(RUSTFLAGS$(1)_$(4)) \
9796
$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
9897
--out-dir $$(@D) \
9998
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \

branches/tmp/src/doc/trpl/advanced-linking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ formal `#[link(...)]` attribute on `extern` blocks instead.
3434

3535
# Static linking
3636

37-
Static linking refers to the process of creating output that contain all
38-
required libraries and so don't need libraries installed on every system where
37+
Static linking refers to the process of creating output that contains all
38+
required libraries and so doesn't need libraries installed on every system where
3939
you want to use your compiled project. Pure-Rust dependencies are statically
4040
linked by default so you can use created binaries and libraries without
4141
installing Rust everywhere. By contrast, native libraries

branches/tmp/src/libcollections/macros.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
/// Note that unlike array expressions this syntax supports all elements
3333
/// which implement `Clone` and the number of elements doesn't have to be
3434
/// a constant.
35-
///
36-
/// This will use `clone()` to duplicate an expression, so one should be careful
37-
/// using this with types having a nonstandard `Clone` implementation. For
38-
/// example, `vec![Rc::new(1); 5]` will create a vector of five references
39-
/// to the same boxed integer value, not five references pointing to independently
40-
/// boxed integers.
4135
#[cfg(not(test))]
4236
#[macro_export]
4337
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/libgraphviz/lib.rs

Lines changed: 12 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,6 @@ pub enum LabelText<'a> {
313313
/// are also the escape sequences `\l` which left-justifies the
314314
/// preceding line and `\r` which right-justifies it.
315315
EscStr(Cow<'a, str>),
316-
317-
/// This uses a graphviz [HTML string label][html]. The string is
318-
/// printed exactly as given, but between `<` and `>`. **No
319-
/// escaping is performed.**
320-
///
321-
/// [html]: http://www.graphviz.org/content/node-shapes#html
322-
HtmlStr(Cow<'a, str>),
323316
}
324317

325318
/// The style for a node or edge.
@@ -460,14 +453,6 @@ pub trait Labeller<'a,N,E> {
460453
/// is a valid DOT identifier.
461454
fn node_id(&'a self, n: &N) -> Id<'a>;
462455

463-
/// Maps `n` to one of the [graphviz `shape` names][1]. If `None`
464-
/// is returned, no `shape` attribute is specified.
465-
///
466-
/// [1]: http://www.graphviz.org/content/node-shapes
467-
fn node_shape(&'a self, _node: &N) -> Option<LabelText<'a>> {
468-
None
469-
}
470-
471456
/// Maps `n` to a label that will be used in the rendered output.
472457
/// The label need not be unique, and may be the empty string; the
473458
/// default is just the output from `node_id`.
@@ -494,16 +479,6 @@ pub trait Labeller<'a,N,E> {
494479
}
495480
}
496481

497-
/// Escape tags in such a way that it is suitable for inclusion in a
498-
/// Graphviz HTML label.
499-
pub fn escape_html(s: &str) -> String {
500-
s
501-
.replace("&", "&amp;")
502-
.replace("\"", "&quot;")
503-
.replace("<", "&lt;")
504-
.replace(">", "&gt;")
505-
}
506-
507482
impl<'a> LabelText<'a> {
508483
pub fn label<S:IntoCow<'a, str>>(s: S) -> LabelText<'a> {
509484
LabelStr(s.into_cow())
@@ -513,10 +488,6 @@ impl<'a> LabelText<'a> {
513488
EscStr(s.into_cow())
514489
}
515490

516-
pub fn html<S:IntoCow<'a, str>>(s: S) -> LabelText<'a> {
517-
HtmlStr(s.into_cow())
518-
}
519-
520491
fn escape_char<F>(c: char, mut f: F) where F: FnMut(char) {
521492
match c {
522493
// not escaping \\, since Graphviz escString needs to
@@ -534,12 +505,10 @@ impl<'a> LabelText<'a> {
534505
}
535506

536507
/// Renders text as string suitable for a label in a .dot file.
537-
/// This includes quotes or suitable delimeters.
538-
pub fn to_dot_string(&self) -> String {
508+
pub fn escape(&self) -> String {
539509
match self {
540-
&LabelStr(ref s) => format!("\"{}\"", s.escape_default()),
541-
&EscStr(ref s) => format!("\"{}\"", LabelText::escape_str(&s[..])),
542-
&HtmlStr(ref s) => format!("<{}>", s),
510+
&LabelStr(ref s) => s.escape_default(),
511+
&EscStr(ref s) => LabelText::escape_str(&s[..]),
543512
}
544513
}
545514

@@ -555,7 +524,6 @@ impl<'a> LabelText<'a> {
555524
} else {
556525
s
557526
},
558-
HtmlStr(s) => s,
559527
}
560528
}
561529

@@ -644,15 +612,14 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N
644612
try!(indent(w));
645613
let id = g.node_id(n);
646614

647-
let escaped = &g.node_label(n).to_dot_string();
648-
let shape;
615+
let escaped = &g.node_label(n).escape();
649616

650617
let mut text = vec![id.as_slice()];
651618

652619
if !options.contains(&RenderOption::NoNodeLabels) {
653-
text.push("[label=");
620+
text.push("[label=\"");
654621
text.push(escaped);
655-
text.push("]");
622+
text.push("\"]");
656623
}
657624

658625
let style = g.node_style(n);
@@ -662,19 +629,12 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N
662629
text.push("\"]");
663630
}
664631

665-
if let Some(s) = g.node_shape(n) {
666-
shape = s.to_dot_string();
667-
text.push("[shape=");
668-
text.push(&shape);
669-
text.push("]");
670-
}
671-
672632
text.push(";");
673633
try!(writeln(w, &text));
674634
}
675635

676636
for e in g.edges().iter() {
677-
let escaped_label = &g.edge_label(e).to_dot_string();
637+
let escaped_label = &g.edge_label(e).escape();
678638
try!(indent(w));
679639
let source = g.source(e);
680640
let target = g.target(e);
@@ -684,9 +644,9 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N
684644
let mut text = vec![source_id.as_slice(), " -> ", target_id.as_slice()];
685645

686646
if !options.contains(&RenderOption::NoEdgeLabels) {
687-
text.push("[label=");
647+
text.push("[label=\"");
688648
text.push(escaped_label);
689-
text.push("]");
649+
text.push("\"]");
690650
}
691651

692652
let style = g.edge_style(e);
@@ -707,7 +667,7 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N
707667
mod tests {
708668
use self::NodeLabels::*;
709669
use super::{Id, Labeller, Nodes, Edges, GraphWalk, render, Style};
710-
use super::LabelText::{self, LabelStr, EscStr, HtmlStr};
670+
use super::LabelText::{self, LabelStr, EscStr};
711671
use std::io;
712672
use std::io::prelude::*;
713673
use std::borrow::IntoCow;
@@ -845,12 +805,12 @@ mod tests {
845805
fn node_id(&'a self, n: &Node) -> Id<'a> { self.graph.node_id(n) }
846806
fn node_label(&'a self, n: &Node) -> LabelText<'a> {
847807
match self.graph.node_label(n) {
848-
LabelStr(s) | EscStr(s) | HtmlStr(s) => EscStr(s),
808+
LabelStr(s) | EscStr(s) => EscStr(s),
849809
}
850810
}
851811
fn edge_label(&'a self, e: & &'a Edge) -> LabelText<'a> {
852812
match self.graph.edge_label(e) {
853-
LabelStr(s) | EscStr(s) | HtmlStr(s) => EscStr(s),
813+
LabelStr(s) | EscStr(s) => EscStr(s),
854814
}
855815
}
856816
}

branches/tmp/src/librustc/middle/astencode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ impl tr for def::Def {
470470
def::DefPrimTy(p) => def::DefPrimTy(p),
471471
def::DefTyParam(s, index, def_id, n) => def::DefTyParam(s, index, def_id.tr(dcx), n),
472472
def::DefUse(did) => def::DefUse(did.tr(dcx)),
473-
def::DefUpvar(nid1, index, nid2) => {
474-
def::DefUpvar(dcx.tr_id(nid1), index, dcx.tr_id(nid2))
473+
def::DefUpvar(nid1, nid2) => {
474+
def::DefUpvar(dcx.tr_id(nid1), dcx.tr_id(nid2))
475475
}
476476
def::DefStruct(did) => def::DefStruct(did.tr(dcx)),
477477
def::DefRegion(nid) => def::DefRegion(dcx.tr_id(nid)),

branches/tmp/src/librustc/middle/def.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub enum Def {
3838
DefTyParam(ParamSpace, u32, DefId, ast::Name),
3939
DefUse(DefId),
4040
DefUpvar(ast::NodeId, // id of closed over local
41-
usize, // index in the freevars list of the closure
4241
ast::NodeId), // expr node that creates the closure
4342

4443
/// Note that if it's a tuple struct's definition, the node id of the DefId
@@ -130,7 +129,7 @@ impl Def {
130129
id
131130
}
132131
DefLocal(id) |
133-
DefUpvar(id, _, _) |
132+
DefUpvar(id, _) |
134133
DefRegion(id) |
135134
DefLabel(id) |
136135
DefSelfTy(_, Some((_, id))) => {

branches/tmp/src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl OverloadedCallType {
246246
pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d+'t> {
247247
typer: &'t infer::InferCtxt<'a, 'tcx>,
248248
mc: mc::MemCategorizationContext<'t, 'a, 'tcx>,
249-
delegate: &'d mut Delegate<'tcx>,
249+
delegate: &'d mut (Delegate<'tcx>+'d),
250250
}
251251

252252
// If the TYPER results in an error, it's because the type check

branches/tmp/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> {
578578
}))
579579
}
580580

581-
def::DefUpvar(var_id, _, fn_node_id) => {
581+
def::DefUpvar(var_id, fn_node_id) => {
582582
let ty = try!(self.node_ty(fn_node_id));
583583
match ty.sty {
584584
ty::TyClosure(closure_id, _) => {

branches/tmp/src/librustc/middle/region.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ impl RegionMaps {
329329
pub fn item_extent(&self, n: ast::NodeId) -> CodeExtent {
330330
self.lookup_code_extent(CodeExtentData::DestructionScope(n))
331331
}
332-
pub fn opt_destruction_extent(&self, n: ast::NodeId) -> Option<CodeExtent> {
333-
self.code_extent_interner.borrow().get(&CodeExtentData::DestructionScope(n)).cloned()
334-
}
335332
pub fn intern_code_extent(&self,
336333
e: CodeExtentData,
337334
parent: CodeExtent) -> CodeExtent {

branches/tmp/src/librustc/middle/ty.rs

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3475,13 +3475,6 @@ impl<'tcx, 'container> AdtDefData<'tcx, 'container> {
34753475
.expect("variant_with_id: unknown variant")
34763476
}
34773477

3478-
pub fn variant_index_with_id(&self, vid: DefId) -> usize {
3479-
self.variants
3480-
.iter()
3481-
.position(|v| v.did == vid)
3482-
.expect("variant_index_with_id: unknown variant")
3483-
}
3484-
34853478
pub fn variant_of_def(&self, def: def::Def) -> &VariantDefData<'tcx, 'container> {
34863479
match def {
34873480
def::DefVariant(_, vid, _) => self.variant_with_id(vid),
@@ -5198,12 +5191,28 @@ impl<'tcx> TyS<'tcx> {
51985191

51995192
if !adjusted_ty.references_error() {
52005193
for i in 0..adj.autoderefs {
5201-
adjusted_ty =
5202-
adjusted_ty.adjust_for_autoderef(cx,
5203-
expr_id,
5204-
span,
5205-
i as u32,
5206-
&mut method_type);
5194+
let method_call = MethodCall::autoderef(expr_id, i as u32);
5195+
match method_type(method_call) {
5196+
Some(method_ty) => {
5197+
// Overloaded deref operators have all late-bound
5198+
// regions fully instantiated and coverge.
5199+
let fn_ret =
5200+
cx.no_late_bound_regions(&method_ty.fn_ret()).unwrap();
5201+
adjusted_ty = fn_ret.unwrap();
5202+
}
5203+
None => {}
5204+
}
5205+
match adjusted_ty.builtin_deref(true, NoPreference) {
5206+
Some(mt) => { adjusted_ty = mt.ty; }
5207+
None => {
5208+
cx.sess.span_bug(
5209+
span,
5210+
&format!("the {}th autoderef failed: {}",
5211+
i,
5212+
adjusted_ty)
5213+
);
5214+
}
5215+
}
52075216
}
52085217
}
52095218

@@ -5219,36 +5228,6 @@ impl<'tcx> TyS<'tcx> {
52195228
};
52205229
}
52215230

5222-
pub fn adjust_for_autoderef<F>(&'tcx self,
5223-
cx: &ctxt<'tcx>,
5224-
expr_id: ast::NodeId,
5225-
expr_span: Span,
5226-
autoderef: u32, // how many autoderefs so far?
5227-
mut method_type: F)
5228-
-> Ty<'tcx> where
5229-
F: FnMut(MethodCall) -> Option<Ty<'tcx>>,
5230-
{
5231-
let method_call = MethodCall::autoderef(expr_id, autoderef);
5232-
let mut adjusted_ty = self;
5233-
if let Some(method_ty) = method_type(method_call) {
5234-
// Method calls always have all late-bound regions
5235-
// fully instantiated.
5236-
let fn_ret = cx.no_late_bound_regions(&method_ty.fn_ret()).unwrap();
5237-
adjusted_ty = fn_ret.unwrap();
5238-
}
5239-
match adjusted_ty.builtin_deref(true, NoPreference) {
5240-
Some(mt) => mt.ty,
5241-
None => {
5242-
cx.sess.span_bug(
5243-
expr_span,
5244-
&format!("the {}th autoderef failed: {}",
5245-
autoderef,
5246-
adjusted_ty)
5247-
);
5248-
}
5249-
}
5250-
}
5251-
52525231
pub fn adjust_for_autoref(&'tcx self, cx: &ctxt<'tcx>,
52535232
autoref: Option<AutoRef<'tcx>>)
52545233
-> Ty<'tcx> {

0 commit comments

Comments
 (0)