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

Macro hygiene regression #34028

Closed
sfackler opened this issue Jun 2, 2016 · 1 comment · Fixed by #34031
Closed

Macro hygiene regression #34028

sfackler opened this issue Jun 2, 2016 · 1 comment · Fixed by #34031
Labels
regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.

Comments

@sfackler
Copy link
Member

sfackler commented Jun 2, 2016

rust-security-framework no longer compiles on nightly due to what I think is a regression in macro hygiene:

src/os/macos/secure_transport.rs:95:13: 101:14 error: method `set_allow_server_identity_change` is not a member of trait `SslContextExt` [E0407]
src/os/macos/secure_transport.rs:95             fn $set(&mut self, value: bool) -> Result<()> {
                                                ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:95:13: 101:14 help: run `rustc --explain E0407` to see a detailed explanation
src/os/macos/secure_transport.rs:167:57: 167:58 error: unresolved name `kSSLSessionOptionAllowServerIdentityChange` [E0425]
src/os/macos/secure_transport.rs:167         const kSSLSessionOptionAllowServerIdentityChange: allow_server_identity_change & set_allow_server_identity_change,
                                                                                             ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:167:57: 167:58 help: run `rustc --explain E0425` to see a detailed explanation
src/os/macos/secure_transport.rs:104:13: 108:14 error: method `allow_server_identity_change` is not a member of trait `SslContextExt` [E0407]
src/os/macos/secure_transport.rs:104             fn $get(&self) -> Result<bool> {
                                                 ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:104:13: 108:14 help: run `rustc --explain E0407` to see a detailed explanation
src/os/macos/secure_transport.rs:167:57: 167:58 error: unresolved name `kSSLSessionOptionAllowServerIdentityChange` [E0425]
src/os/macos/secure_transport.rs:167         const kSSLSessionOptionAllowServerIdentityChange: allow_server_identity_change & set_allow_server_identity_change,
                                                                                             ^
src/os/macos/secure_transport.rs:106:26: 106:92 note: in this expansion of try! (defined in <std macros>)
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:167:57: 167:58 help: run `rustc --explain E0425` to see a detailed explanation
src/os/macos/secure_transport.rs:95:13: 101:14 error: method `set_fallback` is not a member of trait `SslContextExt` [E0407]
src/os/macos/secure_transport.rs:95             fn $set(&mut self, value: bool) -> Result<()> {
                                                ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:95:13: 101:14 help: run `rustc --explain E0407` to see a detailed explanation
src/os/macos/secure_transport.rs:169:40: 169:41 error: unresolved name `kSSLSessionOptionFallback` [E0425]
src/os/macos/secure_transport.rs:169         const kSSLSessionOptionFallback: fallback & set_fallback,
                                                                            ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:169:40: 169:41 help: run `rustc --explain E0425` to see a detailed explanation
src/os/macos/secure_transport.rs:104:13: 108:14 error: method `fallback` is not a member of trait `SslContextExt` [E0407]
src/os/macos/secure_transport.rs:104             fn $get(&self) -> Result<bool> {
                                                 ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:104:13: 108:14 help: run `rustc --explain E0407` to see a detailed explanation
src/os/macos/secure_transport.rs:169:40: 169:41 error: unresolved name `kSSLSessionOptionFallback` [E0425]
src/os/macos/secure_transport.rs:169         const kSSLSessionOptionFallback: fallback & set_fallback,
                                                                            ^
src/os/macos/secure_transport.rs:106:26: 106:92 note: in this expansion of try! (defined in <std macros>)
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:169:40: 169:41 help: run `rustc --explain E0425` to see a detailed explanation
src/os/macos/secure_transport.rs:95:13: 101:14 error: method `set_break_on_client_hello` is not a member of trait `SslContextExt` [E0407]
src/os/macos/secure_transport.rs:95             fn $set(&mut self, value: bool) -> Result<()> {
                                                ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:95:13: 101:14 help: run `rustc --explain E0407` to see a detailed explanation
src/os/macos/secure_transport.rs:171:50: 171:51 error: unresolved name `kSSLSessionOptionBreakOnClientHello` [E0425]
src/os/macos/secure_transport.rs:171         const kSSLSessionOptionBreakOnClientHello: break_on_client_hello & set_break_on_client_hello,
                                                                                      ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:171:50: 171:51 help: run `rustc --explain E0425` to see a detailed explanation
src/os/macos/secure_transport.rs:104:13: 108:14 error: method `break_on_client_hello` is not a member of trait `SslContextExt` [E0407]
src/os/macos/secure_transport.rs:104             fn $get(&self) -> Result<bool> {
                                                 ^
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:104:13: 108:14 help: run `rustc --explain E0407` to see a detailed explanation
src/os/macos/secure_transport.rs:171:50: 171:51 error: unresolved name `kSSLSessionOptionBreakOnClientHello` [E0425]
src/os/macos/secure_transport.rs:171         const kSSLSessionOptionBreakOnClientHello: break_on_client_hello & set_break_on_client_hello,
                                                                                      ^
src/os/macos/secure_transport.rs:106:26: 106:92 note: in this expansion of try! (defined in <std macros>)
src/os/macos/secure_transport.rs:165:5: 172:6 note: in this expansion of impl_options! (defined in src/os/macos/secure_transport.rs)
src/os/macos/secure_transport.rs:171:50: 171:51 help: run `rustc --explain E0425` to see a detailed explanation
src/secure_transport.rs:654:49: 654:50 error: unresolved name `kSSLSessionOptionBreakOnClientAuth` [E0425]
src/secure_transport.rs:654         const kSSLSessionOptionBreakOnClientAuth: break_on_client_auth & set_break_on_client_auth,
                                                                            ^
src/secure_transport.rs:642:5: 667:6 note: in this expansion of impl_options! (defined in src/secure_transport.rs)
src/secure_transport.rs:654:49: 654:50 help: run `rustc --explain E0425` to see a detailed explanation
src/secure_transport.rs:654:49: 654:50 error: unresolved name `kSSLSessionOptionBreakOnClientAuth` [E0425]
src/secure_transport.rs:654         const kSSLSessionOptionBreakOnClientAuth: break_on_client_auth & set_break_on_client_auth,
                                                                            ^
src/secure_transport.rs:373:26: 373:83 note: in this expansion of try! (defined in <std macros>)
src/secure_transport.rs:642:5: 667:6 note: in this expansion of impl_options! (defined in src/secure_transport.rs)
src/secure_transport.rs:654:49: 654:50 help: run `rustc --explain E0425` to see a detailed explanation
src/secure_transport.rs:660:42: 660:43 error: unresolved name `kSSLSessionOptionFalseStart` [E0425]
src/secure_transport.rs:660         const kSSLSessionOptionFalseStart: false_start & set_false_start,
                                                                     ^
src/secure_transport.rs:642:5: 667:6 note: in this expansion of impl_options! (defined in src/secure_transport.rs)
src/secure_transport.rs:660:42: 660:43 help: run `rustc --explain E0425` to see a detailed explanation
src/secure_transport.rs:660:42: 660:43 error: unresolved name `kSSLSessionOptionFalseStart` [E0425]
src/secure_transport.rs:660         const kSSLSessionOptionFalseStart: false_start & set_false_start,
                                                                     ^
src/secure_transport.rs:373:26: 373:83 note: in this expansion of try! (defined in <std macros>)
src/secure_transport.rs:642:5: 667:6 note: in this expansion of impl_options! (defined in src/secure_transport.rs)
src/secure_transport.rs:660:42: 660:43 help: run `rustc --explain E0425` to see a detailed explanation
src/secure_transport.rs:666:49: 666:50 error: unresolved name `kSSLSessionOptionSendOneByteRecord` [E0425]
src/secure_transport.rs:666         const kSSLSessionOptionSendOneByteRecord: send_one_byte_record & set_send_one_byte_record,
                                                                            ^
src/secure_transport.rs:642:5: 667:6 note: in this expansion of impl_options! (defined in src/secure_transport.rs)
src/secure_transport.rs:666:49: 666:50 help: run `rustc --explain E0425` to see a detailed explanation
src/secure_transport.rs:666:49: 666:50 error: unresolved name `kSSLSessionOptionSendOneByteRecord` [E0425]
src/secure_transport.rs:666         const kSSLSessionOptionSendOneByteRecord: send_one_byte_record & set_send_one_byte_record,
                                                                            ^
src/secure_transport.rs:373:26: 373:83 note: in this expansion of try! (defined in <std macros>)
src/secure_transport.rs:642:5: 667:6 note: in this expansion of impl_options! (defined in src/secure_transport.rs)
src/secure_transport.rs:666:49: 666:50 help: run `rustc --explain E0425` to see a detailed explanation

Here we have methods on a trait that are defined by hand, but implemented by macro. The function names are not generated by the macro - they're passed in, so I would not expect any hygiene shenanigans to apply.

Possibly #32923?

cc @nrc @jseyfried

@sfackler sfackler added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Jun 2, 2016
@jseyfried
Copy link
Contributor

@sfackler Thanks for the report!
I fixed this in #34031 -- it was caused by #33706.

bors added a commit that referenced this issue Jun 4, 2016
Fix a regression in the configuration folder

This fixes #34028, a regression caused by #33706 in which unconfigured impl items generated by a macro in an impl item position are not removed.
r? @nrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants