Skip to content

Commit

Permalink
Auto merge of rust-lang#133379 - jieyouxu:rollup-00jxo71, r=jieyouxu
Browse files Browse the repository at this point in the history
Rollup of 4 pull requests

Successful merges:

 - rust-lang#133217 ([AIX] Add option -X32_64 to the "strip" command)
 - rust-lang#133237 (Minimally constify `Add`)
 - rust-lang#133355 (Add language tests for aggregate types)
 - rust-lang#133374 (show abi_unsupported_vector_types lint in future breakage reports)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Nov 23, 2024
2 parents 256c54d + a850f7c commit d05e8e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
#![feature(const_is_char_boundary)]
#![feature(const_precise_live_drops)]
#![feature(const_str_split_at)]
#![feature(const_trait_impl)]
#![feature(decl_macro)]
#![feature(deprecated_suggestion)]
#![feature(doc_cfg)]
Expand Down
13 changes: 13 additions & 0 deletions core/src/ops/arith.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
append_const_msg
)]
#[doc(alias = "+")]
#[cfg_attr(not(bootstrap), const_trait)]
pub trait Add<Rhs = Self> {
/// The resulting type after applying the `+` operator.
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -94,6 +95,7 @@ pub trait Add<Rhs = Self> {
macro_rules! add_impl {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(bootstrap)]
impl Add for $t {
type Output = $t;

Expand All @@ -103,6 +105,17 @@ macro_rules! add_impl {
fn add(self, other: $t) -> $t { self + other }
}

#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(bootstrap))]
impl const Add for $t {
type Output = $t;

#[inline]
#[track_caller]
#[rustc_inherit_overflow_checks]
fn add(self, other: $t) -> $t { self + other }
}

forward_ref_binop! { impl Add, add for $t, $t }
)*)
}
Expand Down

0 comments on commit d05e8e8

Please sign in to comment.