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 16 pull requests #62355

Merged
merged 47 commits into from
Jul 4, 2019
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
fc918a3
rename InterpretCx -> InterpCx
RalfJung Jun 27, 2019
a02d436
wfcheck: resolve the type-vars in `AdtField` types
arielb1 Jun 29, 2019
f7061db
Update mem::replace example to not be identical to mem::take
czipperz Jun 30, 2019
3f39dc1
syntax: Unsupport `foo! bar { ... }` macros in the parser
petrochenkov Jun 30, 2019
d0dc41a
Address review comments
petrochenkov Jul 1, 2019
8d6b1d1
Clean up inherent_impls
Zoxc Apr 16, 2019
b49fb76
miri realloc: do not require giving old size+align
RalfJung Jul 1, 2019
8a3797b
Use mem::take instead of mem::replace with default
czipperz Jun 30, 2019
636f5e6
Convert more usages over
czipperz Jun 30, 2019
b0c199a
Enable mem_take feature in relevant crates
czipperz Jun 30, 2019
1443abc
Revert change in compiletest
czipperz Jun 30, 2019
eddfad3
Fix import of take in collapse_docs.rs
czipperz Jul 2, 2019
dc088b2
refactor check_for_substitution
matklad Jul 2, 2019
db16e17
When possible without changing semantics, implement Iterator::last in…
khuey Jul 2, 2019
c004451
Migrate compile-pass annotations to build-pass
JohnTitor Jul 2, 2019
8d2f80b
Use link attributes on extern "C" blocks with llvm-libuwind
petrhosek Jul 2, 2019
87e8613
Remove needless lifetimes
jeremystucki Jun 21, 2019
0477e07
Remove needless lifetimes
jeremystucki Jun 21, 2019
6ae80cf
Remove needless lifetimes
jeremystucki Jun 21, 2019
d50a3a7
Remove needless lifetimes
jeremystucki Jun 21, 2019
ec71176
Remove needless lifetimes
jeremystucki Jun 21, 2019
d28832d
Remove needless lifetimes
jeremystucki Jun 21, 2019
3cd4df7
Add missing lifetime specifier
jeremystucki Jun 23, 2019
80f4c49
Add missing lifetime specifier
jeremystucki Jun 23, 2019
b17cec5
Add missing lifetime specifier
jeremystucki Jun 23, 2019
edcde70
Add missing lifetime specifier
jeremystucki Jun 24, 2019
88c515d
Revert changes to the standard library
jeremystucki Jun 25, 2019
b4712f0
Fix bucket in CPU usage script
Mark-Simulacrum Jul 3, 2019
c51802a
simplify Option::get_or_insert
matklad Jul 3, 2019
4dd5edc
enable a few more tests in Miri and update the comment for others
RalfJung Jul 3, 2019
6225607
remove bogus example from drop_in_place
RalfJung Jul 3, 2019
e8a88f7
Rollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddyb
Centril Jul 3, 2019
740d5bd
Rollup merge of #62173 - RalfJung:miri-interp, r=oli-obk
Centril Jul 3, 2019
6cfd474
Rollup merge of #62240 - arielb1:resolve-wf-fields, r=pnkfelix
Centril Jul 3, 2019
88c007c
Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-def…
Centril Jul 3, 2019
944bda9
Rollup merge of #62252 - czipperz:change-mem-replace-doc-example, r=d…
Centril Jul 3, 2019
8867ba1
Rollup merge of #62258 - petrochenkov:idclean, r=Centril
Centril Jul 3, 2019
d7e42cc
Rollup merge of #62268 - Zoxc:inherent_impls, r=eddyb
Centril Jul 3, 2019
d93b52f
Rollup merge of #62287 - petrhosek:libunwind-link-attribute, r=tmandry
Centril Jul 3, 2019
44f22e6
Rollup merge of #62295 - RalfJung:miri-realloc, r=cramertj
Centril Jul 3, 2019
c0ec567
Rollup merge of #62297 - matklad:peek-delimited, r=petrochenkov
Centril Jul 3, 2019
4049a3c
Rollup merge of #62316 - khuey:efficient_last, r=sfackler
Centril Jul 3, 2019
9193497
Rollup merge of #62317 - JohnTitor:move-tests-to-build-pass, r=Centril
Centril Jul 3, 2019
cd1fa00
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alex…
Centril Jul 3, 2019
839e89c
Rollup merge of #62344 - matklad:simplify-option, r=sfackler
Centril Jul 3, 2019
144ed02
Rollup merge of #62346 - RalfJung:miri-tests, r=Centril
Centril Jul 3, 2019
6363a58
Rollup merge of #62351 - RalfJung:drop-in-place, r=cramertj
Centril Jul 3, 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
Prev Previous commit
Next Next commit
Remove needless lifetimes
jeremystucki committed Jul 3, 2019

Verified

This commit was signed with the committer’s verified signature.
jeremystucki Jeremy Stucki
commit 87e8613fd41e7a4237a146cbe49835bb88295df6
8 changes: 4 additions & 4 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
@@ -2004,7 +2004,7 @@ impl<K, V> BTreeMap<K, V> {
/// assert_eq!(keys, [1, 2]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
pub fn keys(&self) -> Keys<'_, K, V> {
Keys { inner: self.iter() }
}

@@ -2025,7 +2025,7 @@ impl<K, V> BTreeMap<K, V> {
/// assert_eq!(values, ["hello", "goodbye"]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
pub fn values(&self) -> Values<'_, K, V> {
Values { inner: self.iter() }
}

@@ -2529,8 +2529,8 @@ enum UnderflowResult<'a, K, V> {
Stole(NodeRef<marker::Mut<'a>, K, V, marker::Internal>),
}

fn handle_underfull_node<'a, K, V>(node: NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>)
-> UnderflowResult<'a, K, V> {
fn handle_underfull_node<K, V>(node: NodeRef<marker::Mut<'_>, K, V, marker::LeafOrInternal>)
-> UnderflowResult<'_, K, V> {
let parent = if let Ok(parent) = node.ascend() {
parent
} else {
2 changes: 1 addition & 1 deletion src/liballoc/collections/btree/node.rs
Original file line number Diff line number Diff line change
@@ -394,7 +394,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
}

/// Temporarily takes out another, immutable reference to the same node.
fn reborrow<'a>(&'a self) -> NodeRef<marker::Immut<'a>, K, V, Type> {
fn reborrow(&self) -> NodeRef<marker::Immut<'_>, K, V, Type> {
NodeRef {
height: self.height,
node: self.node,
2 changes: 1 addition & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
@@ -552,7 +552,7 @@ impl String {
/// assert_eq!("Hello �World", output);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> Cow<'a, str> {
pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str> {
let mut iter = lossy::Utf8Lossy::from_bytes(v).chunks();

let (first_valid, first_broken) = if let Some(chunk) = iter.next() {
2 changes: 1 addition & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
@@ -498,7 +498,7 @@ macro_rules! impls{
/// # end: *const T,
/// # phantom: PhantomData<&'a T>,
/// # }
/// fn borrow_vec<'a, T>(vec: &'a Vec<T>) -> Slice<'a, T> {
/// fn borrow_vec<T>(vec: &Vec<T>) -> Slice<T> {
/// let ptr = vec.as_ptr();
/// Slice {
/// start: ptr,
4 changes: 2 additions & 2 deletions src/libcore/ops/index.rs
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ pub trait Index<Idx: ?Sized> {
/// impl Index<Side> for Balance {
/// type Output = Weight;
///
/// fn index<'a>(&'a self, index: Side) -> &'a Self::Output {
/// fn index(&self, index: Side) -> &Self::Output {
/// println!("Accessing {:?}-side of balance immutably", index);
/// match index {
/// Side::Left => &self.left,
@@ -115,7 +115,7 @@ pub trait Index<Idx: ?Sized> {
/// }
///
/// impl IndexMut<Side> for Balance {
/// fn index_mut<'a>(&'a mut self, index: Side) -> &'a mut Self::Output {
/// fn index_mut(&mut self, index: Side) -> &mut Self::Output {
/// println!("Accessing {:?}-side of balance mutably", index);
/// match index {
/// Side::Left => &mut self.left,
2 changes: 1 addition & 1 deletion src/libproc_macro/bridge/scoped_cell.rs
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ impl<T: LambdaL> ScopedCell<T> {
}

/// Sets the value in `self` to `value` while running `f`.
pub fn set<'a, R>(&self, value: <T as ApplyL<'a>>::Out, f: impl FnOnce() -> R) -> R {
pub fn set<R>(&self, value: <T as ApplyL<'_>>::Out, f: impl FnOnce() -> R) -> R {
self.replace(value, |_| f())
}
}
2 changes: 1 addition & 1 deletion src/libstd/sync/mpsc/sync.rs
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ fn wait_timeout_receiver<'a, 'b, T>(lock: &'a Mutex<State<T>>,
new_guard
}

fn abort_selection<'a, T>(guard: &mut MutexGuard<'a , State<T>>) -> bool {
fn abort_selection<T>(guard: &mut MutexGuard<'_, State<T>>) -> bool {
match mem::replace(&mut guard.blocker, NoneBlocked) {
NoneBlocked => true,
BlockedSender(token) => {
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/ext/net.rs
Original file line number Diff line number Diff line change
@@ -673,7 +673,7 @@ impl UnixListener {
/// }
/// ```
#[stable(feature = "unix_socket_redox", since = "1.29.0")]
pub fn incoming<'a>(&'a self) -> Incoming<'a> {
pub fn incoming(&self) -> Incoming {
Incoming { listener: self }
}
}
2 changes: 1 addition & 1 deletion src/libstd/sys/unix/ext/net.rs
Original file line number Diff line number Diff line change
@@ -894,7 +894,7 @@ impl UnixListener {
/// }
/// ```
#[stable(feature = "unix_socket", since = "1.10.0")]
pub fn incoming<'a>(&'a self) -> Incoming<'a> {
pub fn incoming(&self) -> Incoming<'_> {
Incoming { listener: self }
}
}
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/mod.rs
Original file line number Diff line number Diff line change
@@ -195,7 +195,7 @@ fn wide_char_to_multi_byte(code_page: u32,
}
}

pub fn truncate_utf16_at_nul<'a>(v: &'a [u16]) -> &'a [u16] {
pub fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] {
match v.iter().position(|c| *c == 0) {
// don't include the 0
Some(i) => &v[..i],
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/path.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ pub fn is_verbatim_sep(b: u8) -> bool {
b == b'\\'
}

pub fn parse_prefix<'a>(path: &'a OsStr) -> Option<Prefix<'a>> {
pub fn parse_prefix(path: &OsStr) -> Option<Prefix> {
use crate::path::Prefix::*;
unsafe {
// The unsafety here stems from converting between &OsStr and &[u8]
2 changes: 1 addition & 1 deletion src/libstd/sys_common/io.rs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ pub mod test {
p.join(path)
}

pub fn path<'a>(&'a self) -> &'a Path {
pub fn path(&self) -> &Path {
let TempDir(ref p) = *self;
p
}
6 changes: 3 additions & 3 deletions src/libsyntax/attr/mod.rs
Original file line number Diff line number Diff line change
@@ -440,12 +440,12 @@ pub fn contains_name(attrs: &[Attribute], name: Symbol) -> bool {
})
}

pub fn find_by_name<'a>(attrs: &'a [Attribute], name: Symbol) -> Option<&'a Attribute> {
pub fn find_by_name(attrs: &[Attribute], name: Symbol) -> Option<&Attribute> {
attrs.iter().find(|attr| attr.check_name(name))
}

pub fn filter_by_name<'a>(attrs: &'a [Attribute], name: Symbol)
-> impl Iterator<Item = &'a Attribute> {
pub fn filter_by_name(attrs: &[Attribute], name: Symbol)
-> impl Iterator<Item=&Attribute> {
attrs.iter().filter(move |attr| attr.check_name(name))
}

2 changes: 1 addition & 1 deletion src/libsyntax/ext/tt/macro_parser.rs
Original file line number Diff line number Diff line change
@@ -901,7 +901,7 @@ fn may_begin_with(token: &Token, name: Name) -> bool {
/// # Returns
///
/// The parsed non-terminal.
fn parse_nt<'a>(p: &mut Parser<'a>, sp: Span, name: Symbol) -> Nonterminal {
fn parse_nt(p: &mut Parser<'_>, sp: Span, name: Symbol) -> Nonterminal {
if name == sym::tt {
return token::NtTT(p.parse_token_tree());
}
2 changes: 1 addition & 1 deletion src/libsyntax/util/parser_testing.rs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ pub fn string_to_stream(source_str: String) -> TokenStream {
}

/// Map string to parser (via tts)
pub fn string_to_parser<'a>(ps: &'a ParseSess, source_str: String) -> Parser<'a> {
pub fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser {
new_parser_from_source_str(ps, PathBuf::from("bogofile").into(), source_str)
}