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

Add support for naked functions #32410

Merged
merged 3 commits into from Mar 23, 2016

Conversation

Projects
None yet
5 participants
@ticki
Copy link
Contributor

ticki commented Mar 21, 2016

See rust-lang/rfcs#1201 (comment)

This PR adds #[naked] for marking naked functions.

@ticki

This comment has been minimized.

Copy link
Contributor

ticki commented Mar 21, 2016

The tests are stolen from @jackpot51's PR.

@durka

This comment has been minimized.

Copy link
Contributor

durka commented Mar 21, 2016

tidy failure

check: formatting
/home/travis/build/rust-lang/rust/src/test/codegen/naked-functions.rs:61: line longer than 100 chars
/home/travis/build/rust-lang/rust/src/libsyntax/feature_gate.rs:215: tab character

@ticki ticki force-pushed the ticki:master branch from f51aa1c to 4586232 Mar 22, 2016

@ticki

This comment has been minimized.

Copy link
Contributor

ticki commented Mar 22, 2016

Fixed.

@ticki ticki force-pushed the ticki:master branch from 4586232 to 1f6b05e Mar 22, 2016

@ticki

This comment has been minimized.

Copy link
Contributor

ticki commented Mar 22, 2016

r? @eddyb

@@ -376,6 +379,9 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat
// FIXME: #14406 these are processed in trans, which happens after the
// lint pass
("cold", Whitelisted, Ungated),
("naked", Whitelisted, Gated("naked_functions",
"the `#[naked]` attribute \
is an experimental feature")),

This comment has been minimized.

@eddyb

eddyb Mar 22, 2016

Member

Can you add a test that the feature gating works, i.e. you get an error by default?

This comment has been minimized.

@ticki

ticki Mar 22, 2016

Contributor

This is fixed now.


#[naked]
fn naked() {
//~^ the `#[naked]` attribute is an experimental feature

This comment has been minimized.

@eddyb

eddyb Mar 22, 2016

Member

This doesn't need ERROR?

This comment has been minimized.

@ticki

This comment has been minimized.

@eddyb

eddyb Mar 22, 2016

Member

Fair enough. Travis failure suggests it needs to be placed on the attribute, though.

@ticki ticki force-pushed the ticki:master branch from a7e834a to 4869417 Mar 22, 2016

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Mar 22, 2016

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 22, 2016

📌 Commit 4869417 has been approved by eddyb

@@ -212,6 +212,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status
// rust runtime internal
("unwind_attributes", "1.4.0", None, Active),

// allow the use of `#[naked]` on functions.
("naked_functions", "1.9.0", None, Active),

This comment has been minimized.

@durka

durka Mar 22, 2016

Contributor

I think this should be Some(32408)

@ticki

This comment has been minimized.

Copy link
Contributor

ticki commented Mar 22, 2016

When will this be merged?

@TimNN

This comment has been minimized.

Copy link
Contributor

TimNN commented Mar 22, 2016

@ticki You can see the queue of PRs to be tested & merged here: http://buildbot.rust-lang.org/homu/queue/rust

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Mar 22, 2016

@ticki you might want to fix the nit @durka mentioned, but other than that it's waiting in the queue that @TimNN linked.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 23, 2016

⌛️ Testing commit 4869417 with merge 26cfc26...

bors added a commit that referenced this pull request Mar 23, 2016

Auto merge of #32410 - Ticki:master, r=eddyb
Add support for naked functions

See rust-lang/rfcs#1201 (comment)

This PR adds `#[naked]` for marking naked functions.

@bors bors merged commit 4869417 into rust-lang:master Mar 23, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment