Skip to content

Commit f3d9584

Browse files
authored
Rollup merge of #105484 - nbdd0121:upcast, r=compiler-errors
Implement allow-by-default `multiple_supertrait_upcastable` lint The lint detects when an object-safe trait has multiple supertraits. Enabled in libcore and liballoc as they are low-level enough that many embedded programs will use them. r? `@nikomatsakis`
2 parents 5b7612a + 1619cba commit f3d9584

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

alloc/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
#![warn(missing_debug_implementations)]
8888
#![warn(missing_docs)]
8989
#![allow(explicit_outlives_requirements)]
90+
#![cfg_attr(not(bootstrap), warn(multiple_supertrait_upcastable))]
9091
//
9192
// Library features:
9293
#![feature(alloc_layout_extra)]
@@ -190,6 +191,7 @@
190191
#![feature(unsized_fn_params)]
191192
#![feature(c_unwind)]
192193
#![feature(with_negative_coherence)]
194+
#![cfg_attr(not(bootstrap), feature(multiple_supertrait_upcastable))]
193195
//
194196
// Rustdoc features:
195197
#![feature(doc_cfg)]

core/src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use crate::fmt::{Debug, Display};
2828
#[stable(feature = "rust1", since = "1.0.0")]
2929
#[cfg_attr(not(test), rustc_diagnostic_item = "Error")]
3030
#[rustc_has_incoherent_inherent_impls]
31+
#[cfg_attr(not(bootstrap), allow(multiple_supertrait_upcastable))]
3132
pub trait Error: Debug + Display {
3233
/// The lower-level source of this error, if any.
3334
///

core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
#![warn(missing_docs)]
9696
#![allow(explicit_outlives_requirements)]
9797
#![allow(incomplete_features)]
98+
#![cfg_attr(not(bootstrap), warn(multiple_supertrait_upcastable))]
9899
//
99100
// Library features:
100101
#![feature(const_align_offset)]
@@ -231,6 +232,7 @@
231232
#![feature(unsized_fn_params)]
232233
#![feature(asm_const)]
233234
#![feature(const_transmute_copy)]
235+
#![cfg_attr(not(bootstrap), feature(multiple_supertrait_upcastable))]
234236
//
235237
// Target features:
236238
#![feature(arm_target_feature)]

0 commit comments

Comments
 (0)