Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: write_immediate_to_mplace: invalid ScalarPair layout: TyAndLayout with feature adt_const_params #126272

Closed
cushionbadak opened this issue Jun 11, 2024 · 3 comments · Fixed by #128714
Assignees
Labels
C-bug Category: This is a bug. F-adt_const_params `#![feature(adt_const_params)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cushionbadak
Copy link

Code

(hand-reduced)

#![feature(adt_const_params)]
#![allow(incomplete_features)]

use std::marker::ConstParamTy;

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Foo {
    value: i32,
    nested: &'static Bar<std::fmt::Debug>,
}

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Bar<T>(T);

struct Test<const F: Foo>;

fn main() {
    let x: Test<
        {
            Foo {
                value: 3,
                nested: &Bar(4),
            }
        },
    > = Test;
}

It seems that the above example may not be minimal, as it generates multiple errors.

(original)

trait A {
    type Type;
    const CONST: usize;
    fn foo(&self);
}

trait B {
    type ;
    const CONST: usize;
    fn foo(&self);
}

#[derive(Debug)]
struct S;

impl<T: std::fmt::Debug> A for T {
    type Type = ();
    const CONST: usize = 1; //~ NOTE candidate #1
    fn foo(&self) {} //~ NOTE candidate #1
}

impl<T: std::fmt::Debug> B for T {
    type Type = ();
    const CONST: usize = 2; //~ NOTE candidate #2
    fn foo(&self) {} //~ NOTE candidate #2
}

fn main() {
    let s = S;
    S::foo(&s); //~ ERROR multiple applicable items in scope
    //~^ NOTE multiple `foo` found
    //~| HELP use fully-qualified syntax to disambiguate
    S::CONST; //~ ERROR multiple applicable items in scope
    //~^ NOTE multiple `CONST` found
    //~| HELP use fully-qualified syntax to disambiguate
    let _: S::Type; //~ ERROR ambiguous associated type
    //~^ HELP use fully-qualified syntax
}


#![feature(adt_const_params)]
#![allow(incomplete_features)]

use std::marker::ConstParamTy;

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Foo {
    value: i32,
    nested: &'static Bar<std::fmt::Debug>,
}

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Bar<T>(T);

struct Test<const F: Foo>;

fn main() {
    let x: Test<{
        Foo {
            value: 3,
            nested: &Bar(4),
        }
    }> = Test;
    let y: Test<{
        Foo {
            value: 3,
            nested: &Bar(5),
        }
    }> = x; //~ ERROR mismatched types
}

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (b5b13568f 2024-06-10)
binary: rustc
commit-hash: b5b13568fb5da4ac988bde370008d6134d3dfe6c
commit-date: 2024-06-10
host: x86_64-apple-darwin
release: 1.81.0-nightly
LLVM version: 18.1.7

Error output

Command: rustc

warning: trait objects without an explicit `dyn` are deprecated
 --> r_write_imm_FF5A9D2D.rs:9:26
  |
9 |     nested: &'static Bar<std::fmt::Debug>,
  |                          ^^^^^^^^^^^^^^^
  |
  = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
  = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
  = note: `#[warn(bare_trait_objects)]` on by default
help: if this is an object-safe trait, use `dyn`
  |
9 |     nested: &'static Bar<dyn std::fmt::Debug>,
  |                          +++

error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
  --> r_write_imm_FF5A9D2D.rs:9:13
   |
9  |     nested: &'static Bar<std::fmt::Debug>,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
note: required by an implicit `Sized` bound in `Bar`
  --> r_write_imm_FF5A9D2D.rs:13:12
   |
13 | struct Bar<T>(T);
   |            ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
  --> r_write_imm_FF5A9D2D.rs:13:12
   |
13 | struct Bar<T>(T);
   |            ^  - ...if indirection were used here: `Box<T>`
   |            |
   |            this could be changed to `T: ?Sized`...

error[E0204]: the trait `ConstParamTy` cannot be implemented for this type
 --> r_write_imm_FF5A9D2D.rs:6:32
  |
6 | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
  |                                ^^^^^^^^^^^^
...
9 |     nested: &'static Bar<std::fmt::Debug>,
  |     ------------------------------------- this field does not implement `ConstParamTy`
  |
note: the `ConstParamTy` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): ConstParamTy`
 --> r_write_imm_FF5A9D2D.rs:9:13
  |
9 |     nested: &'static Bar<std::fmt::Debug>,
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the `ConstParamTy` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Eq`
 --> r_write_imm_FF5A9D2D.rs:9:13
  |
9 |     nested: &'static Bar<std::fmt::Debug>,
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the `ConstParamTy` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Sized`
 --> r_write_imm_FF5A9D2D.rs:9:13
  |
9 |     nested: &'static Bar<std::fmt::Debug>,
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error originates in the derive macro `ConstParamTy` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
  --> r_write_imm_FF5A9D2D.rs:9:5
   |
6  | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
   |          ----- in this derive macro expansion
...
9  |     nested: &'static Bar<std::fmt::Debug>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`, which is required by `&&'static Bar<(dyn Debug + 'static)>: Debug`
   = help: the trait `Debug` is implemented for `Bar<T>`
note: required for `Bar<(dyn Debug + 'static)>` to implement `Debug`
  --> r_write_imm_FF5A9D2D.rs:12:10
   |
12 | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
   |          ^^^^^
13 | struct Bar<T>(T);
   |            - unsatisfied trait bound introduced in this `derive` macro
   = note: 2 redundant requirements hidden
   = note: required for `&&'static Bar<(dyn Debug + 'static)>` to implement `Debug`
   = note: required for the cast from `&&&'static Bar<(dyn Debug + 'static)>` to `&dyn Debug`
   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `&Bar<dyn Debug>`
 --> r_write_imm_FF5A9D2D.rs:9:5
  |
6 | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
  |                 --------- in this derive macro expansion
...
9 |     nested: &'static Bar<std::fmt::Debug>,
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `dyn Debug: Eq` is not satisfied
   --> r_write_imm_FF5A9D2D.rs:9:5
    |
6   | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |                            -- in this derive macro expansion
...
9   |     nested: &'static Bar<std::fmt::Debug>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `dyn Debug`, which is required by `&'static Bar<dyn Debug>: Eq`
    |
    = help: the trait `Eq` is implemented for `Bar<T>`
note: required for `Bar<dyn Debug>` to implement `Eq`
   --> r_write_imm_FF5A9D2D.rs:12:28
    |
12  | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |                            ^^ unsatisfied trait bound introduced in this `derive` macro
    = note: 1 redundant requirement hidden
    = note: required for `&'static Bar<dyn Debug>` to implement `Eq`
note: required by a bound in `AssertParamIsEq`
   --> /Users/jb/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:360:31
    |
360 | pub struct AssertParamIsEq<T: Eq + ?Sized> {
    |                               ^^ required by this bound in `AssertParamIsEq`
    = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
  --> r_write_imm_FF5A9D2D.rs:9:5
   |
6  | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
   |                            -- in this derive macro expansion
...
9  |     nested: &'static Bar<std::fmt::Debug>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `dyn Debug`
note: required by an implicit `Sized` bound in `Bar`
  --> r_write_imm_FF5A9D2D.rs:13:12
   |
13 | struct Bar<T>(T);
   |            ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
  --> r_write_imm_FF5A9D2D.rs:13:12
   |
13 | struct Bar<T>(T);
   |            ^  - ...if indirection were used here: `Box<T>`
   |            |
   |            this could be changed to `T: ?Sized`...
   = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
Backtrace

error: internal compiler error: compiler/rustc_const_eval/src/interpret/place.rs:710:21: write_immediate_to_mplace: invalid ScalarPair layout: TyAndLayout {
                                    ty: &Bar<dyn Debug>,
                                    layout: Layout {
                                        size: Size(8 bytes),
                                        align: AbiAndPrefAlign {
                                            abi: Align(8 bytes),
                                            pref: Align(8 bytes),
                                        },
                                        abi: Scalar(
                                            Initialized {
                                                value: Pointer(
                                                    AddressSpace(
                                                        0,
                                                    ),
                                                ),
                                                valid_range: 1..=18446744073709551615,
                                            },
                                        ),
                                        fields: Primitive,
                                        largest_niche: Some(
                                            Niche {
                                                offset: Size(0 bytes),
                                                value: Pointer(
                                                    AddressSpace(
                                                        0,
                                                    ),
                                                ),
                                                valid_range: 1..=18446744073709551615,
                                            },
                                        ),
                                        variants: Single {
                                            index: 0,
                                        },
                                        max_repr_align: None,
                                        unadjusted_abi_align: Align(8 bytes),
                                    },
                                }
  --> r_write_imm_FF5A9D2D.rs:20:13
   |
20 | /             Foo {
21 | |                 value: 3,
22 | |                 nested: &Bar(4),
23 | |             }
   | |_____________^

thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/place.rs:710:21:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: <rustc_errors::DiagCtxt>::span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   7: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::write_immediate_to_mplace_no_validate
   8: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::write_immediate_no_validate::<rustc_const_eval::interpret::place::PlaceTy>
   9: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::copy_op_no_validate::<rustc_const_eval::interpret::operand::OpTy, rustc_const_eval::interpret::place::PlaceTy>
  10: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::statement
  11: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
  12: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  13: rustc_const_eval::const_eval::valtrees::eval_to_valtree
  14: <rustc_const_eval::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
      [... omitted 2 frames ...]
  15: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  16: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  17: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  18: <rustc_middle::ty::consts::Const>::eval
  19: rustc_trait_selection::traits::util::with_replaced_escaping_bound_vars::<rustc_middle::ty::consts::Const, rustc_middle::ty::consts::Const, <rustc_trait_selection::traits::normalize::AssocTypeNormalizer as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_const::{closure#0}>
  20: <rustc_middle::ty::generic_args::GenericArg as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::normalize::AssocTypeNormalizer>
  21: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::normalize::AssocTypeNormalizer>
  22: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::try_super_fold_with::<rustc_trait_selection::traits::normalize::AssocTypeNormalizer>
  23: <rustc_infer::infer::at::At as rustc_trait_selection::traits::normalize::NormalizeExt>::normalize::<rustc_middle::ty::Ty>
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::normalize::<rustc_middle::ty::Ty>
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt as rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::record_ty
  26: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty_common::{closure#0}
  27: <rustc_hir_typeck::gather_locals::GatherLocalsVisitor>::declare
  28: <rustc_hir_typeck::gather_locals::GatherLocalsVisitor as rustc_hir::intravisit::Visitor>::visit_local
  29: <rustc_hir_typeck::gather_locals::GatherLocalsVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  30: rustc_hir_typeck::check::check_fn
  31: rustc_hir_typeck::typeck
      [... omitted 1 frame ...]
  32: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}
  33: rustc_hir_analysis::check_crate
  34: rustc_interface::passes::run_required_analyses
  35: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  36: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#3}>
  37: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/Volumes/T7/workspace/240607_100chaos_tree_combine_typ/icefiles/rustc-ice-2024-06-11T12_18_18-3341.txt` to your bug report

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `main::{constant#0}`
#1 [eval_to_valtree] evaluating type-level constant
#2 [typeck] type-checking `main`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 7 previous errors; 1 warning emitted

Some errors have detailed explanations: E0204, E0277, E0369.
For more information about an error, try `rustc --explain E0204`.

Notes

@rustbot label +F-adt_const_params +requires-incomplete-features

@cushionbadak cushionbadak added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 11, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-adt_const_params `#![feature(adt_const_params)]` requires-incomplete-features labels Jun 11, 2024
@cushionbadak
Copy link
Author

searched nightlies: from nightly-2023-01-01 to nightly-2024-05-30
regressed nightly: nightly-2024-02-15
searched commit range: a84bb95...ee9c7c9
regressed commit: ee9c7c9

bisected with cargo-bisect-rustc v0.6.8

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2023-01-01 --end=2024-05-30 --regress=ice --script=rustc --preserve -- 126272.rs

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Jun 17, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 23, 2024
@camelid camelid self-assigned this Jul 19, 2024
@camelid
Copy link
Member

camelid commented Jul 19, 2024

Slight minimization:

#![feature(adt_const_params)]
#![allow(incomplete_features)]

use std::marker::ConstParamTy;

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Foo {
    nested: &'static Bar<dyn std::fmt::Debug>,
}

#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Bar<T>(T);

struct Test<const F: Foo>;

fn main() {
    let x: Test<{ Foo { nested: &Bar(4) } }> = Test;
}

@camelid
Copy link
Member

camelid commented Jul 24, 2024

It appears what's happening is that due to the implicit T: Sized bound on Bar<T>, rustc is expecting &Bar(4) to have a Scalar layout (i.e., thin pointer) since Bar should be sized. However, in fact &Bar(4) is coerced to &Bar<dyn std::fmt::Debug> by Foo.nested's type, so it has a ScalarPair layout (i.e., fat pointer) since Bar<dyn ...> is unsized. The fix for this is to have the const arg body's tainted by the typeck errors so it doesn't enter CTFE. This isn't happening because there are no errors emitted for anything in the const body itself, despite the ill-formed construction of Bar with an unsized field. From a UI perspective, this is probably ok since we don't want duplicate errors, but we need to taint the const arg body somehow.

Note that the error at the usage site is not reported in non-const code either:
struct Foo {
    nested: &'static Bar<dyn std::fmt::Debug>,
}

struct Bar<T>(T);

fn main() {
    let x = Foo { nested: &Bar(4) };
}
error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
 --> bar.rs:2:13
  |
2 |     nested: &'static Bar<dyn std::fmt::Debug>,
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
note: required by an implicit `Sized` bound in `Bar`
 --> bar.rs:5:12
  |
5 | struct Bar<T>(T);
  |            ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
 --> bar.rs:5:12
  |
5 | struct Bar<T>(T);
  |            ^  - ...if indirection were used here: `Box<T>`
  |            |
  |            this could be changed to `T: ?Sized`...

warning: unused variable: `x`
 --> bar.rs:8:9
  |
8 |     let x = Foo { nested: &Bar(4) };
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.

cc @oli-obk since this relates to typeck tainting
cc #124789

bors added a commit to rust-lang-ci/rust that referenced this issue Aug 6, 2024
WF-check struct field types at construction site

Fixes rust-lang#126272.
Fixes rust-lang#127299.

Rustc of course already WF-checked the field types at the definition
site, but for error tainting of consts to work properly, there needs to
be an error emitted at the use site. Previously, with no use-site error,
we proceeded with CTFE and ran into ICEs since we are running code with
type errors.

Emitting use-site errors also brings struct-like constructors more in
line with fn-like constructors since they already emit use-site errors
for WF issues.

r? `@BoxyUwU`
@bors bors closed this as completed in 19469cb Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-adt_const_params `#![feature(adt_const_params)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants