Skip to content

Commit

Permalink
Deny bare trait objects in src/librustc_save_analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Jul 12, 2018
1 parent c946c25 commit 0d7b2e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/librustc_save_analysis/json_dumper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
}

pub struct CallbackOutput<'b> {
callback: &'b mut FnMut(&Analysis),
callback: &'b mut dyn FnMut(&Analysis),
}

impl<'b> DumpOutput for CallbackOutput<'b> {
Expand All @@ -67,7 +67,7 @@ impl<'b, W: Write> JsonDumper<WriteOutput<'b, W>> {

impl<'b> JsonDumper<CallbackOutput<'b>> {
pub fn with_callback(
callback: &'b mut FnMut(&Analysis),
callback: &'b mut dyn FnMut(&Analysis),
config: Config,
) -> JsonDumper<CallbackOutput<'b>> {
JsonDumper {
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(custom_attribute)]
#![allow(unused_attributes)]
#![deny(bare_trait_objects)]

#![recursion_limit="256"]

Expand Down Expand Up @@ -1088,7 +1089,7 @@ impl<'a> SaveHandler for DumpHandler<'a> {

/// Call a callback with the results of save-analysis.
pub struct CallbackHandler<'b> {
pub callback: &'b mut FnMut(&rls_data::Analysis),
pub callback: &'b mut dyn FnMut(&rls_data::Analysis),
}

impl<'b> SaveHandler for CallbackHandler<'b> {
Expand Down

0 comments on commit 0d7b2e6

Please sign in to comment.