11
11
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/" ,
12
12
test( no_crate_inject, attr( deny( warnings) ) ) ) ]
13
13
14
+ #![ deny( rust_2018_idioms) ]
15
+
14
16
#![ feature( alloc) ]
15
17
#![ feature( core_intrinsics) ]
16
18
#![ feature( dropck_eyepatch) ]
17
- #![ feature( nll) ]
18
19
#![ feature( raw_vec_internals) ]
19
20
#![ cfg_attr( test, feature( test) ) ]
20
21
21
22
#![ allow( deprecated) ]
22
23
23
24
extern crate alloc;
24
- extern crate rustc_data_structures;
25
25
26
26
use rustc_data_structures:: sync:: MTLock ;
27
27
@@ -476,7 +476,7 @@ impl SyncDroplessArena {
476
476
#[ cfg( test) ]
477
477
mod tests {
478
478
extern crate test;
479
- use self :: test:: Bencher ;
479
+ use test:: Bencher ;
480
480
use super :: TypedArena ;
481
481
use std:: cell:: Cell ;
482
482
@@ -511,15 +511,15 @@ mod tests {
511
511
512
512
impl < ' a > Wrap < ' a > {
513
513
fn alloc_inner < F : Fn ( ) -> Inner > ( & self , f : F ) -> & Inner {
514
- let r: & EI = self . 0 . alloc ( EI :: I ( f ( ) ) ) ;
514
+ let r: & EI < ' _ > = self . 0 . alloc ( EI :: I ( f ( ) ) ) ;
515
515
if let & EI :: I ( ref i) = r {
516
516
i
517
517
} else {
518
518
panic ! ( "mismatch" ) ;
519
519
}
520
520
}
521
- fn alloc_outer < F : Fn ( ) -> Outer < ' a > > ( & self , f : F ) -> & Outer {
522
- let r: & EI = self . 0 . alloc ( EI :: O ( f ( ) ) ) ;
521
+ fn alloc_outer < F : Fn ( ) -> Outer < ' a > > ( & self , f : F ) -> & Outer < ' _ > {
522
+ let r: & EI < ' _ > = self . 0 . alloc ( EI :: O ( f ( ) ) ) ;
523
523
if let & EI :: O ( ref o) = r {
524
524
o
525
525
} else {
@@ -609,7 +609,7 @@ mod tests {
609
609
count : & ' a Cell < u32 > ,
610
610
}
611
611
612
- impl < ' a > Drop for DropCounter < ' a > {
612
+ impl Drop for DropCounter < ' _ > {
613
613
fn drop ( & mut self ) {
614
614
self . count . set ( self . count . get ( ) + 1 ) ;
615
615
}
@@ -619,7 +619,7 @@ mod tests {
619
619
fn test_typed_arena_drop_count ( ) {
620
620
let counter = Cell :: new ( 0 ) ;
621
621
{
622
- let arena: TypedArena < DropCounter > = TypedArena :: default ( ) ;
622
+ let arena: TypedArena < DropCounter < ' _ > > = TypedArena :: default ( ) ;
623
623
for _ in 0 ..100 {
624
624
// Allocate something with drop glue to make sure it doesn't leak.
625
625
arena. alloc ( DropCounter { count : & counter } ) ;
@@ -631,7 +631,7 @@ mod tests {
631
631
#[ test]
632
632
fn test_typed_arena_drop_on_clear ( ) {
633
633
let counter = Cell :: new ( 0 ) ;
634
- let mut arena: TypedArena < DropCounter > = TypedArena :: default ( ) ;
634
+ let mut arena: TypedArena < DropCounter < ' _ > > = TypedArena :: default ( ) ;
635
635
for i in 0 ..10 {
636
636
for _ in 0 ..100 {
637
637
// Allocate something with drop glue to make sure it doesn't leak.
0 commit comments