diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-06-19 11:48:11 +0200 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-06-20 07:50:11 +0200 |
| commit | 75bcc9ca6e6d9096bad314fce2351b394ce8d2d0 (patch) | |
| tree | f8eb5c62a94f9836b53f61108257f3fc4074c0b3 /compiler | |
| parent | 8a65ee08296b36342bf7c3cdc15312ccbc357227 (diff) | |
| download | rust-75bcc9ca6e6d9096bad314fce2351b394ce8d2d0.tar.gz rust-75bcc9ca6e6d9096bad314fce2351b394ce8d2d0.zip | |
remove equivalent new method on context
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/context.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/def_collector.rs | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index d7570634c1f..feee1574363 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -420,19 +420,13 @@ impl<'sess> AttributeParser<'sess, Early> { parsed.pop() } - - pub fn new_early(sess: &'sess Session, features: &'sess Features, tools: Vec<Symbol>) -> Self { - Self { features: Some(features), tools, parse_only: None, sess, stage: PhantomData } - } } -impl<'sess> AttributeParser<'sess, Late> { +impl<'sess, S: Stage> AttributeParser<'sess, S> { pub fn new(sess: &'sess Session, features: &'sess Features, tools: Vec<Symbol>) -> Self { Self { features: Some(features), tools, parse_only: None, sess, stage: PhantomData } } -} -impl<'sess, S: Stage> AttributeParser<'sess, S> { pub(crate) fn sess(&self) -> &'sess Session { &self.sess } diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index f8e0a6936a0..16852d1661e 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -3,7 +3,7 @@ use std::mem; use rustc_ast::visit::FnKind; use rustc_ast::*; use rustc_ast_pretty::pprust; -use rustc_attr_parsing::{AttributeParser, OmitDoc}; +use rustc_attr_parsing::{AttributeParser, Early, OmitDoc}; use rustc_expand::expand::AstFragment; use rustc_hir as hir; use rustc_hir::def::{CtorKind, CtorOf, DefKind}; @@ -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 mut parser = AttributeParser::new_early( + let mut parser = AttributeParser::<'_, Early>::new( &self.resolver.tcx.sess, self.resolver.tcx.features(), Vec::new(), |
