Skip to content

Commit 85355ae

Browse files
committed
---
yaml --- r: 235859 b: refs/heads/stable c: 11c2218 h: refs/heads/master i: 235857: d8d88f6 235855: 3249f6f v: v3
1 parent 877a504 commit 85355ae

File tree

5 files changed

+34
-49
lines changed

5 files changed

+34
-49
lines changed

[refs]

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

branches/stable/src/librustc_typeck/check/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ fn check_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
24902490
// The special-cased logic below has three functions:
24912491
// 1. Provide as good of an expected type as possible.
24922492
let expected = expected_arg_tys.get(i).map(|&ty| {
2493-
Expectation::rvalue_hint(fcx.tcx(), ty)
2493+
Expectation::rvalue_hint(ty)
24942494
});
24952495

24962496
check_expr_with_unifier(fcx, &**arg,
@@ -3268,7 +3268,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
32683268
match unop {
32693269
ast::UnUniq => match ty.sty {
32703270
ty::TyBox(ty) => {
3271-
Expectation::rvalue_hint(tcx, ty)
3271+
Expectation::rvalue_hint(ty)
32723272
}
32733273
_ => {
32743274
NoExpectation
@@ -3345,7 +3345,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
33453345
// the last field of a struct can be unsized.
33463346
ExpectHasType(mt.ty)
33473347
} else {
3348-
Expectation::rvalue_hint(tcx, mt.ty)
3348+
Expectation::rvalue_hint(mt.ty)
33493349
}
33503350
}
33513351
_ => NoExpectation
@@ -3982,8 +3982,8 @@ impl<'tcx> Expectation<'tcx> {
39823982
/// which still is useful, because it informs integer literals and the like.
39833983
/// See the test case `test/run-pass/coerce-expect-unsized.rs` and #20169
39843984
/// for examples of where this comes up,.
3985-
fn rvalue_hint(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> Expectation<'tcx> {
3986-
match tcx.struct_tail(ty).sty {
3985+
fn rvalue_hint(ty: Ty<'tcx>) -> Expectation<'tcx> {
3986+
match ty.sty {
39873987
ty::TySlice(_) | ty::TyTrait(..) => {
39883988
ExpectRvalueLikeUnsized(ty)
39893989
}

branches/stable/src/libstd/rand/os.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ mod imp {
185185
use io;
186186
use mem;
187187
use rand::Rng;
188-
use libc::{c_int, c_void, size_t};
188+
use libc::{c_int, size_t};
189189

190190
/// A random number generator that retrieves randomness straight from
191191
/// the operating system. Platform sources:
@@ -203,9 +203,8 @@ mod imp {
203203
_dummy: (),
204204
}
205205

206-
// Fake definition; this is actually a struct, but we don't use the
207-
// contents here.
208-
type SecRandom = c_void;
206+
#[repr(C)]
207+
struct SecRandom;
209208

210209
#[allow(non_upper_case_globals)]
211210
const kSecRandomDefault: *const SecRandom = 0 as *const SecRandom;

branches/stable/src/libstd/thread/mod.rs

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,6 @@
8585
//! value produced by the child thread, or `Err` of the value given to
8686
//! a call to `panic!` if the child panicked.
8787
//!
88-
//! ## Scoped threads
89-
//!
90-
//! The `spawn` method does not allow the child and parent threads to
91-
//! share any stack data, since that is not safe in general. However,
92-
//! `scoped` makes it possible to share the parent's stack by forcing
93-
//! a join before any relevant stack frames are popped:
94-
//!
95-
//! ```rust
96-
//! # #![feature(scoped)]
97-
//! use std::thread;
98-
//!
99-
//! let guard = thread::scoped(move || {
100-
//! // some work here
101-
//! });
102-
//!
103-
//! // do some other work in the meantime
104-
//! let output = guard.join();
105-
//! ```
106-
//!
107-
//! The `scoped` function doesn't return a `Thread` directly; instead,
108-
//! it returns a *join guard*. The join guard is an RAII-style guard
109-
//! that will automatically join the child thread (block until it
110-
//! terminates) when it is dropped. You can join the child thread in
111-
//! advance by calling the `join` method on the guard, which will also
112-
//! return the result produced by the thread. A handle to the thread
113-
//! itself is available via the `thread` method of the join guard.
114-
//!
11588
//! ## Configuring threads
11689
//!
11790
//! A new thread can be configured before it is spawned via the `Builder` type,
@@ -288,7 +261,7 @@ impl Builder {
288261
/// upon being dropped. Because the child thread may refer to data on the
289262
/// current thread's stack (hence the "scoped" name), it cannot be detached;
290263
/// it *must* be joined before the relevant stack frame is popped. See the
291-
/// module documentation for additional details.
264+
/// documentation on `thread::scoped` for additional details.
292265
///
293266
/// # Errors
294267
///
@@ -388,12 +361,30 @@ pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
388361

389362
/// Spawns a new *scoped* thread, returning a `JoinGuard` for it.
390363
///
391-
/// The join guard can be used to explicitly join the child thread (via
392-
/// `join`), returning `Result<T>`, or it will implicitly join the child
393-
/// upon being dropped. Because the child thread may refer to data on the
394-
/// current thread's stack (hence the "scoped" name), it cannot be detached;
395-
/// it *must* be joined before the relevant stack frame is popped. See the
396-
/// module documentation for additional details.
364+
/// The `spawn` method does not allow the child and parent threads to
365+
/// share any stack data, since that is not safe in general. However,
366+
/// `scoped` makes it possible to share the parent's stack by forcing
367+
/// a join before any relevant stack frames are popped:
368+
///
369+
/// ```rust
370+
/// # #![feature(scoped)]
371+
/// use std::thread;
372+
///
373+
/// let guard = thread::scoped(move || {
374+
/// // some work here
375+
/// });
376+
///
377+
/// // do some other work in the meantime
378+
/// let output = guard.join();
379+
/// ```
380+
///
381+
/// The `scoped` function doesn't return a `Thread` directly; instead, it
382+
/// returns a *join guard*. The join guard can be used to explicitly join
383+
/// the child thread (via `join`), returning `Result<T>`, or it will
384+
/// implicitly join the child upon being dropped. Because the child thread
385+
/// may refer to data on the current thread's stack (hence the "scoped"
386+
/// name), it cannot be detached; it *must* be joined before the relevant
387+
/// stack frame is popped.
397388
///
398389
/// # Panics
399390
///

branches/stable/src/test/run-pass/coerce-expect-unsized.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
#![allow(unknown_features)]
1414
#![feature(box_syntax)]
1515

16-
use std::cell::RefCell;
1716
use std::fmt::Debug;
18-
use std::rc::Rc;
1917

2018
// Check that coercions apply at the pointer level and don't cause
2119
// rvalue expressions to be unsized. See #20169 for more information.
@@ -47,9 +45,6 @@ pub fn main() {
4745
let _: Box<[isize]> = Box::new([1, 2, 3]);
4846
let _: Box<Fn(isize) -> _> = Box::new(|x| (x as u8));
4947

50-
let _: Rc<RefCell<[isize]>> = Rc::new(RefCell::new([1, 2, 3]));
51-
let _: Rc<RefCell<FnMut(isize) -> _>> = Rc::new(RefCell::new(|x| (x as u8)));
52-
5348
let _: Vec<Box<Fn(isize) -> _>> = vec![
5449
Box::new(|x| (x as u8)),
5550
Box::new(|x| (x as i16 as u8)),

0 commit comments

Comments
 (0)