jiebi/CodeConvo huggingface dataset:
return Ok(expr); } } <ins> if (op.node == AssocOp::Equal || op.node == AssocOp::NotEqual) && self.token.kind == token::Eq && self.prev_token.span.hi() == self.token.span.lo() { // Look for JS' `===` and `!==` and recover 😇 let sp = op.span.to(self.token.span); let sugg = match op.node { AssocOp::Equal => "==", AssocOp::NotEqual => "!=", _ => unreachable!(), }; self.struct_span_err(sp, &format!("invalid comparison operator `{}=`", sugg)) .span_suggestion_short( sp, &format!("`{s}=` is not a valid comparison operator, use `{s}`", s = sugg), sugg.to_string(), Applicability::MachineApplicable, ) .emit(); self.bump(); } </ins> let op = op.node; // Special cases: if op == AssocOp::As {
<ins> error: invalid comparison operator `===` --> $DIR/js-style-comparison-op.rs:3:10 | LL |     if 1 === 1 { |          ^^^ help: `===` is not a valid comparison operator, use `==` error: invalid comparison operator `!==` --> $DIR/js-style-comparison-op.rs:5:17 | LL |     } else if 1 !== 1 { |                 ^^^ help: `!==` is not a valid comparison operator, use `!=` error: aborting due to 2 previous errors </ins>
self.variants.iter().flat_map(|v| v.fields.iter()) } <ins> /// Whether the ADT lacks fields. Note that this includes uninhabited enums, /// e.g., `enum Void {}` is considered payload free as well. </ins> pub fn is_payloadfree(&self) -> bool { <del> !self.variants.is_empty() && self.variants.iter().all(|v| v.fields.is_empty()) </del> <ins> self.variants.iter().all(|v| v.fields.is_empty()) </ins> } /// Return a `VariantDef` given a variant id.
// # First handle non-scalar source values. <del> // Handle cast from a univariant (ZST) enum. </del> <ins> // Handle cast from a ZST enum (0 or 1 variants). </ins> match src.layout.variants { Variants::Single { index } => { <ins> if src.layout.abi.is_uninhabited() { // This is dead code, because an uninhabited enum is UB to // instantiate. throw_ub!(Unreachable); } </ins> if let Some(discr) = src.layout.ty.discriminant_for_variant(*self.tcx, index) { assert!(src.layout.is_zst()); let discr_layout = self.layout_of(discr.ty)?;
<del> error[E0605]: non-primitive cast: `E` as `isize` --> $DIR/uninhabited-enum-cast.rs:4:20 | LL |     println!("{}", (e as isize).to_string()); |                    ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object error: aborting due to previous error For more information about this error, try `rustc --explain E0605`. </del>
use tracing::debug; macro_rules! gate_feature_fn { <ins> ($visitor: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $help: expr) => {{ let (visitor, has_feature, span, name, explain, help) = (&*$visitor, $has_feature, $span, $name, $explain, $help); let has_feature: bool = has_feature(visitor.features); debug!("gate_feature(feature = {:?}, span = {:?}); has? {}", name, span, has_feature); if !has_feature && !span.allows_unstable($name) { feature_err_issue(&visitor.sess.parse_sess, name, span, GateIssue::Language, explain) .help(help) .emit(); } }}; </ins> ($visitor: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr) => {{ let (visitor, has_feature, span, name, explain) = (&*$visitor, $has_feature, $span, $name, $explain);
} macro_rules! gate_feature_post { <ins> ($visitor: expr, $feature: ident, $span: expr, $explain: expr, $help: expr) => { gate_feature_fn!($visitor, |x: &Features| x.$feature, $span, sym::$feature, $explain, $help) }; </ins> ($visitor: expr, $feature: ident, $span: expr, $explain: expr) => { gate_feature_fn!($visitor, |x: &Features| x.$feature, $span, sym::$feature, $explain) };
let spans = sess.parse_sess.gated_spans.spans.borrow(); macro_rules! gate_all { <ins> ($gate:ident, $msg:literal, $help:literal) => { if let Some(spans) = spans.get(&sym::$gate) { for span in spans { gate_feature_post!(&visitor, $gate, *span, $msg, $help); } } }; </ins> ($gate:ident, $msg:literal) => { if let Some(spans) = spans.get(&sym::$gate) { for span in spans {
} gate_all!(if_let_guard, "`if let` guard is not implemented"); gate_all!(let_chains, "`let` expressions in this position are experimental"); <del> gate_all!(async_closure, "async closures are unstable"); </del> <ins> gate_all!( async_closure, "async closures are unstable", "to use an async block, remove the `||`: `async {`" ); </ins> gate_all!(generators, "yield syntax is experimental"); gate_all!(or_patterns, "or-patterns syntax is experimental"); gate_all!(raw_ref_op, "raw address of syntax is experimental");
} }; <ins> if let Async::Yes { span, .. } = asyncness { // Feature-gate `async ||` closures. self.sess.gated_spans.gate(sym::async_closure, span); } </ins> Ok(self.mk_expr( lo.to(body.span), ExprKind::Closure(capture_clause, asyncness, movability, decl, body, lo.to(decl_hi)),
LL |         let x = 0; |         ^^^ unexpected token <del> error[E0658]: async closures are unstable --> $DIR/block-no-opening-brace.rs:29:5 | LL |     async |     ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information = help: add `#![feature(async_closure)]` to the crate attributes to enable error: aborting due to 6 previous errors </del> <ins> error: aborting due to 5 previous errors </ins> <del> For more information about this error, try `rustc --explain E0658`. </del>
trace!("encoding {} further alloc ids", new_n - n); for idx in n..new_n { let id = self.interpret_allocs[idx]; <del> let pos = self.position() as u32; </del> <ins> let pos = self.position() as u64; </ins> interpret_alloc_index.push(pos); interpret::specialized_encode_alloc_id(self, tcx, id); }
traits: LazyArray<DefIndex>, impls: LazyArray<TraitImpls>, incoherent_impls: LazyArray<IncoherentImpls>, <del> interpret_alloc_index: LazyArray<u32>, </del> <ins> interpret_alloc_index: LazyArray<u64>, </ins> proc_macro_data: Option<ProcMacroData>, tables: LazyTables,
query_result_index: EncodedDepNodeIndex, side_effects_index: EncodedDepNodeIndex, // The location of all allocations. <del> interpret_alloc_index: Vec<u32>, </del> <ins> // Most uses only need values up to u32::MAX, but benchmarking indicates that we can use a u64 // without measurable overhead. This permits larger const allocations without ICEing. interpret_alloc_index: Vec<u64>, </ins> // See `OnDiskCache.syntax_contexts` syntax_contexts: FxHashMap<u32, AbsoluteBytePos>, // See `OnDiskCache.expn_data`
interpret_alloc_index.reserve(new_n - n); for idx in n..new_n { let id = encoder.interpret_allocs[idx]; <del> let pos: u32 = encoder.position().try_into().unwrap(); </del> <ins> let pos: u64 = encoder.position().try_into().unwrap(); </ins> interpret_alloc_index.push(pos); interpret::specialized_encode_alloc_id(&mut encoder, tcx, id); }
Expected type did not match the received type. <del> Erroneous code example: </del> <ins> Erroneous code examples: </ins> ```compile_fail,E0308 <del> let x: i32 = "I am not a number!"; //     ~~~   ~~~~~~~~~~~~~~~~~~~~ //      |             | //      |    initializing expression; //      |    compiler infers type `&str` //      | //    type `i32` assigned to variable `x` </del> <ins> fn plus_one(x: i32) -> i32 { x + 1 } plus_one("Not a number"); //       ^^^^^^^^^^^^^^ expected `i32`, found `&str` if "Not a bool" { // ^^^^^^^^^^^^ expected `bool`, found `&str` } let x: f32 = "Not a float"; //     ---   ^^^^^^^^^^^^^ expected `f32`, found `&str` //     | //     expected due to this </ins> ``` <del> This error occurs when the compiler is unable to infer the concrete type of a variable. It can occur in several cases, the most common being a mismatch between two types: the type the author explicitly assigned, and the type the compiler inferred. </del> <ins> This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. </ins>
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type. <del> Erroneous code example: </del> <ins> Erroneous code examples: </ins> ```compile_fail,E0308 <del> let x: i32 = "I am not a number!"; //     ~~~   ~~~~~~~~~~~~~~~~~~~~ //      |             | //      |    initializing expression; //      |    compiler infers type `&str` //      | //    type `i32` assigned to variable `x` </del> <ins> fn plus_one(x: i32) -> i32 { x + 1 } plus_one("Not a number"); //       ^^^^^^^^^^^^^^ expected `i32`, found `&str` if "Not a bool" { // ^^^^^^^^^^^^ expected `bool`, found `&str` } let x: f32 = "Not a float"; //     ---   ^^^^^^^^^^^^^ expected `f32`, found `&str` //     | //     expected due to this </ins> ``` <del> This error occurs when the compiler is unable to infer the concrete type of a variable. It can occur in several cases, the most common being a mismatch between two types: the type the author explicitly assigned, and the type the compiler inferred. </del> <ins> This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. </ins> "},"level":"error","spans":[{"file_name":"$DIR/flag-json.rs","byte_start":244,"byte_end":246,"line_start":7,"line_end":7,"column_start":17,"column_end":19,"is_primary":true,"text":[{"text":"    let _: () = 42;","highlight_start":17,"highlight_end":19}],"label":"expected `()`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/flag-json.rs","byte_start":239,"byte_end":241,"line_start":7,"line_end":7,"column_start":12,"column_end":14,"is_primary":false,"text":[{"text":"    let _: () = 42;","highlight_start":12,"highlight_end":14}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types --> $DIR/flag-json.rs:7:17 |
self.to_bits().to_ne_bytes() } <del> /// Return the memory representation of this floating point number as a byte array in /// native byte order. /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// /// [`to_ne_bytes`]: f32::to_ne_bytes /// /// # Examples /// /// ``` /// #![feature(num_as_ne_bytes)] /// let num = 12.5f32; /// let bytes = num.as_ne_bytes(); /// assert_eq!( ///     bytes, ///     if cfg!(target_endian = "big") { ///         &[0x41, 0x48, 0x00, 0x00] ///     } else { ///         &[0x00, 0x00, 0x48, 0x41] ///     } /// ); /// ``` #[unstable(feature = "num_as_ne_bytes", issue = "76976")] #[inline] pub fn as_ne_bytes(&self) -> &[u8; 4] { // SAFETY: `f32` is a plain old datatype so we can always transmute to it unsafe { &*(self as *const Self as *const _) } } </del> /// Create a floating point value from its representation as a byte array in big endian. /// /// # Examples
self.to_bits().to_ne_bytes() } <del> /// Return the memory representation of this floating point number as a byte array in /// native byte order. /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// /// [`to_ne_bytes`]: f64::to_ne_bytes /// /// # Examples /// /// ``` /// #![feature(num_as_ne_bytes)] /// let num = 12.5f64; /// let bytes = num.as_ne_bytes(); /// assert_eq!( ///     bytes, ///     if cfg!(target_endian = "big") { ///         &[0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] ///     } else { ///         &[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40] ///     } /// ); /// ``` #[unstable(feature = "num_as_ne_bytes", issue = "76976")] #[inline] pub fn as_ne_bytes(&self) -> &[u8; 8] { // SAFETY: `f64` is a plain old datatype so we can always transmute to it unsafe { &*(self as *const Self as *const _) } } </del> /// Create a floating point value from its representation as a byte array in big endian. /// /// # Examples
unsafe { mem::transmute(self) } } <del> /// Return the memory representation of this integer as a byte array in /// native byte order. /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// /// [`to_ne_bytes`]: Self::to_ne_bytes /// /// # Examples /// /// ``` /// #![feature(num_as_ne_bytes)] #[doc = concat!("let num = ", $swap_op, stringify!($SelfT), ";")] /// let bytes = num.as_ne_bytes(); /// assert_eq!( ///     bytes, ///     if cfg!(target_endian = "big") { #[doc = concat!("        &", $be_bytes)] ///     } else { #[doc = concat!("        &", $le_bytes)] ///     } /// ); /// ``` #[unstable(feature = "num_as_ne_bytes", issue = "76976")] #[inline] pub fn as_ne_bytes(&self) -> &[u8; mem::size_of::<Self>()] { // SAFETY: integers are plain old datatypes so we can always transmute them to // arrays of bytes unsafe { &*(self as *const Self as *const _) } } </del> /// Create an integer value from its representation as a byte array in /// big endian. ///
unsafe { mem::transmute(self) } } <del> /// Return the memory representation of this integer as a byte array in /// native byte order. /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// /// [`to_ne_bytes`]: Self::to_ne_bytes /// /// # Examples /// /// ``` /// #![feature(num_as_ne_bytes)] #[doc = concat!("let num = ", $swap_op, stringify!($SelfT), ";")] /// let bytes = num.as_ne_bytes(); /// assert_eq!( ///     bytes, ///     if cfg!(target_endian = "big") { #[doc = concat!("        &", $be_bytes)] ///     } else { #[doc = concat!("        &", $le_bytes)] ///     } /// ); /// ``` #[unstable(feature = "num_as_ne_bytes", issue = "76976")] #[inline] pub fn as_ne_bytes(&self) -> &[u8; mem::size_of::<Self>()] { // SAFETY: integers are plain old datatypes so we can always transmute them to // arrays of bytes unsafe { &*(self as *const Self as *const _) } } </del> /// Create a native endian integer value from its representation /// as a byte array in big endian. ///
<ins> error[E0004]: non-exhaustive patterns: type `&A` is non-empty --> $DIR/issue-78123-non-exhaustive-reference.rs:5:11 | LL | enum A {} | --------- `A` defined here ... LL |     match a {} |           ^ | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `&A` = note: references are always considered inhabited error: aborting due to previous error For more information about this error, try `rustc --explain E0004`. </ins>
// The type table might not have information for this expression // if it is in a malformed scope. (#66387) if let Some(ty) = self.fcx.typeck_results.borrow().expr_ty_opt(expr) { <ins> if guard_borrowing_from_pattern { // Match guards create references to all the bindings in the pattern that are used // in the guard, e.g. `y if is_even(y) => ...` becomes `is_even(*r_y)` where `r_y` // is a reference to `y`, so we must record a reference to the type of the binding. let tcx = self.fcx.tcx; let ref_ty = tcx.mk_ref( // Use `ReErased` as `resolve_interior` is going to replace all the regions anyway. tcx.mk_region(ty::RegionKind::ReErased), ty::TypeAndMut { ty, mutbl: hir::Mutability::Not }, ); self.record(ref_ty, scope, Some(expr), expr.span, guard_borrowing_from_pattern); } </ins> self.record(ty, scope, Some(expr), expr.span, guard_borrowing_from_pattern); } else { self.fcx.tcx.sess.delay_span_bug(expr.span, "no type for node");
} } <ins> // #78366: check the reference to the binding is recorded even if the binding is not autorefed async fn h(x: usize) { match x { y if foo().await[y] => (), _ => (), } } async fn i(x: u8) { match x { y if f().await == y + 1 => (), _ => (), } } </ins> fn main() { let _ = g(10); <ins> let _ = h(9); let _ = i(8); </ins> }
.with_indent_lines(true) .with_ansi(true) .with_targets(true) <del> .with_thread_ids(true) .with_thread_names(true) </del> .with_wraparound(10) .with_verbose_exit(true) .with_verbose_entry(true) .with_indent_amount(2); <ins> #[cfg(parallel_compiler)] let layer = layer.with_thread_ids(true).with_thread_names(true); </ins> use tracing_subscriber::layer::SubscriberExt; let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);
Target::Field | Target::Arm | Target::MacroDef => { self.inline_attr_str_error_with_macro_def(hir_id, attr, "no_mangle"); } <ins> // FIXME: #[no_mangle] was previously allowed on non-functions/statics, this should be an error // The error should specify that the item that is wrong is specifically a *foreign* fn/static // otherwise the error seems odd Target::ForeignFn | Target::ForeignStatic => { let foreign_item_kind = match target { Target::ForeignFn => "function", Target::ForeignStatic => "static", _ => unreachable!(), }; self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| { lint.build(&format!( "`#[no_mangle]` has no effect on a foreign {}", foreign_item_kind )) .warn( "this was previously accepted by the compiler but is  being phased out; it will become a hard error in  a future release!", ) .span_label(*span, format!("foreign {}", foreign_item_kind)) .note("symbol names in extern blocks are not mangled") .span_suggestion( attr.span, "remove this attribute", String::new(), Applicability::MachineApplicable, ) .emit(); }); } </ins> _ => { // FIXME: #[no_mangle] was previously allowed on non-functions/statics and some // crates used this, so only emit a warning.
<ins> #![warn(unused_attributes)] // Tests that placing the #[no_mangle] attribute on a foreign fn or static emits // a specialized warning. // The previous warning only talks about a "function or static" but foreign fns/statics // are also not allowed to have #[no_mangle] // build-pass extern "C" { #[no_mangle] //~^ WARNING `#[no_mangle]` has no effect on a foreign static //~^^ WARNING this was previously accepted by the compiler pub static FOO: u8; #[no_mangle] //~^ WARNING `#[no_mangle]` has no effect on a foreign function //~^^ WARNING this was previously accepted by the compiler pub fn bar(); } fn no_new_warn() { // Should emit the generic "not a function or static" warning #[no_mangle] //~^ WARNING attribute should be applied to a free function, impl method or static //~^^ WARNING this was previously accepted by the compiler let x = 0_u8; } fn main() {} </ins>
<ins> warning: attribute should be applied to a free function, impl method or static --> $DIR/extern-no-mangle.rs:24:5 | LL |     #[no_mangle] |     ^^^^^^^^^^^^ ... LL |     let x = 0_u8; |     ------------- not a free function, impl method or static | note: the lint level is defined here --> $DIR/extern-no-mangle.rs:1:9 | LL | #![warn(unused_attributes)] |         ^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` has no effect on a foreign static --> $DIR/extern-no-mangle.rs:11:5 | LL |     #[no_mangle] |     ^^^^^^^^^^^^ help: remove this attribute ... LL |     pub static FOO: u8; |     ------------------- foreign static | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: symbol names in extern blocks are not mangled warning: `#[no_mangle]` has no effect on a foreign function --> $DIR/extern-no-mangle.rs:16:5 | LL |     #[no_mangle] |     ^^^^^^^^^^^^ help: remove this attribute ... LL |     pub fn bar(); |     ------------- foreign function | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: symbol names in extern blocks are not mangled warning: 3 warnings emitted </ins>
// ignore-debug: the debug assertions get in the way // compile-flags: -O -Z merge-functions=disabled <ins> // min-llvm-version: 16 </ins> #![crate_type = "lib"] // Ensure that trivial casts of vec elements are O(1) pub struct Wrapper<T>(T); <ins> // previously repr(C) caused the optimization to fail </ins> #[repr(C)] pub struct Foo { a: u64,
d: u64, } <del> // Going from an aggregate struct to another type currently requires Copy to // enable the TrustedRandomAccess specialization. Without it optimizations do not yet // reliably recognize the loops as noop for repr(C) or non-Copy structs. </del> <ins> // implementing Copy exercises the TrustedRandomAccess specialization inside the in-place // specialization </ins> #[derive(Copy, Clone)] pub struct Bar { a: u64,
// CHECK-LABEL: @vec_iterator_cast_aggregate #[no_mangle] pub fn vec_iterator_cast_aggregate(vec: Vec<[u64; 4]>) -> Vec<Foo> { <del> // FIXME These checks should be the same as other functions. // CHECK-NOT: @__rust_alloc // CHECK-NOT: @__rust_alloc </del> <ins> // CHECK-NOT: loop // CHECK-NOT: call </ins> vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect() } <del> // CHECK-LABEL: @vec_iterator_cast_deaggregate </del> <ins> // CHECK-LABEL: @vec_iterator_cast_deaggregate_tra </ins> #[no_mangle] <del> pub fn vec_iterator_cast_deaggregate(vec: Vec<Bar>) -> Vec<[u64; 4]> { // FIXME These checks should be the same as other functions. // CHECK-NOT: @__rust_alloc // CHECK-NOT: @__rust_alloc </del> <ins> pub fn vec_iterator_cast_deaggregate_tra(vec: Vec<Bar>) -> Vec<[u64; 4]> { // CHECK-NOT: loop // CHECK-NOT: call // Safety: For the purpose of this test we assume that Bar layout matches [u64; 4]. // This currently is not guaranteed for repr(Rust) types, but it happens to work here and // the UCG may add additional guarantees for homogenous types in the future that would make this // correct. vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect() } // CHECK-LABEL: @vec_iterator_cast_deaggregate_fold #[no_mangle] pub fn vec_iterator_cast_deaggregate_fold(vec: Vec<Baz>) -> Vec<[u64; 4]> { // CHECK-NOT: loop // CHECK-NOT: call </ins> // Safety: For the purpose of this test we assume that Bar layout matches [u64; 4]. // This currently is not guaranteed for repr(Rust) types, but it happens to work here and
ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(), ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(), ty::Array(t, n) => { <ins> if t.is_simple_ty() { return format!("array `{}`", self).into(); } </ins> let n = tcx.lift(n).unwrap(); <del> match n.try_eval_usize(tcx, ty::ParamEnv::empty()) { _ if t.is_simple_ty() => format!("array `{}`", self).into(), Some(n) => format!("array of {} element{}", n, pluralize!(n)).into(), None => "array".into(), </del> <ins> if let ty::ConstKind::Value(v) = n.val { if let Some(n) = v.try_to_machine_usize(tcx) { return format!("array of {} element{}", n, pluralize!(n)).into(); } </ins> } <ins> "array".into() </ins> } ty::Slice(ty) if ty.is_simple_ty() => format!("slice `{}`", self).into(), ty::Slice(_) => "slice".into(),
tcx: TyCtxt<'tcx>, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>, ) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> { <del> // see comment in const_eval_raw_provider for what we're doing here </del> <ins> // see comment in eval_to_allocation_raw_provider for what we're doing here </ins> if key.param_env.reveal() == Reveal::All { let mut key = key; key.param_env = key.param_env.with_user_facing();
<ins> #![feature(const_generics, const_evaluatable_checked)] #![allow(incomplete_features)] // This test is a minimized reproduction for #79518 where // during error handling for the type mismatch we would try // to evaluate std::mem::size_of::<Self::Assoc> causing an ICE trait Foo { type Assoc: PartialEq; const AssocInstance: Self::Assoc; fn foo() where [(); std::mem::size_of::<Self::Assoc>()]: , { Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()]; //~^ Error: mismatched types } } fn main() {} </ins>