Skip to content

Commit

Permalink
N-08 Disallow attribute tokens in #[public]
Browse files Browse the repository at this point in the history
  • Loading branch information
rory-ocl committed Sep 13, 2024
1 parent 3ca6140 commit 389f49e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stylus-proc/src/methods/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::types::Purity;
use convert_case::{Case, Casing};
use proc_macro::TokenStream;
use proc_macro2::Ident;
use proc_macro2::{Ident, Span};
use quote::{quote, quote_spanned};
use std::mem;
use syn::{
Expand All @@ -16,7 +16,11 @@ use syn::{
FnArg, ImplItem, Index, ItemImpl, LitStr, Pat, PatType, Result, ReturnType, Token, Type,
};

pub fn public(_attr: TokenStream, input: TokenStream) -> TokenStream {
pub fn public(attr: TokenStream, input: TokenStream) -> TokenStream {
if !attr.is_empty() {
error!(Span::mixed_site(), "this macro is not configurable");
}

let mut input = parse_macro_input!(input as ItemImpl);
let mut selectors = quote!();
let mut match_selectors = quote!();
Expand Down

0 comments on commit 389f49e

Please sign in to comment.