Skip to content

Commit d6dcbd3

Browse files
committed
---
yaml --- r: 143932 b: refs/heads/try2 c: b820748 h: refs/heads/master v: v3
1 parent 58b5352 commit d6dcbd3

Some content is hidden

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

80 files changed

+1144
-3107
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 433fbe8fcf13724445cc57c85cc454352c969429
8+
refs/heads/try2: b820748ff5a2bc09b58dd7ac511e0f607d55f2e9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/crypto/sha1.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Sha1 {
159159
}
160160

161161
impl Digest for Sha1 {
162-
fn reset(&mut self) {
162+
pub fn reset(&mut self) {
163163
self.length_bits = 0;
164164
self.h[0] = 0x67452301u32;
165165
self.h[1] = 0xEFCDAB89u32;
@@ -169,9 +169,9 @@ impl Digest for Sha1 {
169169
self.buffer.reset();
170170
self.computed = false;
171171
}
172-
fn input(&mut self, msg: &[u8]) { add_input(self, msg); }
173-
fn result(&mut self, out: &mut [u8]) { return mk_result(self, out); }
174-
fn output_bits(&self) -> uint { 160 }
172+
pub fn input(&mut self, msg: &[u8]) { add_input(self, msg); }
173+
pub fn result(&mut self, out: &mut [u8]) { return mk_result(self, out); }
174+
pub fn output_bits(&self) -> uint { 160 }
175175
}
176176

177177
#[cfg(test)]

branches/try2/src/libextra/enum_set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ pub struct EnumSet<E> {
2121
/// An iterface for casting C-like enum to uint and back.
2222
pub trait CLike {
2323
/// Converts C-like enum to uint.
24-
fn to_uint(&self) -> uint;
24+
pub fn to_uint(&self) -> uint;
2525
/// Converts uint to C-like enum.
26-
fn from_uint(uint) -> Self;
26+
pub fn from_uint(uint) -> Self;
2727
}
2828

2929
fn bit<E:CLike>(e: E) -> uint {
@@ -142,11 +142,11 @@ mod test {
142142
}
143143

144144
impl CLike for Foo {
145-
fn to_uint(&self) -> uint {
145+
pub fn to_uint(&self) -> uint {
146146
*self as uint
147147
}
148148

149-
fn from_uint(v: uint) -> Foo {
149+
pub fn from_uint(v: uint) -> Foo {
150150
unsafe { cast::transmute(v) }
151151
}
152152
}

branches/try2/src/libextra/num/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ impl ToStrRadix for BigUint {
537537
impl FromStrRadix for BigUint {
538538
/// Creates and initializes an BigUint.
539539
540-
fn from_str_radix(s: &str, radix: uint)
540+
pub fn from_str_radix(s: &str, radix: uint)
541541
-> Option<BigUint> {
542542
BigUint::parse_bytes(s.as_bytes(), radix)
543543
}

branches/try2/src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub struct Metric {
104104
pub struct MetricMap(TreeMap<~str,Metric>);
105105

106106
impl Clone for MetricMap {
107-
fn clone(&self) -> MetricMap {
107+
pub fn clone(&self) -> MetricMap {
108108
MetricMap((**self).clone())
109109
}
110110
}

branches/try2/src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ impl<K: TotalOrd, V, T: Iterator<(K, V)>> Extendable<(K, V), T> for TreeMap<K, V
853853
}
854854

855855
impl<T: TotalOrd, Iter: Iterator<T>> FromIterator<T, Iter> for TreeSet<T> {
856-
fn from_iterator(iter: &mut Iter) -> TreeSet<T> {
856+
pub fn from_iterator(iter: &mut Iter) -> TreeSet<T> {
857857
let mut set = TreeSet::new();
858858
set.extend(iter);
859859
set

branches/try2/src/libextra/url.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ pub fn to_str(url: &Url) -> ~str {
701701
}
702702

703703
impl ToStr for Url {
704-
fn to_str(&self) -> ~str {
704+
pub fn to_str(&self) -> ~str {
705705
to_str(self)
706706
}
707707
}

branches/try2/src/librustc/middle/privacy.rs

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ pub fn check_crate<'mm>(tcx: ty::ctxt,
351351
// Do not check privacy inside items with the resolve_unexported
352352
// attribute. This is used for the test runner.
353353
if !attr::contains_name(item.attrs, "!resolve_unexported") {
354-
check_sane_privacy(tcx, item);
355354
oldvisit::visit_item(item, (method_map, visitor));
356355
}
357356
},
@@ -541,81 +540,3 @@ pub fn check_crate<'mm>(tcx: ty::ctxt,
541540
});
542541
oldvisit::visit_crate(crate, (method_map, visitor));
543542
}
544-
545-
/// Validates all of the visibility qualifers placed on the item given. This
546-
/// ensures that there are no extraneous qualifiers that don't actually do
547-
/// anything. In theory these qualifiers wouldn't parse, but that may happen
548-
/// later on down the road...
549-
fn check_sane_privacy(tcx: ty::ctxt, item: @ast::item) {
550-
match item.node {
551-
// implementations of traits don't need visibility qualifiers because
552-
// that's controlled by having the trait in scope.
553-
ast::item_impl(_, Some(*), _, ref methods) => {
554-
for m in methods.iter() {
555-
match m.vis {
556-
ast::private | ast::public => {
557-
tcx.sess.span_err(m.span, "unnecessary visibility")
558-
}
559-
ast::inherited => {}
560-
}
561-
}
562-
}
563-
564-
ast::item_enum(ref def, _) => {
565-
for v in def.variants.iter() {
566-
match v.node.vis {
567-
ast::public => {
568-
if item.vis == ast::public {
569-
tcx.sess.span_err(v.span, "unnecessary `pub` \
570-
visibility");
571-
}
572-
}
573-
ast::private => {
574-
if item.vis != ast::public {
575-
tcx.sess.span_err(v.span, "unnecessary `priv` \
576-
visibility");
577-
}
578-
}
579-
ast::inherited => {}
580-
}
581-
}
582-
}
583-
584-
ast::item_struct(ref def, _) => {
585-
for f in def.fields.iter() {
586-
match f.node.kind {
587-
ast::named_field(_, ast::public) => {
588-
tcx.sess.span_err(f.span, "unnecessary `pub` \
589-
visibility");
590-
}
591-
ast::named_field(_, ast::private) => {
592-
// Fields should really be private by default...
593-
}
594-
ast::named_field(*) | ast::unnamed_field => {}
595-
}
596-
}
597-
}
598-
599-
ast::item_trait(_, _, ref methods) => {
600-
for m in methods.iter() {
601-
match *m {
602-
ast::provided(ref m) => {
603-
match m.vis {
604-
ast::private | ast::public => {
605-
tcx.sess.span_err(m.span, "unnecessary \
606-
visibility");
607-
}
608-
ast::inherited => {}
609-
}
610-
}
611-
// this is warned about in the parser
612-
ast::required(*) => {}
613-
}
614-
}
615-
}
616-
617-
ast::item_impl(*) | ast::item_static(*) | ast::item_foreign_mod(*) |
618-
ast::item_fn(*) | ast::item_mod(*) | ast::item_ty(*) |
619-
ast::item_mac(*) => {}
620-
}
621-
}

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ use middle::trans::expr;
214214
use middle::trans::glue;
215215
use middle::trans::tvec;
216216
use middle::trans::type_of;
217-
use middle::trans::debuginfo;
218217
use middle::ty;
219218
use util::common::indenter;
220219
use util::ppaux::{Repr, vec_map_to_str};
@@ -386,7 +385,6 @@ struct BindingInfo {
386385
llmatch: ValueRef,
387386
trmode: TransBindingMode,
388387
id: ast::NodeId,
389-
span: span,
390388
ty: ty::t,
391389
}
392390

@@ -1307,7 +1305,7 @@ fn insert_lllocals(bcx: @mut Block,
13071305
BindArgument => bcx.fcx.llargs
13081306
};
13091307

1310-
for (&ident, &binding_info) in bindings_map.iter() {
1308+
for (_, &binding_info) in bindings_map.iter() {
13111309
let llval = match binding_info.trmode {
13121310
// By value bindings: use the stack slot that we
13131311
// copied/moved the value into
@@ -1327,14 +1325,6 @@ fn insert_lllocals(bcx: @mut Block,
13271325

13281326
debug!("binding %? to %s", binding_info.id, bcx.val_to_str(llval));
13291327
llmap.insert(binding_info.id, llval);
1330-
1331-
if bcx.sess().opts.extra_debuginfo {
1332-
debuginfo::create_match_binding_metadata(bcx,
1333-
ident,
1334-
binding_info.id,
1335-
binding_info.ty,
1336-
binding_info.span);
1337-
}
13381328
}
13391329
return bcx;
13401330
}
@@ -1781,7 +1771,7 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::pat) -> BindingsMap {
17811771
let ccx = bcx.ccx();
17821772
let tcx = bcx.tcx();
17831773
let mut bindings_map = HashMap::new();
1784-
do pat_bindings(tcx.def_map, pat) |bm, p_id, span, path| {
1774+
do pat_bindings(tcx.def_map, pat) |bm, p_id, _s, path| {
17851775
let ident = path_to_ident(path);
17861776
let variable_ty = node_id_type(bcx, p_id);
17871777
let llvariable_ty = type_of::type_of(ccx, variable_ty);
@@ -1803,11 +1793,8 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::pat) -> BindingsMap {
18031793
}
18041794
};
18051795
bindings_map.insert(ident, BindingInfo {
1806-
llmatch: llmatch,
1807-
trmode: trmode,
1808-
id: p_id,
1809-
span: span,
1810-
ty: variable_ty
1796+
llmatch: llmatch, trmode: trmode,
1797+
id: p_id, ty: variable_ty
18111798
});
18121799
}
18131800
return bindings_map;

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<'self> StatRecorder<'self> {
165165

166166
#[unsafe_destructor]
167167
impl<'self> Drop for StatRecorder<'self> {
168-
fn drop(&self) {
168+
pub fn drop(&self) {
169169
if self.ccx.sess.trans_stats() {
170170
let end = time::precise_time_ns();
171171
let elapsed = ((end - self.start) / 1_000_000) as uint;
@@ -1103,6 +1103,7 @@ pub fn trans_stmt(cx: @mut Block, s: &ast::stmt) -> @mut Block {
11031103
}
11041104

11051105
let mut bcx = cx;
1106+
debuginfo::update_source_pos(cx, s.span);
11061107

11071108
match s.node {
11081109
ast::stmt_expr(e, _) | ast::stmt_semi(e, _) => {
@@ -1633,8 +1634,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16331634
param_substs: param_substs,
16341635
span: sp,
16351636
path: path,
1636-
ccx: ccx,
1637-
debug_context: None,
1637+
ccx: ccx
16381638
};
16391639
fcx.llenv = unsafe {
16401640
llvm::LLVMGetParam(llfndecl, fcx.env_arg_pos() as c_uint)
@@ -1933,7 +1933,7 @@ pub fn trans_fn(ccx: @mut CrateContext,
19331933
attrs,
19341934
output_type,
19351935
|fcx| {
1936-
if ccx.sess.opts.debuginfo
1936+
if ccx.sess.opts.extra_debuginfo
19371937
&& fcx_has_nonzero_span(fcx) {
19381938
debuginfo::create_function_metadata(fcx);
19391939
}

branches/try2/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use middle::trans::build;
2323
use middle::trans::datum;
2424
use middle::trans::glue;
2525
use middle::trans::write_guard;
26-
use middle::trans::debuginfo;
2726
use middle::ty::substs;
2827
use middle::ty;
2928
use middle::typeck;
@@ -227,10 +226,7 @@ pub struct FunctionContext {
227226
path: path,
228227

229228
// This function's enclosing crate context.
230-
ccx: @mut CrateContext,
231-
232-
// Used and maintained by the debuginfo module.
233-
debug_context: Option<~debuginfo::FunctionDebugContext>
229+
ccx: @mut CrateContext
234230
}
235231

236232
impl FunctionContext {

branches/try2/src/librustc/middle/trans/controlflow.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use middle::trans::base::*;
1919
use middle::trans::build::*;
2020
use middle::trans::callee;
2121
use middle::trans::common::*;
22+
use middle::trans::debuginfo;
2223
use middle::trans::expr;
2324
use middle::trans::type_of::*;
2425
use middle::ty;
@@ -37,10 +38,12 @@ pub fn trans_block(bcx: @mut Block, b: &ast::Block, dest: expr::Dest) -> @mut Bl
3738
let _icx = push_ctxt("trans_block");
3839
let mut bcx = bcx;
3940
for s in b.stmts.iter() {
41+
debuginfo::update_source_pos(bcx, b.span);
4042
bcx = trans_stmt(bcx, *s);
4143
}
4244
match b.expr {
4345
Some(e) => {
46+
debuginfo::update_source_pos(bcx, e.span);
4447
bcx = expr::trans_into(bcx, e, dest);
4548
}
4649
None => {

0 commit comments

Comments
 (0)