Skip to content

Commit 3dbb31e

Browse files
authored
Rollup merge of rust-lang#58105 - Centril:libarena-trans-2018, r=oli-obk
libarena => 2018 Transitions `libarena` to Rust 2018; cc rust-lang#58099 r? @oli-obk
2 parents 16ca0b9 + f996e2b commit 3dbb31e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/libarena/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
authors = ["The Rust Project Developers"]
33
name = "arena"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "arena"
89
path = "lib.rs"
910
crate-type = ["dylib"]
1011

1112
[dependencies]
12-
rustc_data_structures = { path = "../librustc_data_structures" }
13+
rustc_data_structures = { path = "../librustc_data_structures" }

src/libarena/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1212
test(no_crate_inject, attr(deny(warnings))))]
1313

14+
#![deny(rust_2018_idioms)]
15+
1416
#![feature(alloc)]
1517
#![feature(core_intrinsics)]
1618
#![feature(dropck_eyepatch)]
17-
#![feature(nll)]
1819
#![feature(raw_vec_internals)]
1920
#![cfg_attr(test, feature(test))]
2021

2122
#![allow(deprecated)]
2223

2324
extern crate alloc;
24-
extern crate rustc_data_structures;
2525

2626
use rustc_data_structures::sync::MTLock;
2727

@@ -476,7 +476,7 @@ impl SyncDroplessArena {
476476
#[cfg(test)]
477477
mod tests {
478478
extern crate test;
479-
use self::test::Bencher;
479+
use test::Bencher;
480480
use super::TypedArena;
481481
use std::cell::Cell;
482482

@@ -511,15 +511,15 @@ mod tests {
511511

512512
impl<'a> Wrap<'a> {
513513
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()));
515515
if let &EI::I(ref i) = r {
516516
i
517517
} else {
518518
panic!("mismatch");
519519
}
520520
}
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()));
523523
if let &EI::O(ref o) = r {
524524
o
525525
} else {
@@ -609,7 +609,7 @@ mod tests {
609609
count: &'a Cell<u32>,
610610
}
611611

612-
impl<'a> Drop for DropCounter<'a> {
612+
impl Drop for DropCounter<'_> {
613613
fn drop(&mut self) {
614614
self.count.set(self.count.get() + 1);
615615
}
@@ -619,7 +619,7 @@ mod tests {
619619
fn test_typed_arena_drop_count() {
620620
let counter = Cell::new(0);
621621
{
622-
let arena: TypedArena<DropCounter> = TypedArena::default();
622+
let arena: TypedArena<DropCounter<'_>> = TypedArena::default();
623623
for _ in 0..100 {
624624
// Allocate something with drop glue to make sure it doesn't leak.
625625
arena.alloc(DropCounter { count: &counter });
@@ -631,7 +631,7 @@ mod tests {
631631
#[test]
632632
fn test_typed_arena_drop_on_clear() {
633633
let counter = Cell::new(0);
634-
let mut arena: TypedArena<DropCounter> = TypedArena::default();
634+
let mut arena: TypedArena<DropCounter<'_>> = TypedArena::default();
635635
for i in 0..10 {
636636
for _ in 0..100 {
637637
// Allocate something with drop glue to make sure it doesn't leak.

0 commit comments

Comments
 (0)