Skip to content

Rustdoc could allow setting compilation flags for compiling, or just a no_link flag #12903

@huonw

Description

@huonw
Member

E.g. exhibiting #[no_std]; code normally requires passing extra flags to rustc (because we don't link to libc), so it would be good to be able to just parse, type-check and lint without linking, so that code snippets don't go completely out of date.

Maybe something like

```no_link
#[no_std];
#[start]
fn main(_argc: int, _argv: **u8) -> int { 0 }
```

Activity

alexcrichton

alexcrichton commented on Mar 15, 2014

@alexcrichton
Member

Perhaps no_run could imply --no-trans?

flaper87

flaper87 commented on Mar 15, 2014

@flaper87
Contributor

I think I prefer @huonw proposal. That will help keeping the code fence explicit.

added 2 commits that reference this issue on May 3, 2014
9ac9245
added a commit that references this issue on Aug 2, 2022
added a commit that references this issue on Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @flaper87@alexcrichton@huonw

        Issue actions

          Rustdoc could allow setting compilation flags for compiling, or just a no_link flag · Issue #12903 · rust-lang/rust