Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #62452

Merged
merged 22 commits into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
89feb6d
Clean up unicode.py script
pawroman Apr 18, 2019
a580421
More cleanups for unicode.py
pawroman Apr 18, 2019
edbc27d
Fix tidy errors
pawroman Apr 18, 2019
2c9c978
Refactor and document unicode.py script
pawroman Apr 19, 2019
60ccf89
Apply suggestions from code review
pawroman Jun 10, 2019
49fbd76
Make the Weak::{into,as}_raw methods
vorner Jun 15, 2019
2b47a08
Address review remarks in unicode.py
pawroman Jun 10, 2019
05c1e92
Correct definition of CONSOLE_SCREEN_BUFFER_INFO
tesuji Jul 5, 2019
42c3d37
Remove use of mem::uninitialized in libterm crate
tesuji Jul 5, 2019
7646d49
Remove use of mem::uninitialized in code_gen crate
tesuji Jul 5, 2019
15042a3
`#[rustc_doc_only_macro]` -> `#[rustc_builtin_macro]`
petrochenkov Jun 29, 2019
22d6d8a
`#[rustc_transparent_macro]` -> `#[rustc_macro_transparency = ...]`
petrochenkov Jun 23, 2019
ab112ca
Improve documentation for built-in macros
petrochenkov Jun 29, 2019
987be89
Fix tidy issues
petrochenkov Jun 29, 2019
920a17a
privacy: Only opaque macros leak private things
petrochenkov Jun 29, 2019
3274507
resolve: Reserve cfg/cfg_attr/derive only in attribute sub-namespace
petrochenkov Jun 29, 2019
7a2a17a
normalize use of backticks/lowercase in compiler messages for librust…
Jul 6, 2019
327c54e
Rollup merge of #60081 - pawroman:cleanup_unicode_script, r=varkor
Centril Jul 6, 2019
296e825
Rollup merge of #61862 - vorner:weak-into-raw-methods, r=sfackler
Centril Jul 6, 2019
154726c
Rollup merge of #62243 - petrochenkov:macrodoc, r=eddyb
Centril Jul 6, 2019
30e4a87
Rollup merge of #62422 - lzutao:remove-some-mem-uinit, r=alexcrichton
Centril Jul 6, 2019
7ef02dc
Rollup merge of #62436 - fakenine:normalize_use_of_backticks_compiler…
Centril Jul 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ __pycache__/
/src/libcore/unicode/Scripts.txt
/src/libcore/unicode/SpecialCasing.txt
/src/libcore/unicode/UnicodeData.txt
/src/libcore/unicode/downloaded
/stage[0-9]+/
/target
target/
Expand Down
30 changes: 15 additions & 15 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1291,26 +1291,26 @@ impl<T> Weak<T> {
/// ```
/// #![feature(weak_into_raw)]
///
/// use std::rc::{Rc, Weak};
/// use std::rc::Rc;
/// use std::ptr;
///
/// let strong = Rc::new("hello".to_owned());
/// let weak = Rc::downgrade(&strong);
/// // Both point to the same object
/// assert!(ptr::eq(&*strong, Weak::as_raw(&weak)));
/// assert!(ptr::eq(&*strong, weak.as_raw()));
/// // The strong here keeps it alive, so we can still access the object.
/// assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
/// assert_eq!("hello", unsafe { &*weak.as_raw() });
///
/// drop(strong);
/// // But not any more. We can do Weak::as_raw(&weak), but accessing the pointer would lead to
/// // But not any more. We can do weak.as_raw(), but accessing the pointer would lead to
/// // undefined behaviour.
/// // assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
/// // assert_eq!("hello", unsafe { &*weak.as_raw() });
/// ```
///
/// [`null`]: ../../std/ptr/fn.null.html
#[unstable(feature = "weak_into_raw", issue = "60728")]
pub fn as_raw(this: &Self) -> *const T {
match this.inner() {
pub fn as_raw(&self) -> *const T {
match self.inner() {
None => ptr::null(),
Some(inner) => {
let offset = data_offset_sized::<T>();
Expand Down Expand Up @@ -1341,7 +1341,7 @@ impl<T> Weak<T> {
///
/// let strong = Rc::new("hello".to_owned());
/// let weak = Rc::downgrade(&strong);
/// let raw = Weak::into_raw(weak);
/// let raw = weak.into_raw();
///
/// assert_eq!(1, Rc::weak_count(&strong));
/// assert_eq!("hello", unsafe { &*raw });
Expand All @@ -1353,9 +1353,9 @@ impl<T> Weak<T> {
/// [`from_raw`]: struct.Weak.html#method.from_raw
/// [`as_raw`]: struct.Weak.html#method.as_raw
#[unstable(feature = "weak_into_raw", issue = "60728")]
pub fn into_raw(this: Self) -> *const T {
let result = Self::as_raw(&this);
mem::forget(this);
pub fn into_raw(self) -> *const T {
let result = self.as_raw();
mem::forget(self);
result
}

Expand All @@ -1382,18 +1382,18 @@ impl<T> Weak<T> {
///
/// let strong = Rc::new("hello".to_owned());
///
/// let raw_1 = Weak::into_raw(Rc::downgrade(&strong));
/// let raw_2 = Weak::into_raw(Rc::downgrade(&strong));
/// let raw_1 = Rc::downgrade(&strong).into_raw();
/// let raw_2 = Rc::downgrade(&strong).into_raw();
///
/// assert_eq!(2, Rc::weak_count(&strong));
///
/// assert_eq!("hello", &*Weak::upgrade(&unsafe { Weak::from_raw(raw_1) }).unwrap());
/// assert_eq!("hello", &*unsafe { Weak::from_raw(raw_1) }.upgrade().unwrap());
/// assert_eq!(1, Rc::weak_count(&strong));
///
/// drop(strong);
///
/// // Decrement the last weak count.
/// assert!(Weak::upgrade(&unsafe { Weak::from_raw(raw_2) }).is_none());
/// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none());
/// ```
///
/// [`null`]: ../../std/ptr/fn.null.html
Expand Down
30 changes: 15 additions & 15 deletions src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,26 +1080,26 @@ impl<T> Weak<T> {
/// ```
/// #![feature(weak_into_raw)]
///
/// use std::sync::{Arc, Weak};
/// use std::sync::Arc;
/// use std::ptr;
///
/// let strong = Arc::new("hello".to_owned());
/// let weak = Arc::downgrade(&strong);
/// // Both point to the same object
/// assert!(ptr::eq(&*strong, Weak::as_raw(&weak)));
/// assert!(ptr::eq(&*strong, weak.as_raw()));
/// // The strong here keeps it alive, so we can still access the object.
/// assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
/// assert_eq!("hello", unsafe { &*weak.as_raw() });
///
/// drop(strong);
/// // But not any more. We can do Weak::as_raw(&weak), but accessing the pointer would lead to
/// // But not any more. We can do weak.as_raw(), but accessing the pointer would lead to
/// // undefined behaviour.
/// // assert_eq!("hello", unsafe { &*Weak::as_raw(&weak) });
/// // assert_eq!("hello", unsafe { &*weak.as_raw() });
/// ```
///
/// [`null`]: ../../std/ptr/fn.null.html
#[unstable(feature = "weak_into_raw", issue = "60728")]
pub fn as_raw(this: &Self) -> *const T {
match this.inner() {
pub fn as_raw(&self) -> *const T {
match self.inner() {
None => ptr::null(),
Some(inner) => {
let offset = data_offset_sized::<T>();
Expand Down Expand Up @@ -1130,7 +1130,7 @@ impl<T> Weak<T> {
///
/// let strong = Arc::new("hello".to_owned());
/// let weak = Arc::downgrade(&strong);
/// let raw = Weak::into_raw(weak);
/// let raw = weak.into_raw();
///
/// assert_eq!(1, Arc::weak_count(&strong));
/// assert_eq!("hello", unsafe { &*raw });
Expand All @@ -1142,9 +1142,9 @@ impl<T> Weak<T> {
/// [`from_raw`]: struct.Weak.html#method.from_raw
/// [`as_raw`]: struct.Weak.html#method.as_raw
#[unstable(feature = "weak_into_raw", issue = "60728")]
pub fn into_raw(this: Self) -> *const T {
let result = Self::as_raw(&this);
mem::forget(this);
pub fn into_raw(self) -> *const T {
let result = self.as_raw();
mem::forget(self);
result
}

Expand Down Expand Up @@ -1172,18 +1172,18 @@ impl<T> Weak<T> {
///
/// let strong = Arc::new("hello".to_owned());
///
/// let raw_1 = Weak::into_raw(Arc::downgrade(&strong));
/// let raw_2 = Weak::into_raw(Arc::downgrade(&strong));
/// let raw_1 = Arc::downgrade(&strong).into_raw();
/// let raw_2 = Arc::downgrade(&strong).into_raw();
///
/// assert_eq!(2, Arc::weak_count(&strong));
///
/// assert_eq!("hello", &*Weak::upgrade(&unsafe { Weak::from_raw(raw_1) }).unwrap());
/// assert_eq!("hello", &*unsafe { Weak::from_raw(raw_1) }.upgrade().unwrap());
/// assert_eq!(1, Arc::weak_count(&strong));
///
/// drop(strong);
///
/// // Decrement the last weak count.
/// assert!(Weak::upgrade(&unsafe { Weak::from_raw(raw_2) }).is_none());
/// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none());
/// ```
///
/// [`null`]: ../../std/ptr/fn.null.html
Expand Down
1 change: 1 addition & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#![feature(const_fn)]
#![feature(const_fn_union)]
#![feature(custom_inner_attributes)]
#![feature(decl_macro)]
#![feature(doc_cfg)]
#![feature(doc_spotlight)]
#![feature(extern_types)]
Expand Down
Loading