Skip to content

Commit 0d7b2e6

Browse files
committed
Deny bare trait objects in src/librustc_save_analysis
1 parent c946c25 commit 0d7b2e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc_save_analysis/json_dumper.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
4646
}
4747

4848
pub struct CallbackOutput<'b> {
49-
callback: &'b mut FnMut(&Analysis),
49+
callback: &'b mut dyn FnMut(&Analysis),
5050
}
5151

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

6868
impl<'b> JsonDumper<CallbackOutput<'b>> {
6969
pub fn with_callback(
70-
callback: &'b mut FnMut(&Analysis),
70+
callback: &'b mut dyn FnMut(&Analysis),
7171
config: Config,
7272
) -> JsonDumper<CallbackOutput<'b>> {
7373
JsonDumper {

src/librustc_save_analysis/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
html_root_url = "https://doc.rust-lang.org/nightly/")]
1414
#![feature(custom_attribute)]
1515
#![allow(unused_attributes)]
16+
#![deny(bare_trait_objects)]
1617

1718
#![recursion_limit="256"]
1819

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

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

10941095
impl<'b> SaveHandler for CallbackHandler<'b> {

0 commit comments

Comments
 (0)