Skip to content

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Oct 25, 2020

No description provided.

@rust-highfive
Copy link
Contributor

r? @kennytm

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2020
@taiki-e taiki-e force-pushed the question-in-macros branch from 5381c60 to 04c0018 Compare October 25, 2020 22:15
@camelid
Copy link
Member

camelid commented Oct 26, 2020

(Note that this appears to be specifically using ? to allow optional trailing commas.)

@camelid camelid added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Oct 26, 2020
@jyn514 jyn514 changed the title Use ? in core/std macros Allow trailing commas in core/std macros Oct 26, 2020
@taiki-e
Copy link
Member Author

taiki-e commented Oct 26, 2020

@camelid This PR does not change any behavior, trailing commas are allowed in core/std macros since #48056.

@taiki-e taiki-e changed the title Allow trailing commas in core/std macros Use ? in core/std macros Oct 26, 2020
@@ -6,15 +6,12 @@ macro_rules! panic {
() => (
$crate::panic!("explicit panic")
);
($msg:literal) => (
($msg:literal $(,)?) => (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no ($msg:literal,) => ($panic!($msg)) in the previous code, but this seems previously covered by ($msg:expr,) => ($panic!($msg)).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's what confused me then.

@kennytm
Copy link
Member

kennytm commented Oct 26, 2020

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 26, 2020

📌 Commit 04c0018 has been approved by kennytm

@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 Oct 26, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 27, 2020
Rollup of 16 pull requests

Successful merges:

 - rust-lang#76635 (Add [T]::as_chunks(_mut))
 - rust-lang#77703 (add system-llvm-libunwind config option)
 - rust-lang#78219 (Prefer to use `print_def_path`)
 - rust-lang#78298 (Add test for bad NLL higher-ranked subtype)
 - rust-lang#78332 (Update description for error E0308)
 - rust-lang#78342 (Use check-pass in single-use-lifetime ui tests)
 - rust-lang#78347 (Add lexicographical comparison doc)
 - rust-lang#78348 (Make some functions private that don't have to be public)
 - rust-lang#78349 (Use its own `TypeckResults` to avoid ICE)
 - rust-lang#78375 (Use ? in core/std macros)
 - rust-lang#78377 (Fix typo in debug statement)
 - rust-lang#78388 (Add some regression tests)
 - rust-lang#78394 (fix(docs): typo in BufWriter documentation)
 - rust-lang#78396 (Add compiler support for LLVM's x86_64 ERMSB feature)
 - rust-lang#78405 (Fix typo in lint description)
 - rust-lang#78412 (Improve formatting of hash collections docs)

Failed merges:

r? `@ghost`
@bors bors merged commit 5a33fa5 into rust-lang:master Oct 27, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 27, 2020
@taiki-e taiki-e deleted the question-in-macros branch October 27, 2020 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants