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

More explicit diagnostic when using a `vec![]` in a pattern #63399

Merged
merged 2 commits into from Aug 10, 2019

Conversation

@estebank
Copy link
Contributor

commented Aug 9, 2019

error: unexpected `(` after qualified path
  --> $DIR/vec-macro-in-pattern.rs:3:14
   |
LL |         Some(vec![x]) => (),
   |              ^^^^^^^
   |              |
   |              unexpected `(` after qualified path
   |              in this macro invocation
   |              use a slice pattern here instead
   |
   = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Fix #61933.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 9, 2019

r? @eddyb

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

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2019

@rust-highfive rust-highfive assigned oli-obk and unassigned eddyb Aug 9, 2019

src/libsyntax/ext/tt/macro_rules.rs Outdated Show resolved Hide resolved
src/libsyntax/ext/tt/macro_rules.rs Outdated Show resolved Hide resolved

@Centril Centril self-assigned this Aug 9, 2019

More explicit diagnostic when using a `vec![]` in a pattern
```
error: unexpected `(` after qualified path
  --> $DIR/vec-macro-in-pattern.rs:3:14
   |
LL |         Some(vec![x]) => (),
   |              ^^^^^^^
   |              |
   |              unexpected `(` after qualified path
   |              in this macro invocation
   |              use a slice pattern here instead
   |
   = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
```
@Centril

This comment has been minimized.

Copy link
Member

commented Aug 9, 2019

r=me if you want with issue filed + refactoring :)

@estebank estebank force-pushed the estebank:vec-in-pat branch from 9f1c317 to 75c5ad2 Aug 9, 2019

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2019

@bors r=Centril

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

📌 Commit 75c5ad2 has been approved by Centril

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2019

Centril added a commit to Centril/rust that referenced this pull request Aug 9, 2019
Rollup merge of rust-lang#63399 - estebank:vec-in-pat, r=Centril
More explicit diagnostic when using a `vec![]` in a pattern

```
error: unexpected `(` after qualified path
  --> $DIR/vec-macro-in-pattern.rs:3:14
   |
LL |         Some(vec![x]) => (),
   |              ^^^^^^^
   |              |
   |              unexpected `(` after qualified path
   |              in this macro invocation
   |              use a slice pattern here instead
   |
   = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
```

Fix rust-lang#61933.
@Centril Centril referenced this pull request Aug 9, 2019
bors added a commit that referenced this pull request Aug 9, 2019
Auto merge of #63424 - Centril:rollup-2k5gn6b, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #62756 (Stabilize duration_float)
 - #62860 (Stabilize checked_duration_since for 1.38.0)
 - #63337 (Tweak mismatched types error)
 - #63350 (Use associated_type_bounds where applicable - closes #61738)
 - #63352 (Sort the fat LTO modules to produce deterministic output.)
 - #63394 (Add test for issue 36804)
 - #63399 (More explicit diagnostic when using a `vec![]` in a pattern)
 - #63419 (check against more collisions for TypeId of fn pointer)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Aug 10, 2019
Rollup merge of rust-lang#63399 - estebank:vec-in-pat, r=Centril
More explicit diagnostic when using a `vec![]` in a pattern

```
error: unexpected `(` after qualified path
  --> $DIR/vec-macro-in-pattern.rs:3:14
   |
LL |         Some(vec![x]) => (),
   |              ^^^^^^^
   |              |
   |              unexpected `(` after qualified path
   |              in this macro invocation
   |              use a slice pattern here instead
   |
   = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
```

Fix rust-lang#61933.
bors added a commit that referenced this pull request Aug 10, 2019
Auto merge of #63427 - Centril:rollup-6db5f5g, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #63056 (Give built-in macros stable addresses in the standard library)
 - #63149 (resolve: Populate external modules in more automatic and lazy way)
 - #63337 (Tweak mismatched types error)
 - #63350 (Use associated_type_bounds where applicable - closes #61738)
 - #63394 (Add test for issue 36804)
 - #63399 (More explicit diagnostic when using a `vec![]` in a pattern)
 - #63419 (check against more collisions for TypeId of fn pointer)
 - #63423 (Mention that tuple structs are private if any of their fields are)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Aug 10, 2019
Rollup merge of rust-lang#63399 - estebank:vec-in-pat, r=Centril
More explicit diagnostic when using a `vec![]` in a pattern

```
error: unexpected `(` after qualified path
  --> $DIR/vec-macro-in-pattern.rs:3:14
   |
LL |         Some(vec![x]) => (),
   |              ^^^^^^^
   |              |
   |              unexpected `(` after qualified path
   |              in this macro invocation
   |              use a slice pattern here instead
   |
   = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
```

Fix rust-lang#61933.
bors added a commit that referenced this pull request Aug 10, 2019
Auto merge of #63428 - Centril:rollup-c2ru1z1, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #63056 (Give built-in macros stable addresses in the standard library)
 - #63337 (Tweak mismatched types error)
 - #63350 (Use associated_type_bounds where applicable - closes #61738)
 - #63394 (Add test for issue 36804)
 - #63399 (More explicit diagnostic when using a `vec![]` in a pattern)
 - #63419 (check against more collisions for TypeId of fn pointer)
 - #63423 (Mention that tuple structs are private if any of their fields are)

Failed merges:

r? @ghost

@bors bors merged commit 75c5ad2 into rust-lang:master Aug 10, 2019

4 checks passed

pr Build #20190809.32 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.