diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-02-12 13:59:08 +0100 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-06-12 09:56:47 +0200 |
| commit | 6072207a1151f212163e3c19d92ff4ea22f291b2 (patch) | |
| tree | 53855f9f1b959d32f14f0ae33f4cdd8c17f9ea88 /compiler/rustc_resolve | |
| parent | 4e1b6d13a20e5b72922f085fb4b248848ca02910 (diff) | |
| download | rust-6072207a1151f212163e3c19d92ff4ea22f291b2.tar.gz rust-6072207a1151f212163e3c19d92ff4ea22f291b2.zip | |
introduce new lint infra
lint on duplicates during attribute parsing To do this we stuff them in the diagnostic context to be emitted after hir is constructed
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/def_collector.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index dc16fe212b1..f8e0a6936a0 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -128,7 +128,7 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> { // FIXME(jdonszelmann) make one of these in the resolver? // FIXME(jdonszelmann) don't care about tools here maybe? Just parse what we can. // Does that prevents errors from happening? maybe - let parser = AttributeParser::new( + let mut parser = AttributeParser::new_early( &self.resolver.tcx.sess, self.resolver.tcx.features(), Vec::new(), @@ -136,8 +136,14 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> { let attrs = parser.parse_attribute_list( &i.attrs, i.span, + i.id, OmitDoc::Skip, std::convert::identity, + |_l| { + // FIXME(jdonszelmann): emit lints here properly + // NOTE that before new attribute parsing, they didn't happen either + // but it would be nice if we could change that. + }, ); let macro_data = |
