Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8d0ebb2

Browse files
committedOct 1, 2019
Auto merge of #64958 - Centril:rollup-8k5m97o, r=Centril
Rollup of 5 pull requests Successful merges: - #63416 (apfloat: improve doc comments) - #64404 (Add long error explanation for E0495) - #64910 (syntax: cleanup param, method, and misc parsing) - #64912 (Remove unneeded `fn main` blocks from docs) - #64952 (Update cargo.) Failed merges: r? @ghost
2 parents 702b45e + 98344d7 commit 8d0ebb2

File tree

70 files changed

+865
-960
lines changed

Some content is hidden

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

70 files changed

+865
-960
lines changed
 

‎Cargo.lock

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ dependencies = [
265265

266266
[[package]]
267267
name = "cargo"
268-
version = "0.40.0"
268+
version = "0.41.0"
269269
dependencies = [
270270
"atty",
271271
"bytesize",
@@ -600,7 +600,7 @@ checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
600600

601601
[[package]]
602602
name = "crates-io"
603-
version = "0.28.0"
603+
version = "0.29.0"
604604
dependencies = [
605605
"curl",
606606
"failure",
@@ -730,25 +730,24 @@ dependencies = [
730730

731731
[[package]]
732732
name = "curl"
733-
version = "0.4.21"
733+
version = "0.4.24"
734734
source = "registry+https://github.com/rust-lang/crates.io-index"
735-
checksum = "a85f2f95f2bd277d316d1aa8a477687ab4a6942258c7db7c89c187534669979c"
735+
checksum = "d08ad3cb89d076a36b0ce5749eec2c9964f70c0c58480ab6b75a91ec4fc206d8"
736736
dependencies = [
737737
"curl-sys",
738-
"kernel32-sys",
739738
"libc",
740739
"openssl-probe",
741740
"openssl-sys",
742741
"schannel",
743742
"socket2",
744-
"winapi 0.2.8",
743+
"winapi 0.3.6",
745744
]
746745

747746
[[package]]
748747
name = "curl-sys"
749-
version = "0.4.18"
748+
version = "0.4.21"
750749
source = "registry+https://github.com/rust-lang/crates.io-index"
751-
checksum = "9d91a0052d5b982887d8e829bee0faffc7218ea3c6ebd3d6c2c8f678a93c9a42"
750+
checksum = "520594da9914c1dc77ce3be450fc1c74fde67c82966d80f8e93c6d460eb0e9ae"
752751
dependencies = [
753752
"cc",
754753
"libc",

‎src/liballoc/boxed.rs

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
//! Nil,
3030
//! }
3131
//!
32-
//! fn main() {
33-
//! let list: List<i32> = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Nil))));
34-
//! println!("{:?}", list);
35-
//! }
32+
//! let list: List<i32> = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Nil))));
33+
//! println!("{:?}", list);
3634
//! ```
3735
//!
3836
//! This will print `Cons(1, Cons(2, Nil))`.
@@ -375,14 +373,12 @@ impl<T: ?Sized> Box<T> {
375373
/// ```
376374
/// #![feature(box_into_raw_non_null)]
377375
///
378-
/// fn main() {
379-
/// let x = Box::new(5);
380-
/// let ptr = Box::into_raw_non_null(x);
376+
/// let x = Box::new(5);
377+
/// let ptr = Box::into_raw_non_null(x);
381378
///
382-
/// // Clean up the memory by converting the NonNull pointer back
383-
/// // into a Box and letting the Box be dropped.
384-
/// let x = unsafe { Box::from_raw(ptr.as_ptr()) };
385-
/// }
379+
/// // Clean up the memory by converting the NonNull pointer back
380+
/// // into a Box and letting the Box be dropped.
381+
/// let x = unsafe { Box::from_raw(ptr.as_ptr()) };
386382
/// ```
387383
#[unstable(feature = "box_into_raw_non_null", issue = "47336")]
388384
#[inline]
@@ -428,23 +424,19 @@ impl<T: ?Sized> Box<T> {
428424
/// Simple usage:
429425
///
430426
/// ```
431-
/// fn main() {
432-
/// let x = Box::new(41);
433-
/// let static_ref: &'static mut usize = Box::leak(x);
434-
/// *static_ref += 1;
435-
/// assert_eq!(*static_ref, 42);
436-
/// }
427+
/// let x = Box::new(41);
428+
/// let static_ref: &'static mut usize = Box::leak(x);
429+
/// *static_ref += 1;
430+
/// assert_eq!(*static_ref, 42);
437431
/// ```
438432
///
439433
/// Unsized data:
440434
///
441435
/// ```
442-
/// fn main() {
443-
/// let x = vec![1, 2, 3].into_boxed_slice();
444-
/// let static_ref = Box::leak(x);
445-
/// static_ref[0] = 4;
446-
/// assert_eq!(*static_ref, [4, 2, 3]);
447-
/// }
436+
/// let x = vec![1, 2, 3].into_boxed_slice();
437+
/// let static_ref = Box::leak(x);
438+
/// static_ref[0] = 4;
439+
/// assert_eq!(*static_ref, [4, 2, 3]);
448440
/// ```
449441
#[stable(feature = "box_leak", since = "1.26.0")]
450442
#[inline]
@@ -780,11 +772,9 @@ impl Box<dyn Any> {
780772
/// }
781773
/// }
782774
///
783-
/// fn main() {
784-
/// let my_string = "Hello World".to_string();
785-
/// print_if_string(Box::new(my_string));
786-
/// print_if_string(Box::new(0i8));
787-
/// }
775+
/// let my_string = "Hello World".to_string();
776+
/// print_if_string(Box::new(my_string));
777+
/// print_if_string(Box::new(0i8));
788778
/// ```
789779
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<dyn Any>> {
790780
if self.is::<T>() {
@@ -814,11 +804,9 @@ impl Box<dyn Any + Send> {
814804
/// }
815805
/// }
816806
///
817-
/// fn main() {
818-
/// let my_string = "Hello World".to_string();
819-
/// print_if_string(Box::new(my_string));
820-
/// print_if_string(Box::new(0i8));
821-
/// }
807+
/// let my_string = "Hello World".to_string();
808+
/// print_if_string(Box::new(my_string));
809+
/// print_if_string(Box::new(0i8));
822810
/// ```
823811
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<dyn Any + Send>> {
824812
<Box<dyn Any>>::downcast(self).map_err(|s| unsafe {

0 commit comments

Comments
 (0)
Please sign in to comment.