diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-09 00:15:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-09 00:15:49 +0100 |
| commit | 5b4cf9b90d6915fceae02109dbb26077d1004602 (patch) | |
| tree | 051d4de746f57144a1fd79c0083a452da1037e47 | |
| parent | 6f5941e113b7951fda69f58e15aafe5632a390f0 (diff) | |
| parent | 44b2cc0941e63cb8b12fd3a361d8eb8564504a73 (diff) | |
| download | rust-5b4cf9b90d6915fceae02109dbb26077d1004602.tar.gz rust-5b4cf9b90d6915fceae02109dbb26077d1004602.zip | |
Rollup merge of #58222 - taiki-e:librustc_allocator-2018, r=Centril
librustc_allocator => 2018 Transitions `librustc_allocator` to Rust 2018; cc #58099 r? @Centril
| -rw-r--r-- | src/librustc_allocator/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/librustc_allocator/expand.rs | 10 | ||||
| -rw-r--r-- | src/librustc_allocator/lib.rs | 11 |
3 files changed, 7 insertions, 15 deletions
diff --git a/src/librustc_allocator/Cargo.toml b/src/librustc_allocator/Cargo.toml index 03d33f413c8..cf6c598bfb1 100644 --- a/src/librustc_allocator/Cargo.toml +++ b/src/librustc_allocator/Cargo.toml @@ -2,6 +2,7 @@ authors = ["The Rust Project Developers"] name = "rustc_allocator" version = "0.0.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/src/librustc_allocator/expand.rs b/src/librustc_allocator/expand.rs index 1fb1794d514..d302e7646d1 100644 --- a/src/librustc_allocator/expand.rs +++ b/src/librustc_allocator/expand.rs @@ -1,6 +1,6 @@ +use log::debug; use rustc::middle::allocator::AllocatorKind; -use rustc_errors; -use smallvec::SmallVec; +use smallvec::{smallvec, SmallVec}; use syntax::{ ast::{ self, Arg, Attribute, Crate, Expr, FnHeader, Generics, Ident, Item, ItemKind, @@ -23,7 +23,7 @@ use syntax::{ }; use syntax_pos::Span; -use {AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS}; +use crate::{AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS}; pub fn modify( sess: &ParseSess, @@ -54,7 +54,7 @@ struct ExpandAllocatorDirectives<'a> { in_submod: isize, } -impl<'a> MutVisitor for ExpandAllocatorDirectives<'a> { +impl MutVisitor for ExpandAllocatorDirectives<'_> { fn flat_map_item(&mut self, item: P<Item>) -> SmallVec<[P<Item>; 1]> { debug!("in submodule {}", self.in_submod); @@ -168,7 +168,7 @@ struct AllocFnFactory<'a> { cx: ExtCtxt<'a>, } -impl<'a> AllocFnFactory<'a> { +impl AllocFnFactory<'_> { fn allocator_fn(&self, method: &AllocatorMethod) -> P<Item> { let mut abi_args = Vec::new(); let mut i = 0; diff --git a/src/librustc_allocator/lib.rs b/src/librustc_allocator/lib.rs index 41c0be61595..16b9ccfda80 100644 --- a/src/librustc_allocator/lib.rs +++ b/src/librustc_allocator/lib.rs @@ -1,15 +1,6 @@ -#![feature(nll)] #![feature(rustc_private)] -#[macro_use] extern crate log; -extern crate rustc; -extern crate rustc_data_structures; -extern crate rustc_errors; -extern crate rustc_target; -extern crate syntax; -extern crate syntax_pos; -#[macro_use] -extern crate smallvec; +#![deny(rust_2018_idioms)] pub mod expand; |
