Skip to content

Replace rustc_layout_scalar_valid_range_start attribute with pattern types #135996

Description

@oli-obk

the rustc_layout_scalar_valid_range_start and rustc_layout_scalar_valid_range_end attributes require a lot of machinery to stay sanely usable. Pattern types don't require less machinery, but they are simpler as they don't break through layers of layouts and then require surprisingly subtle unsafe code to be used correctly.

So we're ripping out the attributes, and replace their usages in libcore and rustc:

  • std::ptr::NonNull
  • std::num::NonZero
  • rustc_index_macros::newtype::NewType
  • std::num::Nanoseconds

cc @Veykril @scottmcm

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions