Skip to content

Commit c1d7d38

Browse files
authored
Rollup merge of rust-lang#52302 - ljedrz:dyn_futureproofing, r=cramertj
Deny bare trait objects in the rest of rust Add `#![deny(bare_trait_objects)]` to all the modules not covered before (those did not require code changes) that I consider applicable (I left out shims) in order to futureproof them.
2 parents 739056d + 5058af7 commit c1d7d38

File tree

26 files changed

+43
-0
lines changed

26 files changed

+43
-0
lines changed

src/build_helper/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
use std::fs::File;
1214
use std::path::{Path, PathBuf};
1315
use std::process::{Command, Stdio};

src/liballoc_jemalloc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![no_std]
1212
#![allow(unused_attributes)]
13+
#![deny(bare_trait_objects)]
1314
#![unstable(feature = "alloc_jemalloc",
1415
reason = "implementation detail of std, does not provide any public API",
1516
issue = "0")]

src/liballoc_system/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![no_std]
1212
#![allow(unused_attributes)]
13+
#![deny(bare_trait_objects)]
1314
#![unstable(feature = "alloc_system",
1415
reason = "this library is unlikely to be stabilized in its current \
1516
form or name",

src/libarena/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#![cfg_attr(test, feature(test))]
3131

3232
#![allow(deprecated)]
33+
#![deny(bare_trait_objects)]
3334

3435
extern crate alloc;
3536
extern crate rustc_data_structures;

src/libfmt_macros/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//! Parsing does not happen at runtime: structures of `std::fmt::rt` are
1515
//! generated instead.
1616
17+
#![deny(bare_trait_objects)]
18+
1719
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1820
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
1921
html_root_url = "https://doc.rust-lang.org/nightly/",

src/libgraphviz/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@
283283
//!
284284
//! * [DOT language](http://www.graphviz.org/doc/info/lang.html)
285285
286+
#![deny(bare_trait_objects)]
287+
286288
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
287289
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
288290
html_root_url = "https://doc.rust-lang.org/nightly/",

src/libpanic_abort/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
2222
#![panic_runtime]
2323
#![allow(unused_features)]
24+
#![deny(bare_trait_objects)]
2425

2526
#![feature(core_intrinsics)]
2627
#![feature(libc)]

src/libproc_macro/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//! See [the book](../book/first-edition/procedural-macros.html) for more.
2323
2424
#![stable(feature = "proc_macro_lib", since = "1.15.0")]
25+
#![deny(bare_trait_objects)]
2526
#![deny(missing_docs)]
2627
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2728
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",

src/libprofiler_builtins/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
reason = "internal implementation detail of rustc right now",
1616
issue = "0")]
1717
#![allow(unused_features)]
18+
#![deny(bare_trait_objects)]
1819
#![feature(staged_api)]

src/librustc_apfloat/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
//!
4141
//! This API is completely unstable and subject to change.
4242
43+
#![deny(bare_trait_objects)]
44+
4345
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
4446
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
4547
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/librustc_asan/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
#![sanitizer_runtime]
1214
#![feature(alloc_system)]
1315
#![feature(sanitizer_runtime)]

src/librustc_borrowck/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
html_root_url = "https://doc.rust-lang.org/nightly/")]
1414

1515
#![allow(non_camel_case_types)]
16+
#![deny(bare_trait_objects)]
1617

1718
#![feature(from_ref)]
1819
#![feature(quote)]

src/librustc_incremental/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
//! Support for serializing the dep-graph and reloading it.
1212
13+
#![deny(bare_trait_objects)]
14+
1315
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1416
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
1517
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/librustc_lint/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
//!
2020
//! This API is completely unstable and subject to change.
2121
22+
#![deny(bare_trait_objects)]
23+
2224
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2325
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
2426
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/librustc_llvm/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![allow(non_camel_case_types)]
1313
#![allow(non_snake_case)]
1414
#![allow(dead_code)]
15+
#![deny(bare_trait_objects)]
1516

1617
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1718
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",

src/librustc_lsan/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
#![sanitizer_runtime]
1214
#![feature(alloc_system)]
1315
#![feature(sanitizer_runtime)]

src/librustc_mir/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
1414
1515
*/
1616

17+
#![deny(bare_trait_objects)]
18+
1719
#![feature(slice_patterns)]
1820
#![feature(slice_sort_by_cached_key)]
1921
#![feature(from_ref)]

src/librustc_msan/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
#![sanitizer_runtime]
1214
#![feature(alloc_system)]
1315
#![feature(sanitizer_runtime)]

src/librustc_passes/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//!
1515
//! This API is completely unstable and subject to change.
1616
17+
#![deny(bare_trait_objects)]
18+
1719
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1820
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
1921
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/librustc_platform_intrinsics/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![allow(bad_style)]
12+
#![deny(bare_trait_objects)]
1213

1314
pub struct Intrinsic {
1415
pub inputs: &'static [&'static Type],

src/librustc_plugin/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
//! See the [`plugin` feature](../unstable-book/language-features/plugin.html) of
6161
//! the Unstable Book for more examples.
6262
63+
#![deny(bare_trait_objects)]
64+
6365
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
6466
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
6567
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/librustc_privacy/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1214
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
1315
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/librustc_traits/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
//! New recursive solver modeled on Chalk's recursive solver. Most of
1212
//! the guts are broken up into modules; see the comments in those modules.
1313
14+
#![deny(bare_trait_objects)]
15+
1416
#![feature(crate_in_paths)]
1517
#![feature(crate_visibility_modifier)]
1618
#![feature(extern_prelude)]

src/librustc_tsan/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
#![sanitizer_runtime]
1214
#![feature(alloc_system)]
1315
#![feature(sanitizer_runtime)]

src/libsyntax_pos/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//!
1515
//! This API is completely unstable and subject to change.
1616
17+
#![deny(bare_trait_objects)]
18+
1719
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1820
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
1921
html_root_url = "https://doc.rust-lang.org/nightly/")]

src/libunwind/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
#![no_std]
1214
#![unstable(feature = "panic_unwind", issue = "32837")]
1315

0 commit comments

Comments
 (0)