Skip to content

Commit 44b2cc0

Browse files
committed
librustc_allocator => 2018
1 parent b139669 commit 44b2cc0

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

src/librustc_allocator/Cargo.toml

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

67
[lib]
78
path = "lib.rs"

src/librustc_allocator/expand.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use log::debug;
12
use rustc::middle::allocator::AllocatorKind;
2-
use rustc_errors;
3-
use smallvec::SmallVec;
3+
use smallvec::{smallvec, SmallVec};
44
use syntax::{
55
ast::{
66
self, Arg, Attribute, Crate, Expr, FnHeader, Generics, Ident, Item, ItemKind,
@@ -23,7 +23,7 @@ use syntax::{
2323
};
2424
use syntax_pos::Span;
2525

26-
use {AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
26+
use crate::{AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
2727

2828
pub fn modify(
2929
sess: &ParseSess,
@@ -54,7 +54,7 @@ struct ExpandAllocatorDirectives<'a> {
5454
in_submod: isize,
5555
}
5656

57-
impl<'a> MutVisitor for ExpandAllocatorDirectives<'a> {
57+
impl MutVisitor for ExpandAllocatorDirectives<'_> {
5858
fn flat_map_item(&mut self, item: P<Item>) -> SmallVec<[P<Item>; 1]> {
5959
debug!("in submodule {}", self.in_submod);
6060

@@ -168,7 +168,7 @@ struct AllocFnFactory<'a> {
168168
cx: ExtCtxt<'a>,
169169
}
170170

171-
impl<'a> AllocFnFactory<'a> {
171+
impl AllocFnFactory<'_> {
172172
fn allocator_fn(&self, method: &AllocatorMethod) -> P<Item> {
173173
let mut abi_args = Vec::new();
174174
let mut i = 0;

src/librustc_allocator/lib.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
#![feature(nll)]
21
#![feature(rustc_private)]
32

4-
#[macro_use] extern crate log;
5-
extern crate rustc;
6-
extern crate rustc_data_structures;
7-
extern crate rustc_errors;
8-
extern crate rustc_target;
9-
extern crate syntax;
10-
extern crate syntax_pos;
11-
#[macro_use]
12-
extern crate smallvec;
3+
#![deny(rust_2018_idioms)]
134

145
pub mod expand;
156

0 commit comments

Comments
 (0)