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

support issue = "none" in unstable attributes #66299

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

rossmacarthur
Copy link
Contributor

This works towards fixing #41260.

This PR allows the use of issue = "none" in unstable attributes and makes changes to internally store the issue number as an Option<NonZeroU32>. For example:

#[unstable(feature = "unstable_test_feature", issue = "none")]
fn unstable_issue_none() {}

It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional.

I could not remove the current uses of issue = "0" (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of "0" with "none" and no longer allow "0". This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated.

r? @varkor

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-11T17:11:13.0212284Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-11T17:11:13.0417256Z ##[command]git config gc.auto 0
2019-11-11T17:11:13.0496068Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-11T17:11:13.0560363Z ##[command]git config --get-all http.proxy
2019-11-11T17:11:13.0705152Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66299/merge:refs/remotes/pull/66299/merge
---
2019-11-11T17:17:58.2175658Z     Finished release [optimized] target(s) in 1m 23s
2019-11-11T17:17:58.2256507Z tidy check
2019-11-11T17:17:59.5934682Z * 588 error codes
2019-11-11T17:17:59.5934962Z * highest error code: E0743
2019-11-11T17:17:59.6288340Z tidy error: /checkout/src/libsyntax/feature_gate/active.rs:213: no tracking issue for feature test_2018_feature
2019-11-11T17:18:00.7868868Z Found 485 error codes
2019-11-11T17:18:00.7868952Z Found 0 error codes with no tests
2019-11-11T17:18:00.7869018Z Done!
2019-11-11T17:18:00.7869221Z some tidy checks failed
2019-11-11T17:18:00.7869221Z some tidy checks failed
2019-11-11T17:18:00.7869249Z 
2019-11-11T17:18:00.7869270Z 
2019-11-11T17:18:00.7870096Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-11-11T17:18:00.7870185Z 
2019-11-11T17:18:00.7870207Z 
2019-11-11T17:18:00.7880382Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-11-11T17:18:00.7880491Z Build completed unsuccessfully in 0:01:27
2019-11-11T17:18:00.7880491Z Build completed unsuccessfully in 0:01:27
2019-11-11T17:18:00.7936384Z == clock drift check ==
2019-11-11T17:18:00.7946476Z   local time: Mon Nov 11 17:18:00 UTC 2019
2019-11-11T17:18:00.8349496Z   network time: Mon, 11 Nov 2019 17:18:00 GMT
2019-11-11T17:18:00.8354009Z == end clock drift check ==
2019-11-11T17:18:02.3527728Z 
2019-11-11T17:18:02.3623705Z ##[error]Bash exited with code '1'.
2019-11-11T17:18:02.3655491Z ##[section]Starting: Checkout
2019-11-11T17:18:02.3656970Z ==============================================================================
2019-11-11T17:18:02.3657014Z Task         : Get sources
2019-11-11T17:18:02.3657069Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

- Use `Option<NonZeroU32>` to represent issue numbers.
@rossmacarthur rossmacarthur changed the title Support issue = "none" and use NonZeroU32 support issue = "none" in unstable attributes Nov 11, 2019
@Dylan-DPC-zz Dylan-DPC-zz added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 11, 2019
@varkor
Copy link
Member

varkor commented Nov 11, 2019

This looks good, thanks!

@bors r+

This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated.

We could use #[cfg(bootstrap)] to switch between issue = "0" and issue = "none" depending on whether we were bootstrapping or not, but that just creates a lot of churn pointlessly. Let's just replace them all as soon as this becomes the bootstrapping compiler.

@bors
Copy link
Contributor

bors commented Nov 11, 2019

📌 Commit 3ba8257 has been approved by varkor

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 11, 2019
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 12, 2019
…-0, r=varkor

support issue = "none" in unstable attributes

This works towards fixing rust-lang#41260.

This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example:

```rust
#[unstable(feature = "unstable_test_feature", issue = "none")]
fn unstable_issue_none() {}
```

It was not made optional because feedback seen here rust-lang#60860 suggested that people might forget the issue field if it was optional.

I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated.

r? @varkor
bors added a commit that referenced this pull request Nov 12, 2019
Rollup of 11 pull requests

Successful merges:

 - #65965 (Clean up librustc_typeck error_codes file)
 - #66230 (remove vestigial comments referring to defunct numeric trait hierarchy)
 - #66241 (bump openssl version)
 - #66257 (Drop long-section-names linker workaround for windows-gnu)
 - #66263 (make the error message more readable)
 - #66267 (Add rustdoc doc)
 - #66276 (Move lock into CodeStats)
 - #66278 (Fix error message about exported symbols from proc-macro crates)
 - #66280 (Fix HashSet::union performance)
 - #66299 (support issue = "none" in unstable attributes )
 - #66309 (Tiny cleanup to size assertions)

Failed merges:

r? @ghost
@bors bors merged commit 3ba8257 into rust-lang:master Nov 12, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2019
…-0-part-2, r=Centril

Require issue = "none" over issue = "0" in unstable attributes

These changes make the use of `issue = "none"` required in unstable attributes throughout the compiler.

Notes:
- rust-lang#66299 is now in beta so `issue = "none"` is accepted.
- The `tidy` tool now fails on `issue = "0"`.
- Tests that used `issue = "0"` were changed to use `issue = "none"`, except for _one_ that asserts `issue = "0"` can still be used.
- The compiler still allows `issue = "0"` because some submodules require it, this could be disallowed once these are updated.

Resolves rust-lang#41260

r? @varkor
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2019
…-0-part-2, r=Centril

Require issue = "none" over issue = "0" in unstable attributes

These changes make the use of `issue = "none"` required in unstable attributes throughout the compiler.

Notes:
- rust-lang#66299 is now in beta so `issue = "none"` is accepted.
- The `tidy` tool now fails on `issue = "0"`.
- Tests that used `issue = "0"` were changed to use `issue = "none"`, except for _one_ that asserts `issue = "0"` can still be used.
- The compiler still allows `issue = "0"` because some submodules require it, this could be disallowed once these are updated.

Resolves rust-lang#41260

r? @varkor
@rossmacarthur rossmacarthur deleted the fix-41260-avoid-issue-0 branch November 27, 2022 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants