Skip to content

Commit e152c38

Browse files
committed
Fix merge issues
2 parents 752a1a4 + f693d33 commit e152c38

File tree

424 files changed

+8009
-3980
lines changed

Some content is hidden

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

424 files changed

+8009
-3980
lines changed

Diff for: .azure-pipelines/steps/run.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ steps:
3737
set -e
3838
brew update
3939
brew install xz
40-
brew install swig
40+
brew install swig@3
41+
brew link --force swig@3
4142
displayName: Install build dependencies (OSX)
4243
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['SCRIPT'],'./x.py dist'))
4344

Diff for: .travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ install:
263263
if [[ "$SCRIPT" == "./x.py dist" ]]; then
264264
travis_retry brew update &&
265265
travis_retry brew install xz &&
266-
travis_retry brew install swig;
266+
travis_retry brew install swig@3 &&
267+
brew link --force swig@3;
267268
fi &&
268269
travis_retry curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin &&
269270
chmod +x /usr/local/bin/sccache &&

Diff for: Cargo.lock

+353-202
Large diffs are not rendered by default.

Diff for: src/bootstrap/job.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use std::env;
3333
use std::io;
3434
use std::mem;
35+
use std::ptr;
3536
use crate::Build;
3637

3738
type HANDLE = *mut u8;
@@ -118,8 +119,8 @@ pub unsafe fn setup(build: &mut Build) {
118119
SetErrorMode(mode & !SEM_NOGPFAULTERRORBOX);
119120

120121
// Create a new job object for us to use
121-
let job = CreateJobObjectW(0 as *mut _, 0 as *const _);
122-
assert!(job != 0 as *mut _, "{}", io::Error::last_os_error());
122+
let job = CreateJobObjectW(ptr::null_mut(), ptr::null());
123+
assert!(!job.is_null(), "{}", io::Error::last_os_error());
123124

124125
// Indicate that when all handles to the job object are gone that all
125126
// process in the object should be killed. Note that this includes our
@@ -166,8 +167,8 @@ pub unsafe fn setup(build: &mut Build) {
166167
};
167168

168169
let parent = OpenProcess(PROCESS_DUP_HANDLE, FALSE, pid.parse().unwrap());
169-
assert!(parent != 0 as *mut _, "{}", io::Error::last_os_error());
170-
let mut parent_handle = 0 as *mut _;
170+
assert!(!parent.is_null(), "{}", io::Error::last_os_error());
171+
let mut parent_handle = ptr::null_mut();
171172
let r = DuplicateHandle(GetCurrentProcess(), job,
172173
parent, &mut parent_handle,
173174
0, FALSE, DUPLICATE_SAME_ACCESS);

Diff for: src/bootstrap/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> {
209209
let h = CreateFileW(path.as_ptr(),
210210
GENERIC_WRITE,
211211
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
212-
0 as *mut _,
212+
ptr::null_mut(),
213213
OPEN_EXISTING,
214214
FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS,
215215
ptr::null_mut());

Diff for: src/ci/cpu-usage-over-time.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,8 @@
3030
# the second column is always zero.
3131
#
3232
# Once you've downloaded a file there's various ways to plot it and visualize
33-
# it. For command line usage you can use a script like so:
34-
#
35-
# set timefmt '%Y-%m-%dT%H:%M:%S'
36-
# set xdata time
37-
# set ylabel "Idle CPU %"
38-
# set xlabel "Time"
39-
# set datafile sep ','
40-
# set term png
41-
# set output "printme.png"
42-
# set grid
43-
# builder = "i686-apple"
44-
# plot "cpu-".builder.".csv" using 1:2 with lines title builder
45-
#
46-
# Executed as `gnuplot < ./foo.plot` it will generate a graph called
47-
# `printme.png` which you can then open up. If you know how to improve this
48-
# script or the viewing process that would be much appreciated :) (or even if
49-
# you know how to automate it!)
33+
# it. For command line usage you use the `src/etc/cpu-usage-over-time-plot.sh`
34+
# script in this repository.
5035

5136
import datetime
5237
import sys

Diff for: src/doc/unstable-book/src/language-features/plugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The advantages over a simple `fn(&str) -> u32` are:
132132
In addition to procedural macros, you can define new
133133
[`derive`](../../reference/attributes/derive.md)-like attributes and other kinds
134134
of extensions. See `Registry::register_syntax_extension` and the
135-
`SyntaxExtension` enum. For a more involved macro example, see
135+
`SyntaxExtension` struct. For a more involved macro example, see
136136
[`regex_macros`](https://github.com/rust-lang/regex/blob/master/regex_macros/src/lib.rs).
137137

138138

Diff for: src/etc/cpu-usage-over-time-plot.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
# A small script to help visualizing CPU usage over time data collected on CI
4+
# using `gnuplot`.
5+
#
6+
# This script is expected to be called with two arguments. The first is the full
7+
# commit SHA of the build you're interested in, and the second is the name of
8+
# the builder. For example:
9+
#
10+
# ./src/etc/cpu-usage-over-time-plot.sh e699ea096fcc2fc9ce8e8bcf884e11496a31cc9f i686-mingw-1
11+
#
12+
# That will generate `$builder.png` in the current directory which you can open
13+
# up to see a hopefully pretty graph.
14+
#
15+
# Improvements to this script are greatly appreciated!
16+
17+
set -ex
18+
19+
bucket=rust-lang-ci-evalazure
20+
commit=$1
21+
builder=$2
22+
23+
curl -O https://$bucket.s3.amazonaws.com/rustc-builds/$commit/cpu-$builder.csv
24+
25+
gnuplot <<-EOF
26+
reset
27+
set timefmt '%Y-%m-%dT%H:%M:%S'
28+
set xdata time
29+
set ylabel "CPU Usage %"
30+
set xlabel "Time"
31+
set datafile sep ','
32+
set term png size 3000,1000
33+
set output "$builder.png"
34+
set grid
35+
36+
f(x) = mean_y
37+
fit f(x) 'cpu-$builder.csv' using 1:(100-\$2) via mean_y
38+
39+
set label 1 gprintf("Average = %g%%", mean_y) center font ",18"
40+
set label 1 at graph 0.50, 0.25
41+
set xtics rotate by 45 offset -2,-2.4 300
42+
set ytics 10
43+
set boxwidth 0.5
44+
45+
plot \\
46+
mean_y with lines linetype 1 linecolor rgb "#ff0000" title "average", \\
47+
"cpu-$builder.csv" using 1:(100-\$2) with points pointtype 7 pointsize 0.4 title "$builder", \\
48+
"" using 1:(100-\$2) smooth bezier linewidth 3 title "bezier"
49+
EOF

Diff for: src/etc/rust-lldb

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ category_definition="type summary add --no-value --python-function lldb_rust_for
3131
category_enable="type category enable Rust"
3232

3333
# Call LLDB with the commands added to the argument list
34-
exec "$lldb" --one-line-before-file="$script_import" \
35-
--one-line-before-file="$category_definition" \
36-
--one-line-before-file="$category_enable" \
34+
exec "$lldb" --one-line-before-file "$script_import" \
35+
--one-line-before-file "$category_definition" \
36+
--one-line-before-file "$category_enable" \
3737
"$@"

Diff for: src/liballoc/rc.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1515,18 +1515,18 @@ impl<T: ?Sized> Weak<T> {
15151515
///
15161516
/// ```
15171517
/// #![feature(weak_ptr_eq)]
1518-
/// use std::rc::{Rc, Weak};
1518+
/// use std::rc::Rc;
15191519
///
15201520
/// let first_rc = Rc::new(5);
15211521
/// let first = Rc::downgrade(&first_rc);
15221522
/// let second = Rc::downgrade(&first_rc);
15231523
///
1524-
/// assert!(Weak::ptr_eq(&first, &second));
1524+
/// assert!(first.ptr_eq(&second));
15251525
///
15261526
/// let third_rc = Rc::new(5);
15271527
/// let third = Rc::downgrade(&third_rc);
15281528
///
1529-
/// assert!(!Weak::ptr_eq(&first, &third));
1529+
/// assert!(!first.ptr_eq(&third));
15301530
/// ```
15311531
///
15321532
/// Comparing `Weak::new`.
@@ -1537,16 +1537,16 @@ impl<T: ?Sized> Weak<T> {
15371537
///
15381538
/// let first = Weak::new();
15391539
/// let second = Weak::new();
1540-
/// assert!(Weak::ptr_eq(&first, &second));
1540+
/// assert!(first.ptr_eq(&second));
15411541
///
15421542
/// let third_rc = Rc::new(());
15431543
/// let third = Rc::downgrade(&third_rc);
1544-
/// assert!(!Weak::ptr_eq(&first, &third));
1544+
/// assert!(!first.ptr_eq(&third));
15451545
/// ```
15461546
#[inline]
15471547
#[unstable(feature = "weak_ptr_eq", issue = "55981")]
1548-
pub fn ptr_eq(this: &Self, other: &Self) -> bool {
1549-
this.ptr.as_ptr() == other.ptr.as_ptr()
1548+
pub fn ptr_eq(&self, other: &Self) -> bool {
1549+
self.ptr.as_ptr() == other.ptr.as_ptr()
15501550
}
15511551
}
15521552

Diff for: src/liballoc/sync.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1349,18 +1349,18 @@ impl<T: ?Sized> Weak<T> {
13491349
///
13501350
/// ```
13511351
/// #![feature(weak_ptr_eq)]
1352-
/// use std::sync::{Arc, Weak};
1352+
/// use std::sync::Arc;
13531353
///
13541354
/// let first_rc = Arc::new(5);
13551355
/// let first = Arc::downgrade(&first_rc);
13561356
/// let second = Arc::downgrade(&first_rc);
13571357
///
1358-
/// assert!(Weak::ptr_eq(&first, &second));
1358+
/// assert!(first.ptr_eq(&second));
13591359
///
13601360
/// let third_rc = Arc::new(5);
13611361
/// let third = Arc::downgrade(&third_rc);
13621362
///
1363-
/// assert!(!Weak::ptr_eq(&first, &third));
1363+
/// assert!(!first.ptr_eq(&third));
13641364
/// ```
13651365
///
13661366
/// Comparing `Weak::new`.
@@ -1371,16 +1371,16 @@ impl<T: ?Sized> Weak<T> {
13711371
///
13721372
/// let first = Weak::new();
13731373
/// let second = Weak::new();
1374-
/// assert!(Weak::ptr_eq(&first, &second));
1374+
/// assert!(first.ptr_eq(&second));
13751375
///
13761376
/// let third_rc = Arc::new(());
13771377
/// let third = Arc::downgrade(&third_rc);
1378-
/// assert!(!Weak::ptr_eq(&first, &third));
1378+
/// assert!(!first.ptr_eq(&third));
13791379
/// ```
13801380
#[inline]
13811381
#[unstable(feature = "weak_ptr_eq", issue = "55981")]
1382-
pub fn ptr_eq(this: &Self, other: &Self) -> bool {
1383-
this.ptr.as_ptr() == other.ptr.as_ptr()
1382+
pub fn ptr_eq(&self, other: &Self) -> bool {
1383+
self.ptr.as_ptr() == other.ptr.as_ptr()
13841384
}
13851385
}
13861386

Diff for: src/libarena/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ impl<T> Default for TypedArena<T> {
114114
TypedArena {
115115
// We set both `ptr` and `end` to 0 so that the first call to
116116
// alloc() will trigger a grow().
117-
ptr: Cell::new(0 as *mut T),
118-
end: Cell::new(0 as *mut T),
117+
ptr: Cell::new(ptr::null_mut()),
118+
end: Cell::new(ptr::null_mut()),
119119
chunks: RefCell::new(vec![]),
120120
_own: PhantomData,
121121
}
@@ -370,8 +370,8 @@ impl Default for DroplessArena {
370370
#[inline]
371371
fn default() -> DroplessArena {
372372
DroplessArena {
373-
ptr: Cell::new(0 as *mut u8),
374-
end: Cell::new(0 as *mut u8),
373+
ptr: Cell::new(ptr::null_mut()),
374+
end: Cell::new(ptr::null_mut()),
375375
chunks: Default::default(),
376376
}
377377
}

Diff for: src/libcore/convert.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ pub trait AsMut<T: ?Sized> {
202202
/// A value-to-value conversion that consumes the input value. The
203203
/// opposite of [`From`].
204204
///
205-
/// One should only implement `Into` if a conversion to a type outside the current crate is
206-
/// required. Otherwise one should always prefer implementing [`From`] over `Into` because
207-
/// implementing [`From`] automatically provides one with a implementation of `Into` thanks to
205+
/// One should only implement [`Into`] if a conversion to a type outside the current crate is
206+
/// required. Otherwise one should always prefer implementing [`From`] over [`Into`] because
207+
/// implementing [`From`] automatically provides one with a implementation of [`Into`] thanks to
208208
/// the blanket implementation in the standard library. [`From`] cannot do these type of
209209
/// conversions because of Rust's orphaning rules.
210210
///
@@ -213,9 +213,9 @@ pub trait AsMut<T: ?Sized> {
213213
/// # Generic Implementations
214214
///
215215
/// - [`From`]`<T> for U` implies `Into<U> for T`
216-
/// - `Into` is reflexive, which means that `Into<T> for T` is implemented
216+
/// - [`Into`] is reflexive, which means that `Into<T> for T` is implemented
217217
///
218-
/// # Implementing `Into` for conversions to external types
218+
/// # Implementing [`Into`] for conversions to external types
219219
///
220220
/// If the destination type is not part of the current crate
221221
/// then you can't implement [`From`] directly.
@@ -231,7 +231,7 @@ pub trait AsMut<T: ?Sized> {
231231
/// ```
232232
/// This will fail to compile because we cannot implement a trait for a type
233233
/// if both the trait and the type are not defined by the current crate.
234-
/// This is due to Rust's orphaning rules. To bypass this, you can implement `Into` directly:
234+
/// This is due to Rust's orphaning rules. To bypass this, you can implement [`Into`] directly:
235235
///
236236
/// ```
237237
/// struct Wrapper<T>(Vec<T>);
@@ -242,19 +242,19 @@ pub trait AsMut<T: ?Sized> {
242242
/// }
243243
/// ```
244244
///
245-
/// It is important to understand that `Into` does not provide a [`From`] implementation
246-
/// (as [`From`] does with `Into`). Therefore, you should always try to implement [`From`]
247-
/// and then fall back to `Into` if [`From`] can't be implemented.
245+
/// It is important to understand that [`Into`] does not provide a [`From`] implementation
246+
/// (as [`From`] does with [`Into`]). Therefore, you should always try to implement [`From`]
247+
/// and then fall back to [`Into`] if [`From`] can't be implemented.
248248
///
249-
/// Prefer using `Into` over [`From`] when specifying trait bounds on a generic function
250-
/// to ensure that types that only implement `Into` can be used as well.
249+
/// Prefer using [`Into`] over [`From`] when specifying trait bounds on a generic function
250+
/// to ensure that types that only implement [`Into`] can be used as well.
251251
///
252252
/// # Examples
253253
///
254254
/// [`String`] implements `Into<Vec<u8>>`:
255255
///
256256
/// In order to express that we want a generic function to take all arguments that can be
257-
/// converted to a specified type `T`, we can use a trait bound of `Into<T>`.
257+
/// converted to a specified type `T`, we can use a trait bound of [`Into`]`<T>`.
258258
/// For example: The function `is_hello` takes all arguments that can be converted into a
259259
/// `Vec<u8>`.
260260
///
@@ -273,7 +273,7 @@ pub trait AsMut<T: ?Sized> {
273273
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
274274
/// [`String`]: ../../std/string/struct.String.html
275275
/// [`From`]: trait.From.html
276-
/// [`into`]: trait.Into.html#tymethod.into
276+
/// [`Into`]: trait.Into.html
277277
#[stable(feature = "rust1", since = "1.0.0")]
278278
pub trait Into<T>: Sized {
279279
/// Performs the conversion.

0 commit comments

Comments
 (0)