Skip to content

Commit

Permalink
Rollup merge of rust-lang#52290 - ljedrz:dyn_librustc_save_analysis, …
Browse files Browse the repository at this point in the history
…r=cramertj

Deny bare trait objects in src/librustc_save_analysis

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_save_analysis`.
  • Loading branch information
Mark-Simulacrum authored Jul 13, 2018
2 parents 24738ba + 0d7b2e6 commit 464ed4d
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 464ed4d

Please sign in to comment.