Skip to content

Commit

Permalink
Auto merge of rust-lang#129595 - matthiaskrgr:rollup-4udn7nn, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#129288 (Use subtyping for `UnsafeFnPointer` coercion, too)
 - rust-lang#129405 (Fixing span manipulation and indentation of the suggestion introduced by rust-lang#126187)
 - rust-lang#129518 (gitignore: ignore ICE reports regardless of directory)
 - rust-lang#129519 (Remove redundant flags from `lower_ty_common` that can be inferred from the HIR)
 - rust-lang#129525 (rustdoc: clean up tuple <-> primitive conversion docs)
 - rust-lang#129526 (Use `FxHasher` on new solver unconditionally)
 - rust-lang#129544 (Removes dead code from the compiler)
 - rust-lang#129553 (add back test for stable-const-can-only-call-stable-const)
 - rust-lang#129590 (Avoid taking reference of &TyKind)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Aug 26, 2024
2 parents 4d22c1c + cd554e2 commit d958260
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions alloc/tests/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn box_deref_lval() {
assert_eq!(x.get(), 1000);
}

#[allow(unused)]
pub struct ConstAllocator;

unsafe impl Allocator for ConstAllocator {
Expand Down
36 changes: 21 additions & 15 deletions core/src/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,29 @@ macro_rules! tuple_impls {
}
}

#[stable(feature = "array_tuple_conv", since = "1.71.0")]
impl<T> From<[T; ${count($T)}]> for ($(${ignore($T)} T,)+) {
#[inline]
#[allow(non_snake_case)]
fn from(array: [T; ${count($T)}]) -> Self {
let [$($T,)+] = array;
($($T,)+)
maybe_tuple_doc! {
$($T)+ @
#[stable(feature = "array_tuple_conv", since = "1.71.0")]
impl<T> From<[T; ${count($T)}]> for ($(${ignore($T)} T,)+) {
#[inline]
#[allow(non_snake_case)]
fn from(array: [T; ${count($T)}]) -> Self {
let [$($T,)+] = array;
($($T,)+)
}
}
}

#[stable(feature = "array_tuple_conv", since = "1.71.0")]
impl<T> From<($(${ignore($T)} T,)+)> for [T; ${count($T)}] {
#[inline]
#[allow(non_snake_case)]
fn from(tuple: ($(${ignore($T)} T,)+)) -> Self {
let ($($T,)+) = tuple;
[$($T,)+]
maybe_tuple_doc! {
$($T)+ @
#[stable(feature = "array_tuple_conv", since = "1.71.0")]
impl<T> From<($(${ignore($T)} T,)+)> for [T; ${count($T)}] {
#[inline]
#[allow(non_snake_case)]
fn from(tuple: ($(${ignore($T)} T,)+)) -> Self {
let ($($T,)+) = tuple;
[$($T,)+]
}
}
}
}
Expand All @@ -148,7 +154,7 @@ macro_rules! tuple_impls {
// Otherwise, it hides the docs entirely.
macro_rules! maybe_tuple_doc {
($a:ident @ #[$meta:meta] $item:item) => {
#[doc(fake_variadic)]
#[cfg_attr(not(bootstrap), doc(fake_variadic))]
#[doc = "This trait is implemented for tuples up to twelve items long."]
#[$meta]
$item
Expand Down

0 comments on commit d958260

Please sign in to comment.