Skip to content

Commit 95fd2db

Browse files
committed
---
yaml --- r: 276607 b: refs/heads/try c: deee0f7 h: refs/heads/master i: 276605: 490639d 276603: cbc32cc 276599: 4d127cd 276591: 3daf229 276575: f7879de 276543: c656d3e 276479: 1837f60
1 parent e7f5abf commit 95fd2db

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
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: 1e67d8a57099eb9d286b5a4adfa798c1b3d437b9
4+
refs/heads/try: deee0f73da885a71ebf9c8d29213c663dba467b9
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/ty/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
12021202
}
12031203
}
12041204

1205+
/// Construct a parameter environment given an item, impl item, or trait item
12051206
pub fn for_item(cx: &'a TyCtxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 'tcx> {
12061207
match cx.map.find(id) {
12071208
Some(ast_map::NodeImplItem(ref impl_item)) => {
@@ -1341,7 +1342,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
13411342
}
13421343
_ => {
13431344
cx.sess.span_bug(item.span,
1344-
"ParameterEnvironment::from_item():
1345+
"ParameterEnvironment::for_item():
13451346
can't create a parameter \
13461347
environment for this kind of item")
13471348
}
@@ -1352,7 +1353,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
13521353
ParameterEnvironment::for_item(cx, cx.map.get_parent(id))
13531354
}
13541355
_ => {
1355-
cx.sess.bug(&format!("ParameterEnvironment::from_item(): \
1356+
cx.sess.bug(&format!("ParameterEnvironment::for_item(): \
13561357
`{}` is not an item",
13571358
cx.map.node_to_string(id)))
13581359
}

branches/try/src/libstd/sys/windows/net.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,28 @@ fn last_error() -> io::Error {
6161
}
6262

6363
/// Checks if the signed integer is the Windows constant `SOCKET_ERROR` (-1)
64-
/// and if so, returns the last error from the Windows socket interface. . This
64+
/// and if so, returns the last error from the Windows socket interface. This
6565
/// function must be called before another call to the socket API is made.
66-
pub fn cvt<T: One + Neg<Output=T> + PartialEq>(t: T) -> io::Result<T> {
67-
let one: T = T::one();
68-
if t == -one {
66+
pub fn cvt<T: One + PartialEq + Neg<Output=T>>(t: T) -> io::Result<T> {
67+
if t == -T::one() {
6968
Err(last_error())
7069
} else {
7170
Ok(t)
7271
}
7372
}
7473

75-
/// Provides the functionality of `cvt` for the return values of `getaddrinfo`
76-
/// and similar, meaning that they return an error if the return value is 0.
74+
/// A variant of `cvt` for `getaddrinfo` which return 0 for a success.
7775
pub fn cvt_gai(err: c_int) -> io::Result<()> {
78-
if err == 0 { return Ok(()) }
79-
cvt(err).map(|_| ())
76+
if err == 0 {
77+
Ok(())
78+
} else {
79+
Err(last_error())
80+
}
8081
}
8182

82-
/// Provides the functionality of `cvt` for a closure.
83+
/// Just to provide the same interface as sys/unix/net.rs
8384
pub fn cvt_r<T, F>(mut f: F) -> io::Result<T>
84-
where F: FnMut() -> T, T: One + Neg<Output=T> + PartialEq
85+
where T: One + PartialEq + Neg<Output=T>, F: FnMut() -> T
8586
{
8687
cvt(f())
8788
}

0 commit comments

Comments
 (0)