6

Add offset_of! macro (RFC 3308) by DrMeepster · Pull Request #106934 · rust-lang...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/106934
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Add offset_of! macro (RFC 3308) by DrMeepster · Pull Request #106934 · rust-lang/rust · GitHub

Contributor

Implements rust-lang/rfcs#3308 (tracking issue #106655) by adding the built in macro core::mem::offset_of. Two of the future possibilities are also implemented:

I wrote this a few months ago, before the RFC merged. Now that it's merged, I decided to rebase and finish it.

cc @thomcc (RFC author)

thomcc, est31, tgross35, Kobzol, and adriandelgado reacted with hooray emojiest31, wesleywiser, and rongcuid reacted with heart emojithomcc, the8472, and adriandelgado reacted with rocket emoji

Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

labels

Jan 16, 2023

Collaborator

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occured in rustc_ty_utils::consts.rs

cc @BoxyUwU

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK