Skip to content

Commit 1d035f7

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 700f19a + 5058af7 commit 1d035f7

File tree

26 files changed

+43
-0
lines changed

26 files changed

+43
-0
lines changed

src/build_helper/lib.rs

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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/")]

0 commit comments

Comments
 (0)