Skip to content

Commit

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

Rollup of 3 pull requests

Successful merges:

 - rust-lang#135381 (Add an example for `Vec::splice` inserting elements without removing)
 - rust-lang#135451 (Remove code duplication when hashing query result and interning node)
 - rust-lang#135464 (fix ICE with references to infinite structs in consts)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jan 14, 2025
2 parents e491cae + 4cadb5d commit a48e7b0
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 52 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ macro_rules! define_feedable {
let dep_node_index = tcx.dep_graph.with_feed_task(
dep_node,
tcx,
key,
&value,
hash_result!([$($modifiers)*]),
);
Expand Down
78 changes: 36 additions & 42 deletions compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,25 +376,8 @@ impl<D: Deps> DepGraphData<D> {
};

let dcx = cx.dep_context();
let hashing_timer = dcx.profiler().incr_result_hashing();
let current_fingerprint =
hash_result.map(|f| dcx.with_stable_hashing_context(|mut hcx| f(&mut hcx, &result)));

// Intern the new `DepNode`.
let (dep_node_index, prev_and_color) =
self.current.intern_node(&self.previous, key, edges, current_fingerprint);

hashing_timer.finish_with_query_invocation_id(dep_node_index.into());

if let Some((prev_index, color)) = prev_and_color {
debug_assert!(
self.colors.get(prev_index).is_none(),
"DepGraph::with_task() - Duplicate DepNodeColor \
insertion for {key:?}"
);

self.colors.insert(prev_index, color);
}
let dep_node_index =
self.hash_result_and_intern_node(dcx, key, edges, &result, hash_result);

(result, dep_node_index)
}
Expand Down Expand Up @@ -462,6 +445,38 @@ impl<D: Deps> DepGraphData<D> {

(result, dep_node_index)
}

/// Intern the new `DepNode` with the dependencies up-to-now.
fn hash_result_and_intern_node<Ctxt: DepContext<Deps = D>, R>(
&self,
cx: &Ctxt,
node: DepNode,
edges: EdgesVec,
result: &R,
hash_result: Option<fn(&mut StableHashingContext<'_>, &R) -> Fingerprint>,
) -> DepNodeIndex {
let hashing_timer = cx.profiler().incr_result_hashing();
let current_fingerprint = hash_result.map(|hash_result| {
cx.with_stable_hashing_context(|mut hcx| hash_result(&mut hcx, result))
});

// Intern the new `DepNode` with the dependencies up-to-now.
let (dep_node_index, prev_and_color) =
self.current.intern_node(&self.previous, node, edges, current_fingerprint);

hashing_timer.finish_with_query_invocation_id(dep_node_index.into());

if let Some((prev_index, color)) = prev_and_color {
debug_assert!(
self.colors.get(prev_index).is_none(),
"DepGraph::with_task() - Duplicate DepNodeColor insertion for {node:?}",
);

self.colors.insert(prev_index, color);
}

dep_node_index
}
}

impl<D: Deps> DepGraph<D> {
Expand Down Expand Up @@ -536,11 +551,10 @@ impl<D: Deps> DepGraph<D> {
/// FIXME: If the code is changed enough for this node to be marked before requiring the
/// caller's node, we suppose that those changes will be enough to mark this node red and
/// force a recomputation using the "normal" way.
pub fn with_feed_task<Ctxt: DepContext<Deps = D>, A: Debug, R: Debug>(
pub fn with_feed_task<Ctxt: DepContext<Deps = D>, R: Debug>(
&self,
node: DepNode,
cx: Ctxt,
key: A,
result: &R,
hash_result: Option<fn(&mut StableHashingContext<'_>, &R) -> Fingerprint>,
) -> DepNodeIndex {
Expand Down Expand Up @@ -588,27 +602,7 @@ impl<D: Deps> DepGraph<D> {
}
});

let hashing_timer = cx.profiler().incr_result_hashing();
let current_fingerprint = hash_result.map(|hash_result| {
cx.with_stable_hashing_context(|mut hcx| hash_result(&mut hcx, result))
});

// Intern the new `DepNode` with the dependencies up-to-now.
let (dep_node_index, prev_and_color) =
data.current.intern_node(&data.previous, node, edges, current_fingerprint);

hashing_timer.finish_with_query_invocation_id(dep_node_index.into());

if let Some((prev_index, color)) = prev_and_color {
debug_assert!(
data.colors.get(prev_index).is_none(),
"DepGraph::with_task() - Duplicate DepNodeColor insertion for {key:?}",
);

data.colors.insert(prev_index, color);
}

dep_node_index
data.hash_result_and_intern_node(&cx, node, edges, result, hash_result)
} else {
// Incremental compilation is turned off. We just execute the task
// without tracking. We still provide a dep-node index that uniquely
Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_trait_selection/src/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,9 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
// If returned by `struct_tail` this is the empty tuple.
| ty::Tuple(..)
// Integers and floats are always Sized, and so have unit type metadata.
| ty::Infer(ty::InferTy::IntVar(_) | ty::InferTy::FloatVar(..)) => true,
| ty::Infer(ty::InferTy::IntVar(_) | ty::InferTy::FloatVar(..))
// This happens if we reach the recursion limit when finding the struct tail.
| ty::Error(..) => true,

// We normalize from `Wrapper<Tail>::Metadata` to `Tail::Metadata` if able.
// Otherwise, type parameters, opaques, and unnormalized projections have
Expand Down Expand Up @@ -1179,8 +1181,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
| ty::Alias(..)
| ty::Bound(..)
| ty::Placeholder(..)
| ty::Infer(..)
| ty::Error(_) => {
| ty::Infer(..) => {
if tail.has_infer_types() {
candidate_set.mark_ambiguous();
}
Expand Down
16 changes: 13 additions & 3 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3587,7 +3587,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// with the given `replace_with` iterator and yields the removed items.
/// `replace_with` does not need to be the same length as `range`.
///
/// `range` is removed even if the iterator is not consumed until the end.
/// `range` is removed even if the `Splice` iterator is not consumed before it is dropped.
///
/// It is unspecified how many elements are removed from the vector
/// if the `Splice` value is leaked.
Expand All @@ -3613,8 +3613,18 @@ impl<T, A: Allocator> Vec<T, A> {
/// let mut v = vec![1, 2, 3, 4];
/// let new = [7, 8, 9];
/// let u: Vec<_> = v.splice(1..3, new).collect();
/// assert_eq!(v, &[1, 7, 8, 9, 4]);
/// assert_eq!(u, &[2, 3]);
/// assert_eq!(v, [1, 7, 8, 9, 4]);
/// assert_eq!(u, [2, 3]);
/// ```
///
/// Using `splice` to insert new items into a vector efficiently at a specific position
/// indicated by an empty range:
///
/// ```
/// let mut v = vec![1, 5];
/// let new = [2, 3, 4];
/// v.splice(1..1, new);
/// assert_eq!(v, [1, 2, 3, 4, 5]);
/// ```
#[cfg(not(no_global_oom_handling))]
#[inline]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
//@ known-bug: #114484
//@ build-fail

//@ error-pattern: reached the recursion limit while instantiating
//@ error-pattern: reached the recursion limit finding the struct tail

// Regression test for #114484: This used to ICE during monomorphization, because we treated
// `<VirtualWrapper<...> as Pointee>::Metadata` as a rigid projection after reaching the recursion
// limit when finding the struct tail.

use std::marker::PhantomData;

trait MyTrait {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
error: reached the recursion limit finding the struct tail for `[u8; 256]`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`

error: reached the recursion limit finding the struct tail for `[u8; 256]`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: reached the recursion limit finding the struct tail for `[u8; 256]`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: reached the recursion limit finding the struct tail for `[u8; 256]`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
|
LL | unsafe { virtualize_my_trait(L, self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: reached the recursion limit finding the struct tail for `SomeData<256>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`

error: reached the recursion limit finding the struct tail for `SomeData<256>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: reached the recursion limit finding the struct tail for `SomeData<256>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: reached the recursion limit finding the struct tail for `SomeData<256>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
|
LL | unsafe { virtualize_my_trait(L, self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`

error: reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
|
LL | unsafe { virtualize_my_trait(L, self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: reached the recursion limit while instantiating `<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<..., 1>, 1>, 1>, 1>, 1> as MyTrait>::virtualize`
|
note: `<VirtualWrapper<T, L> as MyTrait>::virtualize` defined here
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:25:5
|
LL | fn virtualize(&self) -> &dyn MyTrait {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the full type name has been written to '$TEST_BUILD_DIR/infinite/infinite-instantiation-struct-tail-ice-114484/infinite-instantiation-struct-tail-ice-114484.long-type.txt'

error: aborting due to 13 previous errors

1 change: 1 addition & 0 deletions tests/ui/structs/ice-struct-tail-normalization-113272.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ struct Other {
fn main() {
unsafe {
std::mem::transmute::<Option<()>, Option<&Other>>(None);
//~^ ERROR cannot transmute
}
}
Loading

0 comments on commit a48e7b0

Please sign in to comment.