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

adt_const_params allows impls of ConstParamTy with non-ConstParamTy pointees #112124

Closed
BoxyUwU opened this issue May 31, 2023 · 1 comment · Fixed by #127722
Closed

adt_const_params allows impls of ConstParamTy with non-ConstParamTy pointees #112124

BoxyUwU opened this issue May 31, 2023 · 1 comment · Fixed by #127722
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-adt_const_params `#![feature(adt_const_params)]` T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented May 31, 2023

I tried this code:

#![feature(adt_const_params)]

use core::marker::ConstParamTy;

struct Foo;

impl ConstParamTy for &'static Foo {}

I expected to see this happen: it should error

Instead, this happened: it compilers

Meta

playground version:

Nightly channel

Build using the Nightly version: 1.72.0-nightly

(2023-05-29 498553fc04f6a3fdc534)
Backtrace

<backtrace>

@BoxyUwU BoxyUwU added C-bug Category: This is a bug. A-const-generics Area: const generics (parameters and arguments) F-adt_const_params `#![feature(adt_const_params)]` T-types Relevant to the types team, which will review and decide on the PR/issue. labels May 31, 2023
@BoxyUwU BoxyUwU self-assigned this May 31, 2023
@BoxyUwU
Copy link
Member Author

BoxyUwU commented May 31, 2023

Checks should also be added for tuple,array and slice element tys just to be safe imo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-adt_const_params `#![feature(adt_const_params)]` T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
1 participant