Skip to content

Confirm that #![feature(trivial_bounds)] doesn't permit bypassing derive-emitted trait bounds #500

@joshlf

Description

@joshlf

In our UI tests for the following impl:

#[derive(FromZeroes)]
struct FromZeroes1 {
value: NotZerocopy,
}

...we get this error:

error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied
--> tests/ui-nightly/late_compile_pass.rs:23:10
|
23 | #[derive(FromZeroes)]
| ^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy`
|
= help: the following other types implement trait `FromZeroes`:
()
AU16
F32<O>
F64<O>
FromZeroes1
I128<O>
I16<O>
I32<O>
and $N others
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

...which contains this suggestion:

= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

We should confirm that the trivial_bounds feature would not allow to compile code which we intend not to compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions