1
Fork 0

Rollup merge of #62057 - matthewjasper:deny-unnecessary-outlives, r=Mark-Simulacrum

Deny explicit_outlives_requirements in the compiler
This commit is contained in:
Mazdak Farrokhzad 2019-06-23 01:59:19 +02:00 committed by GitHub
commit 07c82e183b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 11 additions and 16 deletions

View file

@ -51,7 +51,7 @@ pub trait ItemLikeVisitor<'hir> {
fn visit_impl_item(&mut self, impl_item: &'hir ImplItem); fn visit_impl_item(&mut self, impl_item: &'hir ImplItem);
} }
pub struct DeepVisitor<'v, V: 'v> { pub struct DeepVisitor<'v, V> {
visitor: &'v mut V, visitor: &'v mut V,
} }

View file

@ -800,7 +800,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
/// [blog post]: https://is.gd/0hKvIr /// [blog post]: https://is.gd/0hKvIr
struct TypeGeneralizer<'me, 'tcx, D> struct TypeGeneralizer<'me, 'tcx, D>
where where
D: TypeRelatingDelegate<'tcx> + 'me, D: TypeRelatingDelegate<'tcx>,
{ {
infcx: &'me InferCtxt<'me, 'tcx>, infcx: &'me InferCtxt<'me, 'tcx>,

View file

@ -31,7 +31,6 @@
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
#![deny(internal)] #![deny(internal)]
#![deny(unused_lifetimes)] #![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]
#![feature(arbitrary_self_types)] #![feature(arbitrary_self_types)]
#![feature(box_patterns)] #![feature(box_patterns)]

View file

@ -231,7 +231,7 @@ pub struct CommonConsts<'tcx> {
pub err: &'tcx Const<'tcx>, pub err: &'tcx Const<'tcx>,
} }
pub struct LocalTableInContext<'a, V: 'a> { pub struct LocalTableInContext<'a, V> {
local_id_root: Option<DefId>, local_id_root: Option<DefId>,
data: &'a ItemLocalMap<V> data: &'a ItemLocalMap<V>
} }
@ -294,7 +294,7 @@ impl<'a, V> ::std::ops::Index<hir::HirId> for LocalTableInContext<'a, V> {
} }
} }
pub struct LocalTableInContextMut<'a, V: 'a> { pub struct LocalTableInContextMut<'a, V> {
local_id_root: Option<DefId>, local_id_root: Option<DefId>,
data: &'a mut ItemLocalMap<V> data: &'a mut ItemLocalMap<V>
} }
@ -2171,7 +2171,7 @@ impl<'tcx> TyCtxt<'tcx> {
/// An entry in an interner. /// An entry in an interner.
struct Interned<'tcx, T: 'tcx+?Sized>(&'tcx T); struct Interned<'tcx, T: ?Sized>(&'tcx T);
impl<'tcx, T: 'tcx+?Sized> Clone for Interned<'tcx, T> { impl<'tcx, T: 'tcx+?Sized> Clone for Interned<'tcx, T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {

View file

@ -89,7 +89,7 @@ macro_rules! profq_query_msg {
/// A type representing the responsibility to execute the job in the `job` field. /// A type representing the responsibility to execute the job in the `job` field.
/// This will poison the relevant query if dropped. /// This will poison the relevant query if dropped.
pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx> + 'a> { pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx>> {
cache: &'a Lock<QueryCache<'tcx, Q>>, cache: &'a Lock<QueryCache<'tcx, Q>>,
key: Q::Key, key: Q::Key,
job: Lrc<QueryJob<'tcx>>, job: Lrc<QueryJob<'tcx>>,
@ -230,7 +230,7 @@ pub struct CycleError<'tcx> {
} }
/// The result of `try_get_lock` /// The result of `try_get_lock`
pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx> + 'a> { pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx>> {
/// The query is not yet started. Contains a guard to the cache eventually used to start it. /// The query is not yet started. Contains a guard to the cache eventually used to start it.
NotYetStarted(JobOwner<'a, 'tcx, D>), NotYetStarted(JobOwner<'a, 'tcx, D>),

View file

@ -24,7 +24,6 @@
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
#![deny(internal)] #![deny(internal)]
#![deny(unused_lifetimes)] #![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]
use back::write::{create_target_machine, create_informational_target_machine}; use back::write::{create_target_machine, create_informational_target_machine};
use syntax_pos::symbol::Symbol; use syntax_pos::symbol::Symbol;

View file

@ -15,7 +15,6 @@
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
#![deny(internal)] #![deny(internal)]
#![deny(unused_lifetimes)] #![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]
#![recursion_limit="256"] #![recursion_limit="256"]

View file

@ -30,7 +30,7 @@ impl<'a, 'tcx, BD> MirWithFlowState<'tcx> for DataflowBuilder<'a, 'tcx, BD>
fn flow_state(&self) -> &DataflowState<'tcx, Self::BD> { &self.flow_state.flow_state } fn flow_state(&self) -> &DataflowState<'tcx, Self::BD> { &self.flow_state.flow_state }
} }
struct Graph<'a, 'tcx, MWF:'a, P> where struct Graph<'a, 'tcx, MWF, P> where
MWF: MirWithFlowState<'tcx> MWF: MirWithFlowState<'tcx>
{ {
mbcx: &'a MWF, mbcx: &'a MWF,

View file

@ -181,7 +181,7 @@ where
struct PropagationContext<'b, 'a, 'tcx, O> struct PropagationContext<'b, 'a, 'tcx, O>
where where
O: 'b + BitDenotation<'tcx>, O: BitDenotation<'tcx>,
{ {
builder: &'b mut DataflowAnalysis<'a, 'tcx, O>, builder: &'b mut DataflowAnalysis<'a, 'tcx, O>,
} }

View file

@ -21,7 +21,7 @@ use super::{
}; };
use crate::const_eval::{CompileTimeInterpreter, CompileTimeEvalContext}; use crate::const_eval::{CompileTimeInterpreter, CompileTimeEvalContext};
struct InternVisitor<'rt, 'mir: 'rt, 'tcx: 'rt + 'mir> { struct InternVisitor<'rt, 'mir, 'tcx> {
/// previously encountered safe references /// previously encountered safe references
ref_tracking: &'rt mut RefTracking<(MPlaceTy<'tcx>, Mutability, InternMode)>, ref_tracking: &'rt mut RefTracking<(MPlaceTy<'tcx>, Mutability, InternMode)>,
ecx: &'rt mut CompileTimeEvalContext<'mir, 'tcx>, ecx: &'rt mut CompileTimeEvalContext<'mir, 'tcx>,

View file

@ -30,7 +30,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
#![deny(internal)] #![deny(internal)]
#![deny(unused_lifetimes)] #![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] #[macro_use]

View file

@ -92,7 +92,7 @@ pub trait DropElaborator<'a, 'tcx>: fmt::Debug {
#[derive(Debug)] #[derive(Debug)]
struct DropCtxt<'l, 'b, 'tcx, D> struct DropCtxt<'l, 'b, 'tcx, D>
where where
D: DropElaborator<'b, 'tcx> + 'l, D: DropElaborator<'b, 'tcx>,
{ {
elaborator: &'l mut D, elaborator: &'l mut D,

View file

@ -75,7 +75,6 @@ This API is completely unstable and subject to change.
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
#![deny(internal)] #![deny(internal)]
#![deny(unused_lifetimes)] #![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate syntax; #[macro_use] extern crate syntax;