rustc: Remove unused Session
argument from some attribute functions
This commit is contained in:
parent
9bdb4881c7
commit
67a2c5bec8
37 changed files with 173 additions and 299 deletions
|
@ -1,3 +1,4 @@
|
|||
use rustc_ast::attr;
|
||||
use rustc_hir::def_id::LocalDefId;
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
|
@ -8,7 +9,7 @@ fn proc_macro_decls_static(tcx: TyCtxt<'_>, (): ()) -> Option<LocalDefId> {
|
|||
|
||||
for id in tcx.hir().items() {
|
||||
let attrs = tcx.hir().attrs(id.hir_id());
|
||||
if tcx.sess.contains_name(attrs, sym::rustc_proc_macro_decls) {
|
||||
if attr::contains_name(attrs, sym::rustc_proc_macro_decls) {
|
||||
decls = Some(id.owner_id.def_id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ pub fn build_output_filenames(attrs: &[ast::Attribute], sess: &Session) -> Outpu
|
|||
.opts
|
||||
.crate_name
|
||||
.clone()
|
||||
.or_else(|| rustc_attr::find_crate_name(sess, attrs).map(|n| n.to_string()))
|
||||
.or_else(|| rustc_attr::find_crate_name(attrs).map(|n| n.to_string()))
|
||||
.unwrap_or_else(|| sess.io.input.filestem().to_owned());
|
||||
|
||||
OutputFilenames::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue