Skip to content
Merged
Show file tree
Hide file tree
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

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
  • Loading branch information
jeremystucki committed Jul 3, 2019
commit 0477e072723438054ef8628ec33223cf94bacb69
2 changes: 1 addition & 1 deletion src/librustc/hir/map/hir_id_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::hir::itemlikevisit::ItemLikeVisitor;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::{Lock, ParallelIterator, par_iter};

pub fn check_crate<'hir>(hir_map: &hir::map::Map<'hir>) {
pub fn check_crate(hir_map: &hir::map::Map<'_>) {
hir_map.dep_graph.assert_ignored();

let errors = Lock::new(Vec::new());
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ impl Forest {
}
}

pub fn krate<'hir>(&'hir self) -> &'hir Crate {
pub fn krate(&self) -> &Crate {
self.dep_graph.read(DepNode::new_no_params(DepKind::Krate));
&self.krate
}

/// This is used internally in the dependency tracking system.
/// Use the `krate` method to ensure your dependency on the
/// crate is tracked.
pub fn untracked_krate<'hir>(&'hir self) -> &'hir Crate {
pub fn untracked_krate(&self) -> &Crate {
&self.krate
}
}
Expand Down Expand Up @@ -1085,7 +1085,7 @@ impl<'a> NodesMatchingSuffix<'a> {
// If `id` itself is a mod named `m` with parent `p`, then
// returns `Some(id, m, p)`. If `id` has no mod in its parent
// chain, then returns `None`.
fn find_first_mod_parent<'a>(map: &'a Map<'_>, mut id: HirId) -> Option<(HirId, Name)> {
fn find_first_mod_parent(map: &Map<'_>, mut id: HirId) -> Option<(HirId, Name)> {
loop {
if let Node::Item(item) = map.find(id)? {
if item_is_mod(&item) {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pub fn add_placeholder_note(err: &mut errors::DiagnosticBuilder<'_>) {
/// If there are types that satisfy both impls, invokes `on_overlap`
/// with a suitably-freshened `ImplHeader` with those types
/// substituted. Otherwise, invokes `no_overlap`.
pub fn overlapping_impls<'tcx, F1, F2, R>(
tcx: TyCtxt<'tcx>,
pub fn overlapping_impls<F1, F2, R>(
tcx: TyCtxt<'_>,
impl1_def_id: DefId,
impl2_def_id: DefId,
intercrate_mode: IntercrateMode,
Expand Down Expand Up @@ -247,10 +247,10 @@ pub enum OrphanCheckErr<'tcx> {
///
/// 1. All type parameters in `Self` must be "covered" by some local type constructor.
/// 2. Some local type must appear in `Self`.
pub fn orphan_check<'tcx>(
tcx: TyCtxt<'tcx>,
pub fn orphan_check(
tcx: TyCtxt<'_>,
impl_def_id: DefId,
) -> Result<(), OrphanCheckErr<'tcx>> {
) -> Result<(), OrphanCheckErr<'_>> {
debug!("orphan_check({:?})", impl_def_id);

// We only except this routine to be invoked on implementations
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
fn fuzzy_match_tys(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
/// returns the fuzzy category of a given type, or None
/// if the type can be equated to any type.
fn type_category<'tcx>(t: Ty<'tcx>) -> Option<u32> {
fn type_category(t: Ty<'_>) -> Option<u32> {
match t.sty {
ty::Bool => Some(0),
ty::Char => Some(1),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,6 @@ impl<'tcx> TyCtxt<'tcx> {
}
}

pub(super) fn is_object_safe_provider<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId) -> bool {
pub(super) fn is_object_safe_provider(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
tcx.object_safety_violations(trait_def_id).is_empty()
}
4 changes: 2 additions & 2 deletions src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1509,8 +1509,8 @@ fn confirm_impl_candidate<'cx, 'tcx>(
///
/// Based on the "projection mode", this lookup may in fact only examine the
/// topmost impl. See the comments for `Reveal` for more details.
fn assoc_ty_def<'cx, 'tcx>(
selcx: &SelectionContext<'cx, 'tcx>,
fn assoc_ty_def(
selcx: &SelectionContext<'_, '_>,
impl_def_id: DefId,
assoc_ty_def_id: DefId,
) -> specialization_graph::NodeItem<ty::AssocItem> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ pub struct SupertraitDefIds<'tcx> {
visited: FxHashSet<DefId>,
}

pub fn supertrait_def_ids<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId) -> SupertraitDefIds<'tcx> {
pub fn supertrait_def_ids(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SupertraitDefIds<'_> {
SupertraitDefIds {
tcx,
stack: vec![trait_def_id],
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/traits/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
mods: &mut Self::Module,
kind: AllocatorKind,
);
fn compile_codegen_unit<'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString);
fn compile_codegen_unit(&self, tcx: TyCtxt<'_>, cgu_name: InternedString);
// If find_features is true this won't access `sess.crate_types` by assuming
// that `is_pie_binary` is false. When we discover LLVM target features
// `sess.crate_types` is uninitialized so we cannot access it.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/traits/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub trait BuilderMethods<'a, 'tcx>:
{
fn new_block<'b>(cx: &'a Self::CodegenCx, llfn: Self::Value, name: &'b str) -> Self;
fn with_cx(cx: &'a Self::CodegenCx) -> Self;
fn build_sibling_block<'b>(&self, name: &'b str) -> Self;
fn build_sibling_block(&self, name: &str) -> Self;
fn cx(&self) -> &Self::CodegenCx;
fn llbb(&self) -> Self::BasicBlock;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/add_retag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pub struct AddRetag;
/// after the assignment, we can be sure to obtain the same place value.
/// (Concurrent accesses by other threads are no problem as these are anyway non-atomic
/// copies. Data races are UB.)
fn is_stable<'tcx>(
place: &Place<'tcx>,
fn is_stable(
place: &Place<'_>,
) -> bool {
use rustc::mir::Place::*;

Expand Down
14 changes: 7 additions & 7 deletions src/librustc_mir/transform/check_unsafety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,11 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for UnusedUnsafeVisitor<'a> {
}
}

fn check_unused_unsafe<'a, 'tcx>(
tcx: TyCtxt<'tcx>,
fn check_unused_unsafe(
tcx: TyCtxt<'_>,
def_id: DefId,
used_unsafe: &FxHashSet<hir::HirId>,
unsafe_blocks: &'a mut Vec<(hir::HirId, bool)>,
unsafe_blocks: &mut Vec<(hir::HirId, bool)>,
) {
let body_id =
tcx.hir().as_local_hir_id(def_id).and_then(|hir_id| {
Expand All @@ -506,7 +506,7 @@ fn check_unused_unsafe<'a, 'tcx>(
hir::intravisit::Visitor::visit_body(&mut visitor, body);
}

fn unsafety_check_result<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> UnsafetyCheckResult {
fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: DefId) -> UnsafetyCheckResult {
debug!("unsafety_violations({:?})", def_id);

// N.B., this borrow is valid because all the consumers of
Expand Down Expand Up @@ -545,7 +545,7 @@ fn unsafety_check_result<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> UnsafetyChec
}
}

fn unsafe_derive_on_repr_packed<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) {
fn unsafe_derive_on_repr_packed(tcx: TyCtxt<'_>, def_id: DefId) {
let lint_hir_id = tcx.hir().as_local_hir_id(def_id).unwrap_or_else(||
bug!("checking unsafety for non-local def id {:?}", def_id));

Expand Down Expand Up @@ -602,7 +602,7 @@ fn report_unused_unsafe(tcx: TyCtxt<'_>, used_unsafe: &FxHashSet<hir::HirId>, id
db.emit();
}

fn builtin_derive_def_id<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<DefId> {
fn builtin_derive_def_id(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
debug!("builtin_derive_def_id({:?})", def_id);
if let Some(impl_def_id) = tcx.impl_of_method(def_id) {
if tcx.has_attr(impl_def_id, sym::automatically_derived) {
Expand All @@ -618,7 +618,7 @@ fn builtin_derive_def_id<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<DefId
}
}

pub fn check_unsafety<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) {
pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: DefId) {
debug!("check_unsafety({:?})", def_id);

// closures are handled by their parent fn.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/dump_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::util as mir_util;
pub struct Marker(pub &'static str);

impl MirPass for Marker {
fn name<'a>(&'a self) -> Cow<'a, str> {
fn name(&self) -> Cow<'_, str> {
Cow::Borrowed(self.0)
}

Expand Down Expand Up @@ -52,7 +52,7 @@ pub fn on_mir_pass<'tcx>(
}
}

pub fn emit_mir<'tcx>(tcx: TyCtxt<'tcx>, outputs: &OutputFilenames) -> io::Result<()> {
pub fn emit_mir(tcx: TyCtxt<'_>, outputs: &OutputFilenames) -> io::Result<()> {
let path = outputs.path(OutputType::Mir);
let mut f = File::create(&path)?;
mir_util::write_mir_pretty(tcx, None, &mut f)?;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,14 @@ fn create_generator_resume_function<'tcx>(
dump_mir(tcx, None, "generator_resume", &0, source, body, |_, _| Ok(()) );
}

fn source_info<'tcx>(body: &Body<'tcx>) -> SourceInfo {
fn source_info(body: &Body<'_>) -> SourceInfo {
SourceInfo {
span: body.span,
scope: OUTERMOST_SOURCE_SCOPE,
}
}

fn insert_clean_drop<'tcx>(body: &mut Body<'tcx>) -> BasicBlock {
fn insert_clean_drop(body: &mut Body<'_>) -> BasicBlock {
let return_block = insert_term_block(body, TerminatorKind::Return);

// Create a block to destroy an unresumed generators. This can only destroy upvars.
Expand Down
12 changes: 6 additions & 6 deletions src/librustc_mir/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ pub(crate) fn provide(providers: &mut Providers<'_>) {
};
}

fn is_mir_available<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
fn is_mir_available(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
tcx.mir_keys(def_id.krate).contains(&def_id)
}

/// Finds the full set of `DefId`s within the current crate that have
/// MIR associated with them.
fn mir_keys<'tcx>(tcx: TyCtxt<'tcx>, krate: CrateNum) -> &'tcx DefIdSet {
fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &DefIdSet {
assert_eq!(krate, LOCAL_CRATE);

let mut set = DefIdSet::default();
Expand Down Expand Up @@ -94,7 +94,7 @@ fn mir_keys<'tcx>(tcx: TyCtxt<'tcx>, krate: CrateNum) -> &'tcx DefIdSet {
tcx.arena.alloc(set)
}

fn mir_built<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx Steal<Body<'tcx>> {
fn mir_built(tcx: TyCtxt<'_>, def_id: DefId) -> &Steal<Body<'_>> {
let mir = build::mir_build(tcx, def_id);
tcx.alloc_steal_mir(mir)
}
Expand Down Expand Up @@ -137,7 +137,7 @@ pub fn default_name<T: ?Sized>() -> Cow<'static, str> {
/// pass will be named after the type, and it will consist of a main
/// loop that goes over each available MIR and applies `run_pass`.
pub trait MirPass {
fn name<'a>(&'a self) -> Cow<'a, str> {
fn name(&self) -> Cow<'_, str> {
default_name::<Self>()
}

Expand Down Expand Up @@ -192,7 +192,7 @@ pub fn run_passes(
}
}

fn mir_const<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx Steal<Body<'tcx>> {
fn mir_const(tcx: TyCtxt<'_>, def_id: DefId) -> &Steal<Body<'_>> {
// Unsafety check uses the raw mir, so make sure it is run
let _ = tcx.unsafety_check_result(def_id);

Expand Down Expand Up @@ -223,7 +223,7 @@ fn mir_validated(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx Steal<Body<'tcx>> {
tcx.alloc_steal_mir(body)
}

fn optimized_mir<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx Body<'tcx> {
fn optimized_mir(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {
if tcx.is_constructor(def_id) {
// There's no reason to run all of the MIR passes on constructors when
// we can just output the MIR we want directly. This also saves const
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/qualify_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ pub fn provide(providers: &mut Providers<'_>) {
};
}

fn mir_const_qualif<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> (u8, &'tcx BitSet<Local>) {
fn mir_const_qualif(tcx: TyCtxt<'_>, def_id: DefId) -> (u8, &BitSet<Local>) {
// N.B., this `borrow()` is guaranteed to be valid (i.e., the value
// cannot yet be stolen), because `mir_validated()`, which steals
// from `mir_const(), forces this query to execute before
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn simplify_cfg(body: &mut Body<'_>) {
}

impl MirPass for SimplifyCfg {
fn name<'a>(&'a self) -> Cow<'a, str> {
fn name(&self) -> Cow<'_, str> {
Cow::Borrowed(&self.label)
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/simplify_branches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl SimplifyBranches {
}

impl MirPass for SimplifyBranches {
fn name<'a>(&'a self) -> Cow<'a, str> {
fn name(&self) -> Cow<'_, str> {
Cow::Borrowed(&self.label)
}

Expand Down