Deny bare trait objects in in src/librustc_allocator

This commit is contained in:
ljedrz 2018-07-11 12:08:49 +02:00
parent 77117e3836
commit 5ccaaa80d0
2 changed files with 4 additions and 3 deletions

View File

@ -37,7 +37,7 @@ use {AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
pub fn modify( pub fn modify(
sess: &ParseSess, sess: &ParseSess,
resolver: &mut Resolver, resolver: &mut dyn Resolver,
krate: Crate, krate: Crate,
crate_name: String, crate_name: String,
handler: &rustc_errors::Handler, handler: &rustc_errors::Handler,
@ -56,7 +56,7 @@ struct ExpandAllocatorDirectives<'a> {
found: bool, found: bool,
handler: &'a rustc_errors::Handler, handler: &'a rustc_errors::Handler,
sess: &'a ParseSess, sess: &'a ParseSess,
resolver: &'a mut Resolver, resolver: &'a mut dyn Resolver,
crate_name: Option<String>, crate_name: Option<String>,
// For now, we disallow `global_allocator` in submodules because hygiene is hard. Keep track of // For now, we disallow `global_allocator` in submodules because hygiene is hard. Keep track of
@ -256,7 +256,7 @@ impl<'a> AllocFnFactory<'a> {
&self, &self,
ty: &AllocatorTy, ty: &AllocatorTy,
args: &mut Vec<Arg>, args: &mut Vec<Arg>,
ident: &mut FnMut() -> Ident, ident: &mut dyn FnMut() -> Ident,
) -> P<Expr> { ) -> P<Expr> {
match *ty { match *ty {
AllocatorTy::Layout => { AllocatorTy::Layout => {

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![deny(bare_trait_objects)]
#![feature(rustc_private)] #![feature(rustc_private)]
#[macro_use] extern crate log; #[macro_use] extern crate log;