Skip to content

Commit 447dfce

Browse files
committed
---
yaml --- r: 81916 b: refs/heads/master c: c429c7c h: refs/heads/master v: v3
1 parent 1b53e24 commit 447dfce

File tree

11 files changed

+115
-437
lines changed

11 files changed

+115
-437
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 964da1c9fd4ee0563cdcc7ff66cf60a3972127ee
2+
refs/heads/master: c429c7c04b9c19c2ca5992b5f4e094e83832dcb8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/libextra/bitv.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl Bitv {
523523
* with the most significant bits of each byte coming first. Each
524524
* bit becomes true if equal to 1 or false if equal to 0.
525525
*/
526-
pub fn from_utf8(bytes: &[u8]) -> Bitv {
526+
pub fn from_bytes(bytes: &[u8]) -> Bitv {
527527
from_fn(bytes.len() * 8, |i| {
528528
let b = bytes[i / 8] as uint;
529529
let offset = i % 8;
@@ -1275,8 +1275,8 @@ mod tests {
12751275
}
12761276
12771277
#[test]
1278-
fn test_from_utf8() {
1279-
let bitv = from_utf8([0b10110110, 0b00000000, 0b11111111]);
1278+
fn test_from_bytes() {
1279+
let bitv = from_bytes([0b10110110, 0b00000000, 0b11111111]);
12801280
let str = ~"10110110" + "00000000" + "11111111";
12811281
assert_eq!(bitv.to_str(), str);
12821282
}
@@ -1302,7 +1302,7 @@ mod tests {
13021302
#[test]
13031303
fn test_to_bools() {
13041304
let bools = ~[false, false, true, false, false, true, true, false];
1305-
assert_eq!(from_utf8([0b00100110]).to_bools(), bools);
1305+
assert_eq!(from_bytes([0b00100110]).to_bools(), bools);
13061306
}
13071307
13081308
#[test]

trunk/src/libextra/crypto/md5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static C4: [u32, ..16] = [
156156

157157

158158
/// The MD5 Digest algorithm
159-
struct Md5 {
159+
pub struct Md5 {
160160
priv length_bytes: u64,
161161
priv buffer: FixedBuffer64,
162162
priv state: Md5State,

trunk/src/libextra/crypto/sha2.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ impl Engine512 {
230230
}
231231

232232

233-
struct Sha512 {
233+
/// The SHA-512 hash algorithm
234+
pub struct Sha512 {
234235
priv engine: Engine512
235236
}
236237

@@ -282,7 +283,8 @@ static H512: [u64, ..8] = [
282283
];
283284

284285

285-
struct Sha384 {
286+
/// The SHA-384 hash algorithm
287+
pub struct Sha384 {
286288
priv engine: Engine512
287289
}
288290

@@ -332,7 +334,8 @@ static H384: [u64, ..8] = [
332334
];
333335

334336

335-
struct Sha512Trunc256 {
337+
/// The SHA-512 hash algorithm with digest truncated to 256 bits
338+
pub struct Sha512Trunc256 {
336339
priv engine: Engine512
337340
}
338341

@@ -380,7 +383,8 @@ static H512_TRUNC_256: [u64, ..8] = [
380383
];
381384

382385

383-
struct Sha512Trunc224 {
386+
/// The SHA-512 hash algorithm with digest truncated to 224 bits
387+
pub struct Sha512Trunc224 {
384388
priv engine: Engine512
385389
}
386390

@@ -635,7 +639,8 @@ impl Engine256 {
635639
}
636640

637641

638-
struct Sha256 {
642+
/// The SHA-256 hash algorithm
643+
pub struct Sha256 {
639644
priv engine: Engine256
640645
}
641646

@@ -687,7 +692,8 @@ static H256: [u32, ..8] = [
687692
];
688693

689694

690-
struct Sha224 {
695+
/// The SHA-224 hash algorithm
696+
pub struct Sha224 {
691697
priv engine: Engine256
692698
}
693699

trunk/src/libextra/url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::to_bytes;
2121
use std::uint;
2222

2323
#[deriving(Clone, Eq)]
24-
struct Url {
24+
pub struct Url {
2525
scheme: ~str,
2626
user: Option<UserInfo>,
2727
host: ~str,
@@ -32,7 +32,7 @@ struct Url {
3232
}
3333

3434
#[deriving(Clone, Eq)]
35-
struct UserInfo {
35+
pub struct UserInfo {
3636
user: ~str,
3737
pass: Option<~str>
3838
}

trunk/src/librustc/middle/typeck/check/method.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl<'self> LookupContext<'self> {
372372
// to a trait and its supertraits.
373373
fn get_method_index(&self,
374374
trait_ref: @TraitRef,
375-
subtrait_id: ast::DefId,
375+
subtrait: @TraitRef,
376376
n_method: uint) -> uint {
377377
let tcx = self.tcx();
378378

@@ -382,15 +382,14 @@ impl<'self> LookupContext<'self> {
382382
// we find the trait the method came from, counting up the
383383
// methods from them.
384384
let mut method_count = 0;
385-
do ty::each_bound_trait_and_supertraits(tcx, &[trait_ref])
385+
do ty::each_bound_trait_and_supertraits(tcx, &[subtrait])
386386
|bound_ref| {
387-
if bound_ref.def_id == subtrait_id { false }
387+
if bound_ref.def_id == trait_ref.def_id { false }
388388
else {
389389
method_count += ty::trait_methods(tcx, bound_ref.def_id).len();
390390
true
391391
}
392392
};
393-
394393
return method_count + n_method;
395394
}
396395

@@ -418,9 +417,9 @@ impl<'self> LookupContext<'self> {
418417
let trait_ref = @TraitRef { def_id: did, substs: rcvr_substs.clone() };
419418

420419
do self.push_inherent_candidates_from_bounds_inner(&[trait_ref])
421-
|trait_ref, m, method_num, _bound_num| {
420+
|new_trait_ref, m, method_num, _bound_num| {
422421
let vtable_index =
423-
self.get_method_index(trait_ref, trait_ref.def_id, method_num);
422+
self.get_method_index(new_trait_ref, trait_ref, method_num);
424423
// We need to fix up the transformed self type.
425424
let transformed_self_ty =
426425
self.construct_transformed_self_ty_for_object(

trunk/src/librustdoc/html/render.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,14 @@ impl Context {
521521
}
522522
}
523523
}
524+
clean::StructItem(s) => {
525+
let mut it = s.fields.move_iter();
526+
do self.recurse(name) |this| {
527+
for item in it {
528+
f(this, item);
529+
}
530+
}
531+
}
524532
_ => {}
525533
}
526534
}
@@ -590,6 +598,8 @@ impl<'self> fmt::Default for Item<'self> {
590598
clean::EnumItem(ref e) => item_enum(fmt.buf, it.item, e),
591599
clean::TypedefItem(ref t) => item_typedef(fmt.buf, it.item, t),
592600
clean::VariantItem(*) => item_variant(fmt.buf, it.cx, it.item),
601+
clean::StructFieldItem(*) => item_struct_field(fmt.buf, it.cx,
602+
it.item),
593603
_ => {}
594604
}
595605
}
@@ -980,11 +990,12 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
980990
for field in fields.iter() {
981991
match field.inner {
982992
clean::StructFieldItem(ref ty) => {
983-
write!(w, " {}{}: {},\n{}",
993+
write!(w, " {}<a name='field.{name}'>{name}</a>: \
994+
{},\n{}",
984995
VisSpace(field.visibility),
985-
field.name.get_ref().as_slice(),
986996
ty.type_,
987-
tab);
997+
tab,
998+
name = field.name.get_ref().as_slice());
988999
}
9891000
_ => unreachable!()
9901001
}
@@ -1170,3 +1181,12 @@ fn item_variant(w: &mut io::Writer, cx: &Context, it: &clean::Item) {
11701181
*cx.current.last(),
11711182
it.name.get_ref().as_slice());
11721183
}
1184+
1185+
fn item_struct_field(w: &mut io::Writer, cx: &Context, it: &clean::Item) {
1186+
write!(w, "<DOCTYPE html><html><head>\
1187+
<meta http-equiv='refresh' content='0; \
1188+
url=../struct.{}.html\\#field.{}'>\
1189+
</head><body></body></html>",
1190+
*cx.current.last(),
1191+
it.name.get_ref().as_slice());
1192+
}

trunk/src/libstd/libc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,14 +3224,14 @@ pub mod funcs {
32243224
#[nolink]
32253225
#[abi = "cdecl"]
32263226
pub mod glob {
3227-
use libc::types::common::c95::{c_void};
32283227
use libc::types::os::arch::c95::{c_char, c_int};
32293228
use libc::types::os::common::posix01::{glob_t};
3229+
use option::Option;
32303230

32313231
extern {
32323232
pub fn glob(pattern: *c_char,
32333233
flags: c_int,
3234-
errfunc: *c_void, // XXX callback
3234+
errfunc: Option<extern "C" fn(epath: *c_char, errno: int) -> int>,
32353235
pglob: *mut glob_t);
32363236
pub fn globfree(pglob: *mut glob_t);
32373237
}

0 commit comments

Comments
 (0)