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

Document attributes cfg family #7962

Closed
pnkfelix opened this issue Jul 22, 2013 · 2 comments
Closed

Document attributes cfg family #7962

pnkfelix opened this issue Jul 22, 2013 · 2 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@pnkfelix
Copy link
Member

Sub-bug of #6444.

  • cfg
    • cfg(debug)
    • cfg(target_arch)
    • cfg(target_endian)
    • cfg(target_family)
    • cfg(target_libc)
    • cfg(target_os): src/librustc/driver/driver.rs
      • "win32","macos","linux","android","freebsd"
    • cfg(target_word_size)
    • cfg(test)
@sanxiyn
Copy link
Member

sanxiyn commented Oct 14, 2013

Triaging. We have ndebug instead of debug now, and I couldn't find any evidence of target_libc support. Tagging A-docs.

@alexcrichton
Copy link
Member

Assigning as E-easy and E-mentor (I'll mentor this).

tbu- added a commit to tbu-/rust that referenced this issue Feb 13, 2014
This documents in-source conditions using #[cfg(...)] and configurations
pre-defined by the compiler.

Fix rust-lang#7962.
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 6, 2022
…ems, r=llogiq

Fix and improve `match_type_on_diagnostic_item`

This extracts the fix for the lint out of rust-lang#7647. There's still a couple of other functions to check, but at least this will get lint working again.

The two added util functions (`is_diagnostic_item` and `is_lang_item`) are needed to handle `DefId` for unit and tuple struct/variant constructors. The `rustc_diagnostic_item` and `lang` attributes are attached to the struct/variant `DefId`, but most of the time they are used through their constructors which have a different `DefId`. The two utility functions will check if the `DefId` is for a constructor and switch to the associated struct/variant `DefId`.

There does seem to be a bug on rustc's side where constructor `DefId`s from external crates seem to be returning `DefKind::Variant` instead of `DefKind::Ctor()`. There's a workaround put in right.

changelog: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants