bytecodealliance / bytecodealliance/rustix

Better factoring for flags code

Open
#513 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
294
Avg merge
4h 7m
Merged PRs (30d)
2

Description

Rustix has this pattern where it defines flags types in both src/backend/linux_raw/\*/types.rs and src/backend/libc/\*/types.rs and then publicly exports those types from src/\*/\*.rs. This leads to a fair amount of duplication.

In many cases, espeically for flags corresponding to Linux-specific features, it would work to just define the public type in src/\*/\*.rs using the values of `c::*` constants which we could arrange to be defined by both backends, and it'd have less overall duplication.

It'd be nice to factor out the flags values in this way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.