Skip to content

Macro hygiene regression #34028

Closed
Closed
@sfackler

Description

@sfackler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions