Skip to content

Commit a783fe2

Browse files
committed
Auto merge of #43246 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests - Successful merges: #43074, #43145, #43159, #43202, #43222, #43228, #43229, #43240 - Failed merges:
2 parents c4373bd + e3825ec commit a783fe2

File tree

12 files changed

+89
-21
lines changed

12 files changed

+89
-21
lines changed

src/bootstrap/step.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
2929
use std::collections::{BTreeMap, HashSet, HashMap};
3030
use std::mem;
31+
use std::path::PathBuf;
3132
use std::process;
3233

3334
use check::{self, TestKind};
@@ -1209,11 +1210,19 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
12091210
if paths.len() == 0 && rule.default {
12101211
Some((rule, 0))
12111212
} else {
1212-
paths.iter().position(|path| path.ends_with(rule.path))
1213+
paths.iter()
1214+
.position(|path| path.ends_with(rule.path))
12131215
.map(|priority| (rule, priority))
12141216
}
12151217
}).collect();
12161218

1219+
if rules.is_empty() &&
1220+
!paths.get(0).unwrap_or(&PathBuf::new())
1221+
.ends_with("nonexistent/path/to/trigger/cargo/metadata") {
1222+
println!("\nNothing to run...\n");
1223+
process::exit(1);
1224+
}
1225+
12171226
rules.sort_by_key(|&(_, priority)| priority);
12181227

12191228
rules.into_iter().flat_map(|(rule, _)| {

src/doc/book

Submodule book updated 33 files

src/doc/nomicon

src/doc/reference

src/libcore/iter/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,19 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator {
359359
#[inline]
360360
fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }
361361

362+
#[inline]
362363
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
363364
where P: FnMut(&Self::Item) -> bool
364365
{
365366
self.iter.rfind(predicate)
366367
}
368+
369+
#[inline]
370+
fn rposition<P>(&mut self, predicate: P) -> Option<usize> where
371+
P: FnMut(Self::Item) -> bool
372+
{
373+
self.iter.position(predicate)
374+
}
367375
}
368376

369377
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/ptr.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
160160
// #[repr(simd)], even if we don't actually use this struct directly.
161161
//
162162
// FIXME repr(simd) broken on emscripten and redox
163-
#[cfg_attr(not(any(target_os = "emscripten", target_os = "redox")), repr(simd))]
163+
// It's also broken on big-endian powerpc64 and s390x. #42778
164+
#[cfg_attr(not(any(target_os = "emscripten", target_os = "redox",
165+
target_endian = "big")),
166+
repr(simd))]
164167
struct Block(u64, u64, u64, u64);
165168
struct UnalignedBlock(u64, u64, u64, u64);
166169

src/libcore/str/mod.rs

+38
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,37 @@ impl<'a> Iterator for Bytes<'a> {
710710
fn nth(&mut self, n: usize) -> Option<Self::Item> {
711711
self.0.nth(n)
712712
}
713+
714+
#[inline]
715+
fn all<F>(&mut self, f: F) -> bool where F: FnMut(Self::Item) -> bool {
716+
self.0.all(f)
717+
}
718+
719+
#[inline]
720+
fn any<F>(&mut self, f: F) -> bool where F: FnMut(Self::Item) -> bool {
721+
self.0.any(f)
722+
}
723+
724+
#[inline]
725+
fn find<P>(&mut self, predicate: P) -> Option<Self::Item> where
726+
P: FnMut(&Self::Item) -> bool
727+
{
728+
self.0.find(predicate)
729+
}
730+
731+
#[inline]
732+
fn position<P>(&mut self, predicate: P) -> Option<usize> where
733+
P: FnMut(Self::Item) -> bool
734+
{
735+
self.0.position(predicate)
736+
}
737+
738+
#[inline]
739+
fn rposition<P>(&mut self, predicate: P) -> Option<usize> where
740+
P: FnMut(Self::Item) -> bool
741+
{
742+
self.0.rposition(predicate)
743+
}
713744
}
714745

715746
#[stable(feature = "rust1", since = "1.0.0")]
@@ -718,6 +749,13 @@ impl<'a> DoubleEndedIterator for Bytes<'a> {
718749
fn next_back(&mut self) -> Option<u8> {
719750
self.0.next_back()
720751
}
752+
753+
#[inline]
754+
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item> where
755+
P: FnMut(&Self::Item) -> bool
756+
{
757+
self.0.rfind(predicate)
758+
}
721759
}
722760

723761
#[stable(feature = "rust1", since = "1.0.0")]

src/libstd/path.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ use sys::path::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix};
135135
/// get_path_prefix(r"\\?\pictures\kittens"));
136136
/// assert_eq!(VerbatimUNC(OsStr::new("server"), OsStr::new("share")),
137137
/// get_path_prefix(r"\\?\UNC\server\share"));
138-
/// assert_eq!(VerbatimDisk('C' as u8), get_path_prefix(r"\\?\c:\"));
138+
/// assert_eq!(VerbatimDisk(b'C'), get_path_prefix(r"\\?\c:\"));
139139
/// assert_eq!(DeviceNS(OsStr::new("BrainInterface")),
140140
/// get_path_prefix(r"\\.\BrainInterface"));
141141
/// assert_eq!(UNC(OsStr::new("server"), OsStr::new("share")),
142142
/// get_path_prefix(r"\\server\share"));
143-
/// assert_eq!(Disk('C' as u8), get_path_prefix(r"C:\Users\Rust\Pictures\Ferris"));
143+
/// assert_eq!(Disk(b'C'), get_path_prefix(r"C:\Users\Rust\Pictures\Ferris"));
144144
/// # }
145145
/// ```
146146
#[derive(Copy, Clone, Debug, Hash, PartialOrd, Ord, PartialEq, Eq)]
@@ -235,10 +235,10 @@ impl<'a> Prefix<'a> {
235235
///
236236
/// assert!(Verbatim(OsStr::new("pictures")).is_verbatim());
237237
/// assert!(VerbatimUNC(OsStr::new("server"), OsStr::new("share")).is_verbatim());
238-
/// assert!(VerbatimDisk('C' as u8).is_verbatim());
238+
/// assert!(VerbatimDisk(b'C').is_verbatim());
239239
/// assert!(!DeviceNS(OsStr::new("BrainInterface")).is_verbatim());
240240
/// assert!(!UNC(OsStr::new("server"), OsStr::new("share")).is_verbatim());
241-
/// assert!(!Disk('C' as u8).is_verbatim());
241+
/// assert!(!Disk(b'C').is_verbatim());
242242
/// ```
243243
#[inline]
244244
#[stable(feature = "rust1", since = "1.0.0")]
@@ -401,7 +401,7 @@ enum State {
401401
/// let path = Path::new(r"c:\you\later\");
402402
/// match path.components().next().unwrap() {
403403
/// Component::Prefix(prefix_component) => {
404-
/// assert_eq!(Prefix::Disk('C' as u8), prefix_component.kind());
404+
/// assert_eq!(Prefix::Disk(b'C'), prefix_component.kind());
405405
/// assert_eq!(OsStr::new("c:"), prefix_component.as_os_str());
406406
/// }
407407
/// _ => unreachable!(),
@@ -1040,7 +1040,7 @@ impl<'a> cmp::Ord for Components<'a> {
10401040
/// [`Deref`]: ../ops/trait.Deref.html
10411041
///
10421042
/// More details about the overall approach can be found in
1043-
/// the module documentation.
1043+
/// the [module documentation](index.html).
10441044
///
10451045
/// # Examples
10461046
///
@@ -1186,7 +1186,7 @@ impl PathBuf {
11861186
self.inner.push(path);
11871187
}
11881188

1189-
/// Truncate `self` to [`self.parent`].
1189+
/// Truncates `self` to [`self.parent`].
11901190
///
11911191
/// Returns `false` and does nothing if [`self.file_name`] is [`None`].
11921192
/// Otherwise, returns `true`.
@@ -1512,7 +1512,7 @@ impl AsRef<OsStr> for PathBuf {
15121512
/// [`PathBuf`]: struct.PathBuf.html
15131513
///
15141514
/// More details about the overall approach can be found in
1515-
/// the module documentation.
1515+
/// the [module documentation](index.html).
15161516
///
15171517
/// # Examples
15181518
///
@@ -1689,7 +1689,7 @@ impl Path {
16891689
self.has_root() && (cfg!(unix) || cfg!(target_os = "redox") || self.prefix().is_some())
16901690
}
16911691

1692-
/// Return `false` if the `Path` is relative, i.e. not absolute.
1692+
/// Returns `true` if the `Path` is relative, i.e. not absolute.
16931693
///
16941694
/// See [`is_absolute`]'s documentation for more details.
16951695
///
@@ -2019,7 +2019,7 @@ impl Path {
20192019
/// * Repeated separators are ignored, so `a/b` and `a//b` both have
20202020
/// `a` and `b` as components.
20212021
///
2022-
/// * Occurentces of `.` are normalized away, exept if they are at the
2022+
/// * Occurences of `.` are normalized away, except if they are at the
20232023
/// beginning of the path. For example, `a/./b`, `a/b/`, `a/b/.` and
20242024
/// `a/b` all have `a` and `b` as components, but `./a/b` starts with
20252025
/// an additional [`CurDir`] component.

src/libstd/sys/redox/backtrace.rs

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

11-
use libc;
1211
use io;
1312
use sys_common::backtrace::Frame;
1413

15-
pub use sys_common::gnu::libbacktrace::*;
14+
pub use sys_common::gnu::libbacktrace::{foreach_symbol_fileline, resolve_symname};
1615
pub struct BacktraceContext;
1716

1817
#[inline(never)]
19-
pub fn unwind_backtrace(frames: &mut [Frame])
18+
pub fn unwind_backtrace(_frames: &mut [Frame])
2019
-> io::Result<(usize, BacktraceContext)>
2120
{
2221
Ok((0, BacktraceContext))
2322
}
23+
24+
pub mod gnu {
25+
use io;
26+
use fs;
27+
use libc::c_char;
28+
29+
pub fn get_executable_filename() -> io::Result<(Vec<c_char>, fs::File)> {
30+
Err(io::Error::new(io::ErrorKind::Other, "Not implemented"))
31+
}
32+
}

src/libstd/sys/redox/net/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl TcpStream {
3232
Ok(TcpStream(File::open(&Path::new(path.as_str()), &options)?))
3333
}
3434

35-
pub fn connect_timeout(_addr: &SocketAddr, _timeout: Duration) -> Result<()> {
35+
pub fn connect_timeout(_addr: &SocketAddr, _timeout: Duration) -> Result<TcpStream> {
3636
Err(Error::new(ErrorKind::Other, "TcpStream::connect_timeout not implemented"))
3737
}
3838

src/libstd/sys/windows/ext/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q)
477477
/// use std::os::windows::fs;
478478
///
479479
/// # fn foo() -> std::io::Result<()> {
480-
/// fs::symlink_file("a", "b")?;
480+
/// fs::symlink_dir("a", "b")?;
481481
/// # Ok(())
482482
/// # }
483483
/// ```

src/libstd/sys_common/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ pub mod net;
5252

5353
#[cfg(feature = "backtrace")]
5454
#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios", target_os = "emscripten"))),
55-
all(windows, target_env = "gnu")))]
55+
all(windows, target_env = "gnu"),
56+
target_os = "redox"))]
5657
pub mod gnu;
5758

5859
// common error constructors

0 commit comments

Comments
 (0)