{"id":28302613,"url":"https://github.com/taylordotfish/add-syntax","last_synced_at":"2025-06-14T00:31:14.883Z","repository":{"id":64974612,"uuid":"580222833","full_name":"taylordotfish/add-syntax","owner":"taylordotfish","description":"Attribute macros that prepend or append arbitrary syntax. Useful with `cfg_attr`.","archived":false,"fork":false,"pushed_at":"2022-12-26T03:41:24.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T05:39:09.877Z","etag":null,"topics":["attribute","conditional","macro","macros","rust","syntax","tokens"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taylordotfish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-20T02:41:56.000Z","updated_at":"2022-12-20T02:48:10.000Z","dependencies_parsed_at":"2022-12-29T22:14:23.662Z","dependency_job_id":null,"html_url":"https://github.com/taylordotfish/add-syntax","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/taylordotfish/add-syntax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylordotfish%2Fadd-syntax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylordotfish%2Fadd-syntax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylordotfish%2Fadd-syntax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylordotfish%2Fadd-syntax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taylordotfish","download_url":"https://codeload.github.com/taylordotfish/add-syntax/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylordotfish%2Fadd-syntax/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259742159,"owners_count":22904584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attribute","conditional","macro","macros","rust","syntax","tokens"],"created_at":"2025-05-23T21:11:53.051Z","updated_at":"2025-06-14T00:31:14.868Z","avatar_url":"https://github.com/taylordotfish.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"add-syntax\n==========\n\nAttribute macros that prepend or append arbitrary syntax. Useful with\n[`cfg_attr`].\n\nThis crate provides two attribute macros, [`prepend`] and [`append`], that\nadd the tokens passed to them to the start or end of the item to which the\nattribute is applied, respectively. This is particularly useful with\n[`cfg_attr`].\n\nExample\n-------\n\nConditionally applying `unsafe` when [`#[may_dangle]`][may_dangle] is used:\n\n[may_dangle]: https://github.com/rust-lang/rust/issues/34761\n\n```rust\n#[cfg_attr(feature = \"dropck_eyepatch\", add_syntax::prepend(unsafe))]\nimpl\u003c#[cfg_attr(feature = \"dropck_eyepatch\", may_dangle)] T\u003e Drop\n    for Foo\u003cT\u003e\n{\n    fn drop(\u0026mut self) { /* ... */ }\n}\n```\n\nIf the hypothetical feature `dropck_eyepatch` is enabled, the code above\nis equivalent to:\n\n```rust\nunsafe impl\u003c#[may_dangle] T\u003e Drop for Foo\u003cT\u003e {\n    fn drop(\u0026mut self) { /* ... */ }\n}\n```\n\nOtherwise, if the feature is not enabled, the code is equivalent to:\n\n```rust\nimpl\u003cT\u003e Drop for Foo\u003cT\u003e {\n    fn drop(\u0026mut self) { /* ... */ }\n}\n```\n\n[`cfg_attr`]:\nhttps://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute\n[`prepend`]: https://docs.rs/add-syntax/0.1/add_syntax/attr.prepend.html\n[`append`]: https://docs.rs/add-syntax/0.1/add_syntax/attr.append.html\n\nDocumentation\n-------------\n\n[Documentation is available on docs.rs.](https://docs.rs/add-syntax)\n\nLicense\n-------\n\nadd-syntax is licensed under version 2 of the Apache License.\nSee [LICENSE](LICENSE).\n\nContributing\n------------\n\nBy contributing to add-syntax, you agree that your contribution may be used\naccording to the terms of add-syntax’s license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaylordotfish%2Fadd-syntax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaylordotfish%2Fadd-syntax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaylordotfish%2Fadd-syntax/lists"}