Skip to content

Commit

Permalink
Rollup merge of rust-lang#58105 - Centril:libarena-trans-2018, r=oli-obk
Browse files Browse the repository at this point in the history
libarena => 2018

Transitions `libarena` to Rust 2018; cc rust-lang#58099

r? @oli-obk
  • Loading branch information
Centril authored Feb 12, 2019
2 parents 16ca0b9 + f996e2b commit 3dbb31e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/libarena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
authors = ["The Rust Project Developers"]
name = "arena"
version = "0.0.0"
edition = "2018"

[lib]
name = "arena"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_data_structures = { path = "../librustc_data_structures" }
18 changes: 9 additions & 9 deletions src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
test(no_crate_inject, attr(deny(warnings))))]

#![deny(rust_2018_idioms)]

#![feature(alloc)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
#![feature(nll)]
#![feature(raw_vec_internals)]
#![cfg_attr(test, feature(test))]

#![allow(deprecated)]

extern crate alloc;
extern crate rustc_data_structures;

use rustc_data_structures::sync::MTLock;

Expand Down Expand Up @@ -476,7 +476,7 @@ impl SyncDroplessArena {
#[cfg(test)]
mod tests {
extern crate test;
use self::test::Bencher;
use test::Bencher;
use super::TypedArena;
use std::cell::Cell;

Expand Down Expand Up @@ -511,15 +511,15 @@ mod tests {

impl<'a> Wrap<'a> {
fn alloc_inner<F: Fn() -> Inner>(&self, f: F) -> &Inner {
let r: &EI = self.0.alloc(EI::I(f()));
let r: &EI<'_> = self.0.alloc(EI::I(f()));
if let &EI::I(ref i) = r {
i
} else {
panic!("mismatch");
}
}
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer {
let r: &EI = self.0.alloc(EI::O(f()));
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer<'_> {
let r: &EI<'_> = self.0.alloc(EI::O(f()));
if let &EI::O(ref o) = r {
o
} else {
Expand Down Expand Up @@ -609,7 +609,7 @@ mod tests {
count: &'a Cell<u32>,
}

impl<'a> Drop for DropCounter<'a> {
impl Drop for DropCounter<'_> {
fn drop(&mut self) {
self.count.set(self.count.get() + 1);
}
Expand All @@ -619,7 +619,7 @@ mod tests {
fn test_typed_arena_drop_count() {
let counter = Cell::new(0);
{
let arena: TypedArena<DropCounter> = TypedArena::default();
let arena: TypedArena<DropCounter<'_>> = TypedArena::default();
for _ in 0..100 {
// Allocate something with drop glue to make sure it doesn't leak.
arena.alloc(DropCounter { count: &counter });
Expand All @@ -631,7 +631,7 @@ mod tests {
#[test]
fn test_typed_arena_drop_on_clear() {
let counter = Cell::new(0);
let mut arena: TypedArena<DropCounter> = TypedArena::default();
let mut arena: TypedArena<DropCounter<'_>> = TypedArena::default();
for i in 0..10 {
for _ in 0..100 {
// Allocate something with drop glue to make sure it doesn't leak.
Expand Down

0 comments on commit 3dbb31e

Please sign in to comment.