Skip to content

Commit 570ae39

Browse files
committed
Merge branch 'master' of git://github.com/rust-lang/rust
2 parents e572d85 + 204c0a4 commit 570ae39

Some content is hidden

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

98 files changed

+1379
-1171
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@
3333
[submodule "src/libcompiler_builtins"]
3434
path = src/libcompiler_builtins
3535
url = https://github.com/rust-lang-nursery/compiler-builtins
36+
[submodule "src/tools/clippy"]
37+
path = src/tools/clippy
38+
url = https://github.com/rust-lang-nursery/rust-clippy.git

CONTRIBUTING.md

+26
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,32 @@ Speaking of tests, Rust has a comprehensive test suite. More information about
298298
it can be found
299299
[here](https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md).
300300

301+
### External Dependencies
302+
303+
Currently building Rust will also build the following external projects:
304+
305+
* [clippy](https://github.com/rust-lang-nursery/rust-clippy)
306+
307+
If your changes break one of these projects, you need to fix them by opening
308+
a pull request against the broken project. When you have opened a pull request,
309+
you can point the submodule at your pull request by calling
310+
311+
```
312+
git fetch origin pull/$id_of_your_pr/head:my_pr
313+
git checkout my_pr
314+
```
315+
316+
within the submodule's directory. Don't forget to also add your changes with
317+
318+
```
319+
git add path/to/submodule
320+
```
321+
322+
outside the submodule.
323+
324+
It can also be more convenient during development to set `submodules = false`
325+
in the `config.toml` to prevent `x.py` from resetting to the original branch.
326+
301327
## Writing Documentation
302328

303329
Documentation improvements are very welcome. The source of `doc.rust-lang.org`

RELEASES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version 1.20.0 (2017-08-31)
33

44
Language
55
--------
6-
- [Associated constants in traits is now stabilised.][42809]
6+
- [Associated constants are now stabilised.][42809]
77
- [A lot of macro bugs are now fixed.][42913]
88

99
Compiler
@@ -77,7 +77,7 @@ Stabilized APIs
7777
- [`slice::sort_unstable_by_key`]
7878
- [`slice::sort_unstable_by`]
7979
- [`slice::sort_unstable`]
80-
- [`ste::from_boxed_utf8_unchecked`]
80+
- [`str::from_boxed_utf8_unchecked`]
8181
- [`str::as_bytes_mut`]
8282
- [`str::as_bytes_mut`]
8383
- [`str::from_utf8_mut`]

src/Cargo.lock

+60-67
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ debug-assertions = false
5656
debug = false
5757
debug-assertions = false
5858

59-
[replace]
60-
"https://github.com/rust-lang/cargo#0.22.0" = { path = "tools/cargo" }
59+
[patch.'https://github.com/rust-lang/cargo']
60+
cargo = { path = "tools/cargo" }

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<'a> Builder<'a> {
248248
compile::StartupObjects, tool::BuildManifest, tool::Rustbook, tool::ErrorIndex,
249249
tool::UnstableBookGen, tool::Tidy, tool::Linkchecker, tool::CargoTest,
250250
tool::Compiletest, tool::RemoteTestServer, tool::RemoteTestClient,
251-
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc,
251+
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc, tool::Clippy,
252252
native::Llvm),
253253
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
254254
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Linkcheck,

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use Build;
2424
use config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.21.0";
27+
pub const CFG_RELEASE_NUM: &str = "1.22.0";
2828

2929
// An optional number to put after the label, e.g. '.2' -> '-beta.2'
3030
// Be sure to make this starts with a dot to conform to semver pre-release

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ impl Step for Src {
757757
"src/libprofiler_builtins",
758758
];
759759
let std_src_dirs_exclude = [
760-
"src/compiler-rt/test",
760+
"src/libcompiler_builtins/compiler-rt/test",
761761
"src/jemalloc/test/unit",
762762
];
763763

src/bootstrap/native.rs

+1
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ impl Step for Openssl {
407407
"i686-unknown-freebsd" => "BSD-x86-elf",
408408
"i686-unknown-linux-gnu" => "linux-elf",
409409
"i686-unknown-linux-musl" => "linux-elf",
410+
"i686-unknown-netbsd" => "BSD-x86-elf",
410411
"mips-unknown-linux-gnu" => "linux-mips32",
411412
"mips64-unknown-linux-gnuabi64" => "linux64-mips64",
412413
"mips64el-unknown-linux-gnuabi64" => "linux64-mips64",

src/bootstrap/tool.rs

+38
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,44 @@ impl Step for Cargo {
340340
}
341341
}
342342

343+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
344+
pub struct Clippy {
345+
pub compiler: Compiler,
346+
pub target: Interned<String>,
347+
}
348+
349+
impl Step for Clippy {
350+
type Output = PathBuf;
351+
const DEFAULT: bool = false;
352+
const ONLY_HOSTS: bool = true;
353+
354+
fn should_run(run: ShouldRun) -> ShouldRun {
355+
run.path("src/tools/clippy")
356+
}
357+
358+
fn make_run(run: RunConfig) {
359+
run.builder.ensure(Clippy {
360+
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
361+
target: run.target,
362+
});
363+
}
364+
365+
fn run(self, builder: &Builder) -> PathBuf {
366+
// Clippy depends on procedural macros (serde), which requires a full host
367+
// compiler to be available, so we need to depend on that.
368+
builder.ensure(compile::Rustc {
369+
compiler: self.compiler,
370+
target: builder.build.build,
371+
});
372+
builder.ensure(ToolBuild {
373+
compiler: self.compiler,
374+
target: self.target,
375+
tool: "clippy",
376+
mode: Mode::Librustc,
377+
})
378+
}
379+
}
380+
343381
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
344382
pub struct Rls {
345383
pub compiler: Compiler,

src/bootstrap/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ pub fn symlink_dir(src: &Path, dest: &Path) -> io::Result<()> {
279279
ptr::null_mut());
280280

281281
let mut data = [0u8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
282-
let mut db = data.as_mut_ptr()
282+
let db = data.as_mut_ptr()
283283
as *mut REPARSE_MOUNTPOINT_DATA_BUFFER;
284284
let buf = &mut (*db).ReparseTarget as *mut _;
285285
let mut i = 0;

src/libcore/array.rs

-8
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@ macro_rules! array_impls {
123123
}
124124
}
125125

126-
#[stable(feature = "rust1", since = "1.0.0")]
127-
#[cfg(stage0)]
128-
impl<T:Copy> Clone for [T; $N] {
129-
fn clone(&self) -> [T; $N] {
130-
*self
131-
}
132-
}
133-
134126
#[stable(feature = "rust1", since = "1.0.0")]
135127
impl<T: Hash> Hash for [T; $N] {
136128
fn hash<H: hash::Hasher>(&self, state: &mut H) {

src/libcore/clone.rs

+1-43
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
/// }
8989
/// ```
9090
#[stable(feature = "rust1", since = "1.0.0")]
91-
#[cfg_attr(not(stage0), lang = "clone")]
91+
#[lang = "clone"]
9292
pub trait Clone : Sized {
9393
/// Returns a copy of the value.
9494
///
@@ -130,45 +130,3 @@ pub struct AssertParamIsClone<T: Clone + ?Sized> { _field: ::marker::PhantomData
130130
reason = "deriving hack, should not be public",
131131
issue = "0")]
132132
pub struct AssertParamIsCopy<T: Copy + ?Sized> { _field: ::marker::PhantomData<T> }
133-
134-
#[stable(feature = "rust1", since = "1.0.0")]
135-
#[cfg(stage0)]
136-
impl<'a, T: ?Sized> Clone for &'a T {
137-
/// Returns a shallow copy of the reference.
138-
#[inline]
139-
fn clone(&self) -> &'a T { *self }
140-
}
141-
142-
macro_rules! clone_impl {
143-
($t:ty) => {
144-
#[stable(feature = "rust1", since = "1.0.0")]
145-
#[cfg(stage0)]
146-
impl Clone for $t {
147-
/// Returns a deep copy of the value.
148-
#[inline]
149-
fn clone(&self) -> $t { *self }
150-
}
151-
}
152-
}
153-
154-
clone_impl! { isize }
155-
clone_impl! { i8 }
156-
clone_impl! { i16 }
157-
clone_impl! { i32 }
158-
clone_impl! { i64 }
159-
clone_impl! { i128 }
160-
161-
clone_impl! { usize }
162-
clone_impl! { u8 }
163-
clone_impl! { u16 }
164-
clone_impl! { u32 }
165-
clone_impl! { u64 }
166-
clone_impl! { u128 }
167-
168-
clone_impl! { f32 }
169-
clone_impl! { f64 }
170-
171-
clone_impl! { ! }
172-
clone_impl! { () }
173-
clone_impl! { bool }
174-
clone_impl! { char }

src/libcore/macros.rs

-10
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[macro_export]
12-
// This stability attribute is totally useless.
13-
#[stable(feature = "rust1", since = "1.0.0")]
14-
#[cfg(stage0)]
15-
macro_rules! __rust_unstable_column {
16-
() => {
17-
column!()
18-
}
19-
}
20-
2111
/// Entry point of thread panic, for details, see std::macros
2212
#[macro_export]
2313
#[allow_internal_unstable]

src/libcore/mem.rs

-43
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,6 @@ pub fn forget<T>(t: T) {
188188
/// ```
189189
#[inline]
190190
#[stable(feature = "rust1", since = "1.0.0")]
191-
#[cfg(stage0)]
192-
pub fn size_of<T>() -> usize {
193-
unsafe { intrinsics::size_of::<T>() }
194-
}
195-
196-
/// Returns the size of a type in bytes.
197-
///
198-
/// More specifically, this is the offset in bytes between successive
199-
/// items of the same type, including alignment padding.
200-
///
201-
/// # Examples
202-
///
203-
/// ```
204-
/// use std::mem;
205-
///
206-
/// assert_eq!(4, mem::size_of::<i32>());
207-
/// ```
208-
#[inline]
209-
#[stable(feature = "rust1", since = "1.0.0")]
210-
#[cfg(not(stage0))]
211191
pub const fn size_of<T>() -> usize {
212192
unsafe { intrinsics::size_of::<T>() }
213193
}
@@ -299,29 +279,6 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
299279
/// ```
300280
#[inline]
301281
#[stable(feature = "rust1", since = "1.0.0")]
302-
#[cfg(stage0)]
303-
pub fn align_of<T>() -> usize {
304-
unsafe { intrinsics::min_align_of::<T>() }
305-
}
306-
307-
/// Returns the [ABI]-required minimum alignment of a type.
308-
///
309-
/// Every reference to a value of the type `T` must be a multiple of this number.
310-
///
311-
/// This is the alignment used for struct fields. It may be smaller than the preferred alignment.
312-
///
313-
/// [ABI]: https://en.wikipedia.org/wiki/Application_binary_interface
314-
///
315-
/// # Examples
316-
///
317-
/// ```
318-
/// use std::mem;
319-
///
320-
/// assert_eq!(4, mem::align_of::<i32>());
321-
/// ```
322-
#[inline]
323-
#[stable(feature = "rust1", since = "1.0.0")]
324-
#[cfg(not(stage0))]
325282
pub const fn align_of<T>() -> usize {
326283
unsafe { intrinsics::min_align_of::<T>() }
327284
}

src/libcore/num/f32.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
//! Operations and constants for 32-bits floats (`f32` type)
1212
13-
#![cfg_attr(stage0, allow(overflowing_literals))]
14-
1513
#![stable(feature = "rust1", since = "1.0.0")]
1614

1715
use intrinsics;

src/libcore/ptr.rs

-27
Original file line numberDiff line numberDiff line change
@@ -875,36 +875,9 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
875875
a == b
876876
}
877877

878-
#[stable(feature = "rust1", since = "1.0.0")]
879-
#[cfg(stage0)]
880-
impl<T: ?Sized> Clone for *const T {
881-
#[inline]
882-
fn clone(&self) -> *const T {
883-
*self
884-
}
885-
}
886-
887-
#[stable(feature = "rust1", since = "1.0.0")]
888-
#[cfg(stage0)]
889-
impl<T: ?Sized> Clone for *mut T {
890-
#[inline]
891-
fn clone(&self) -> *mut T {
892-
*self
893-
}
894-
}
895-
896878
// Impls for function pointers
897879
macro_rules! fnptr_impls_safety_abi {
898880
($FnTy: ty, $($Arg: ident),*) => {
899-
#[stable(feature = "rust1", since = "1.0.0")]
900-
#[cfg(stage0)]
901-
impl<Ret, $($Arg),*> Clone for $FnTy {
902-
#[inline]
903-
fn clone(&self) -> Self {
904-
*self
905-
}
906-
}
907-
908881
#[stable(feature = "fnptr_impls", since = "1.4.0")]
909882
impl<Ret, $($Arg),*> PartialEq for $FnTy {
910883
#[inline]

src/libcore/tuple.rs

-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ macro_rules! tuple_impls {
2121
}
2222
)+) => {
2323
$(
24-
#[stable(feature = "rust1", since = "1.0.0")]
25-
#[cfg(stage0)]
26-
impl<$($T:Clone),+> Clone for ($($T,)+) {
27-
fn clone(&self) -> ($($T,)+) {
28-
($(self.$idx.clone(),)+)
29-
}
30-
}
31-
3224
#[stable(feature = "rust1", since = "1.0.0")]
3325
impl<$($T:PartialEq),+> PartialEq for ($($T,)+) where last_type!($($T,)+): ?Sized {
3426
#[inline]

0 commit comments

Comments
 (0)