Skip to content

Commit 2e2d941

Browse files
authored
Unrolled build for #142769
Rollup merge of #142769 - jdonszelmann:remove-useless-new-method, r=tgross35 remove equivalent new method on context Noticed the two had converged so much they literally became equivalent. So one could go hehe
2 parents 9c4ff56 + 75bcc9c commit 2e2d941

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,19 +422,13 @@ impl<'sess> AttributeParser<'sess, Early> {
422422

423423
parsed.pop()
424424
}
425-
426-
pub fn new_early(sess: &'sess Session, features: &'sess Features, tools: Vec<Symbol>) -> Self {
427-
Self { features: Some(features), tools, parse_only: None, sess, stage: PhantomData }
428-
}
429425
}
430426

431-
impl<'sess> AttributeParser<'sess, Late> {
427+
impl<'sess, S: Stage> AttributeParser<'sess, S> {
432428
pub fn new(sess: &'sess Session, features: &'sess Features, tools: Vec<Symbol>) -> Self {
433429
Self { features: Some(features), tools, parse_only: None, sess, stage: PhantomData }
434430
}
435-
}
436431

437-
impl<'sess, S: Stage> AttributeParser<'sess, S> {
438432
pub(crate) fn sess(&self) -> &'sess Session {
439433
&self.sess
440434
}

compiler/rustc_resolve/src/def_collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::mem;
33
use rustc_ast::visit::FnKind;
44
use rustc_ast::*;
55
use rustc_ast_pretty::pprust;
6-
use rustc_attr_parsing::{AttributeParser, OmitDoc};
6+
use rustc_attr_parsing::{AttributeParser, Early, OmitDoc};
77
use rustc_expand::expand::AstFragment;
88
use rustc_hir as hir;
99
use rustc_hir::def::{CtorKind, CtorOf, DefKind};
@@ -128,7 +128,7 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> {
128128
// FIXME(jdonszelmann) make one of these in the resolver?
129129
// FIXME(jdonszelmann) don't care about tools here maybe? Just parse what we can.
130130
// Does that prevents errors from happening? maybe
131-
let mut parser = AttributeParser::new_early(
131+
let mut parser = AttributeParser::<'_, Early>::new(
132132
&self.resolver.tcx.sess,
133133
self.resolver.tcx.features(),
134134
Vec::new(),

0 commit comments

Comments
 (0)