Skip to content

Commit f07100a

Browse files
committed
Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.
1 parent f25811e commit f07100a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+99
-96
lines changed

src/librustc_codegen_llvm/attributes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty::
342342
}
343343
}
344344

345-
pub fn provide(providers: &mut Providers<'_>) {
345+
pub fn provide(providers: &mut Providers) {
346346
providers.target_features_whitelist = |tcx, cnum| {
347347
assert_eq!(cnum, LOCAL_CRATE);
348348
if tcx.sess.opts.actually_rustdoc {
@@ -360,7 +360,7 @@ pub fn provide(providers: &mut Providers<'_>) {
360360
provide_extern(providers);
361361
}
362362

363-
pub fn provide_extern(providers: &mut Providers<'_>) {
363+
pub fn provide_extern(providers: &mut Providers) {
364364
providers.wasm_import_module_map = |tcx, cnum| {
365365
// Build up a map from DefId to a `NativeLib` structure, where
366366
// `NativeLib` internally contains information about

src/librustc_codegen_llvm/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ impl CodegenBackend for LlvmCodegenBackend {
241241
Box::new(metadata::LlvmMetadataLoader)
242242
}
243243

244-
fn provide(&self, providers: &mut ty::query::Providers<'_>) {
244+
fn provide(&self, providers: &mut ty::query::Providers) {
245245
attributes::provide(providers);
246246
}
247247

248-
fn provide_extern(&self, providers: &mut ty::query::Providers<'_>) {
248+
fn provide_extern(&self, providers: &mut ty::query::Providers) {
249249
attributes::provide_extern(providers);
250250
}
251251

src/librustc_codegen_ssa/back/symbol_export.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ fn is_reachable_non_generic_provider_extern(tcx: TyCtxt<'_>, def_id: DefId) -> b
161161
}
162162

163163
fn exported_symbols_provider_local(
164-
tcx: TyCtxt<'_>,
164+
tcx: TyCtxt<'tcx>,
165165
cnum: CrateNum,
166-
) -> &'tcx [(ExportedSymbol<'_>, SymbolExportLevel)] {
166+
) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportLevel)] {
167167
assert_eq!(cnum, LOCAL_CRATE);
168168

169169
if !tcx.sess.opts.output_types.should_codegen() {
@@ -366,7 +366,7 @@ fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: DefId) -> b
366366
}
367367
}
368368

369-
pub fn provide(providers: &mut Providers<'_>) {
369+
pub fn provide(providers: &mut Providers) {
370370
providers.reachable_non_generics = reachable_non_generics_provider;
371371
providers.is_reachable_non_generic = is_reachable_non_generic_provider_local;
372372
providers.exported_symbols = exported_symbols_provider_local;
@@ -375,7 +375,7 @@ pub fn provide(providers: &mut Providers<'_>) {
375375
providers.upstream_drop_glue_for = upstream_drop_glue_for_provider;
376376
}
377377

378-
pub fn provide_extern(providers: &mut Providers<'_>) {
378+
pub fn provide_extern(providers: &mut Providers) {
379379
providers.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
380380
providers.upstream_monomorphizations_for = upstream_monomorphizations_for_provider;
381381
}

src/librustc_codegen_ssa/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ impl CrateInfo {
853853
}
854854
}
855855

856-
pub fn provide_both(providers: &mut Providers<'_>) {
856+
pub fn provide_both(providers: &mut Providers) {
857857
providers.backend_optimization_level = |tcx, cratenum| {
858858
let for_speed = match tcx.sess.opts.optimize {
859859
// If globally no optimisation is done, #[optimize] has no effect.

src/librustc_codegen_ssa/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ pub struct CodegenResults {
138138
pub crate_info: CrateInfo,
139139
}
140140

141-
pub fn provide(providers: &mut Providers<'_>) {
141+
pub fn provide(providers: &mut Providers) {
142142
crate::back::symbol_export::provide(providers);
143143
crate::base::provide_both(providers);
144144
}
145145

146-
pub fn provide_extern(providers: &mut Providers<'_>) {
146+
pub fn provide_extern(providers: &mut Providers) {
147147
crate::back::symbol_export::provide_extern(providers);
148148
crate::base::provide_both(providers);
149149
}

src/librustc_codegen_ssa/traits/backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ pub trait CodegenBackend {
5555
fn print_version(&self) {}
5656

5757
fn metadata_loader(&self) -> Box<MetadataLoaderDyn>;
58-
fn provide(&self, _providers: &mut Providers<'_>);
59-
fn provide_extern(&self, _providers: &mut Providers<'_>);
58+
fn provide(&self, _providers: &mut Providers);
59+
fn provide_extern(&self, _providers: &mut Providers);
6060
fn codegen_crate<'tcx>(
6161
&self,
6262
tcx: TyCtxt<'tcx>,

src/librustc_interface/interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct Compiler {
3838
pub(crate) crate_name: Option<String>,
3939
pub(crate) register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>,
4040
pub(crate) override_queries:
41-
Option<fn(&Session, &mut ty::query::Providers<'_>, &mut ty::query::Providers<'_>)>,
41+
Option<fn(&Session, &mut ty::query::Providers, &mut ty::query::Providers)>,
4242
}
4343

4444
impl Compiler {
@@ -153,7 +153,7 @@ pub struct Config {
153153
///
154154
/// The second parameter is local providers and the third parameter is external providers.
155155
pub override_queries:
156-
Option<fn(&Session, &mut ty::query::Providers<'_>, &mut ty::query::Providers<'_>)>,
156+
Option<fn(&Session, &mut ty::query::Providers, &mut ty::query::Providers)>,
157157

158158
/// Registry of diagnostics codes.
159159
pub registry: Registry,

src/librustc_interface/passes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ pub fn prepare_outputs(
719719
Ok(outputs)
720720
}
721721

722-
pub fn default_provide(providers: &mut ty::query::Providers<'_>) {
722+
pub fn default_provide(providers: &mut ty::query::Providers) {
723723
providers.analysis = analysis;
724724
proc_macro_decls::provide(providers);
725725
plugin::build::provide(providers);
@@ -740,7 +740,7 @@ pub fn default_provide(providers: &mut ty::query::Providers<'_>) {
740740
rustc_codegen_ssa::provide(providers);
741741
}
742742

743-
pub fn default_provide_extern(providers: &mut ty::query::Providers<'_>) {
743+
pub fn default_provide_extern(providers: &mut ty::query::Providers) {
744744
rustc_metadata::provide_extern(providers);
745745
rustc_codegen_ssa::provide_extern(providers);
746746
}

src/librustc_interface/proc_macro_decls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ impl<'v> ItemLikeVisitor<'v> for Finder {
3535
fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'_>) {}
3636
}
3737

38-
pub(crate) fn provide(providers: &mut Providers<'_>) {
38+
pub(crate) fn provide(providers: &mut Providers) {
3939
*providers = Providers { proc_macro_decls_static, ..*providers };
4040
}

src/librustc_lint/levels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,6 @@ impl<'tcx> intravisit::Visitor<'tcx> for LintLevelMapBuilder<'_, 'tcx> {
571571
}
572572
}
573573

574-
pub fn provide(providers: &mut Providers<'_>) {
574+
pub fn provide(providers: &mut Providers) {
575575
providers.lint_levels = lint_levels;
576576
}

0 commit comments

Comments
 (0)