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
This commit is contained in:
@@ -422,19 +422,13 @@ impl<'sess> AttributeParser<'sess, Early> {
|
|||||||
|
|
||||||
parsed.pop()
|
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> {
|
|
||||||
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> {
|
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 }
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn sess(&self) -> &'sess Session {
|
pub(crate) fn sess(&self) -> &'sess Session {
|
||||||
&self.sess
|
&self.sess
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::mem;
|
|||||||
use rustc_ast::visit::FnKind;
|
use rustc_ast::visit::FnKind;
|
||||||
use rustc_ast::*;
|
use rustc_ast::*;
|
||||||
use rustc_ast_pretty::pprust;
|
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_expand::expand::AstFragment;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def::{CtorKind, CtorOf, DefKind};
|
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) make one of these in the resolver?
|
||||||
// FIXME(jdonszelmann) don't care about tools here maybe? Just parse what we can.
|
// FIXME(jdonszelmann) don't care about tools here maybe? Just parse what we can.
|
||||||
// Does that prevents errors from happening? maybe
|
// 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.sess,
|
||||||
self.resolver.tcx.features(),
|
self.resolver.tcx.features(),
|
||||||
Vec::new(),
|
Vec::new(),
|
||||||
|
|||||||
Reference in New Issue
Block a user