diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-04-11 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-04-11 00:00:00 +0000 |
| commit | 985ae0b55bf9bc2e2926f75a57578a32b982b10d (patch) | |
| tree | 2dfc1a01947f0806860a40e1c5fbaa8c93b491c8 /compiler/rustc_ast/src | |
| parent | ba6275b6a9fc05fd5d93220e9a67fe64d663cb62 (diff) | |
| download | rust-985ae0b55bf9bc2e2926f75a57578a32b982b10d.tar.gz rust-985ae0b55bf9bc2e2926f75a57578a32b982b10d.zip | |
Match against attribute name when validating attributes
Extract attribute name once and match it against symbols that are being validated, instead of using `Session::check_name` for each symbol individually. Assume that all validated attributes are used, instead of marking them as such, since the attribute check should be exhaustive.
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index da9accd1839..8dd82ca7943 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -100,6 +100,7 @@ pub struct Path { } impl PartialEq<Symbol> for Path { + #[inline] fn eq(&self, symbol: &Symbol) -> bool { self.segments.len() == 1 && { self.segments[0].ident.name == *symbol } } |
