10000 Rollup of 7 pull requests by Mark-Simulacrum · Pull Request #52680 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 7 pull requests #52680

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

Merged
merged 17 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
303306c
Add unaligned volatile intrinsics
Amanieu Jul 14, 2018
b1d2a91
impl PartialEq+Eq for BuildHasherDefault
crepererum Jul 15, 2018
1581971
Stablize Redox Unix Sockets
jD91mZM2 Jul 24, 2018
4f3ab49
libstd: Prefer `Option::map`/etc over `match` where applicable
Wallacoloo Jul 24, 2018
727bd7d
libcore: Prefer `Option::map` over `match` where applicable
Wallacoloo Jul 24, 2018
10d8213
librustc: Prefer `Option::map`/etc over `match` where applicable
Wallacoloo Jul 24, 2018
cbe5f1c
libsyntax_ext: Prefer `Option::map` over `match` where applicable
Wallacoloo Jul 24, 2018
2e33a55
Allow declaring existential types inside blocks
oli-obk Jul 23, 2018
fb08915
clarify offset function safety concerns
RalfJung Jul 24, 2018
3cce003
Release notes: add some missing 1.28 libs stabilization
SimonSapin Jul 24, 2018
06ba69d
Rollup merge of #52391 - Amanieu:volatile_unaligned, r=alexcrichton
Mark-Simulacrum Jul 24, 2018
dab595e
Rollup merge of #52402 - crepererum:build_hasher_eq, r=sfackler
Mark-Simulacrum Jul 24, 2018
f930017
Rollup merge of #52645 - oli-obk:existential_in_fn_body, r=dtolnay
Mark-Simulacrum Jul 24, 2018
28f8cb5
Rollup merge of #52656 - jD91mZM2:stablize-uds, r=alexcrichton
Mark-Simulacrum Jul 24, 2018
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
11 changes: 4 additions & 7 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,13 +696,10 @@ impl<'a> Iterator for CharIndices<'a> {
impl<'a> DoubleEndedIterator for CharIndices<'a> {
#[inline]
fn next_back(&mut self) -> Option<(usize, char)> {
match self.iter.next_back() {
None => None,
Some(ch) => {
let index = self.front_offset + self.iter.iter.len();
Some((index, ch))
}
}
self.iter.next_back().map(|ch| {
let index = self.front_offset + self.iter.iter.len();
(index, ch)
})
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/librustc/traits/on_unimplemented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,10 @@ impl<'a, 'gcx, 'tcx> OnUnimplementedDirective {
for command in self.subcommands.iter().chain(Some(self)).rev() {
if let Some(ref condition) = command.condition {
if !attr::eval_condition(condition, &tcx.sess.parse_sess, &mut |c| {
options.contains(&(c.name().as_str().to_string(),
match c.value_str().map(|s| s.as_str().to_string()) {
Some(s) => Some(s),
None => None
}))
options.contains(&(
c.name().as_str().to_string(),
c.value_str().map(|s| s.as_str().to_string())
))
}) {
debug!("evaluate: skipping {:?} due to condition", command);
continue
Expand Down
13 changes: 5 additions & 8 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2697,15 +2697,12 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
self.opt_associated_item(def_id)
};

match item {
Some(trait_item) => {
match trait_item.container {
TraitContainer(_) => None,
ImplContainer(def_id) => Some(def_id),
}
item.and_then(|trait_item|
match trait_item.container {
TraitContainer(_) => None,
ImplContainer(def_id) => Some(def_id),
}
None => None
}
)
}

/// Looks up the span of `impl_did` if the impl is local; otherwise returns `Err`
Expand Down
17 changes: 7 additions & 10 deletions src/librustc_metadata/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,17 +824,14 @@ impl<'a> Context<'a> {
if rlib.is_none() && rmeta.is_none() && dylib.is_none() {
return None;
}
match slot {
Some((_, metadata)) => {
Some(Library {
dylib,
rlib,
rmeta,
metadata,
})
slot.map(|(_, metadata)|
Library {
dylib,
rlib,
rmeta,
metadata,
}
None => None,
}
)
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/libstd/net/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ impl<'a> Parser<'a> {
F: FnOnce(&mut Parser) -> Option<T>,
{
self.read_atomically(move |p| {
match cb(p) {
Some(x) => if p.is_eof() {Some(x)} else {None},
None => None,
}
cb(p).filter(|_| p.is_eof())
})
}

Expand Down
5 changes: 1 addition & 4 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,7 @@ impl<'a> Iterator for Ancestors<'a> {

fn next(&mut self) -> Option<Self::Item> {
let next = self.next;
self.next = match next {
Some(path) => path.parent(),
None => None,
};
self.next = next.and_then(Path::parent);
next
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/libstd/sys_common/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,15 @@ pub fn log_enabled() -> Option<PrintFormat> {
_ => return Some(PrintFormat::Full),
}

let val = match env::var_os("RUST_BACKTRACE") {
Some(x) => if &x == "0" {
let val = env::var_os("RUST_BACKTRACE").and_then(|x|
if &x == "0" {
None
} else if &x == "full" {
Some(PrintFormat::Full)
} else {
Some(PrintFormat::Short)
},
None => None,
};
}
);
ENABLED.store(match val {
Some(v) => v as isize,
None => 1,
Expand Down
12 changes: 4 additions & 8 deletions src/libsyntax_ext/deriving/generic/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,13 @@ pub fn nil_ty<'r>() -> Ty<'r> {
}

fn mk_lifetime(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Option<ast::Lifetime> {
match *lt {
Some(s) => Some(cx.lifetime(span, Ident::from_str(s))),
None => None,
}
lt.map(|s|
cx.lifetime(span, Ident::from_str(s))
)
}

fn mk_lifetimes(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Vec<ast::Lifetime> {
match *lt {
Some(s) => vec![cx.lifetime(span, Ident::from_str(s))],
None => vec![],
}
mk_lifetime(cx, span, lt).into_iter().collect()
}

impl<'a> Ty<'a> {
Expand Down
0