Skip to content

Commit cff318c

Browse files
committed
Auto merge of rust-lang#129750 - GuillaumeGomez:rollup-gphsb7y, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - rust-lang#123940 (debug-fmt-detail option) - rust-lang#128166 (Improved `checked_isqrt` and `isqrt` methods) - rust-lang#128970 (Add `-Zlint-llvm-ir`) - rust-lang#129316 (riscv64imac: allow shadow call stack sanitizer) - rust-lang#129690 (Add `needs-unwind` compiletest directive to `libtest-thread-limit` and replace some `Path` with `path` in `run-make`) - rust-lang#129732 (Add `unreachable_pub`, round 3) - rust-lang#129743 (Fix rustdoc clippy lints) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6cf068d + 9c7ae1d commit cff318c

File tree

141 files changed

+1587
-644
lines changed

Some content is hidden

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

141 files changed

+1587
-644
lines changed

compiler/rustc_ast_lowering/src/format.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ use std::borrow::Cow;
44
use rustc_ast::visit::Visitor;
55
use rustc_ast::*;
66
use rustc_data_structures::fx::FxIndexMap;
7+
use rustc_hir as hir;
8+
use rustc_session::config::FmtDebug;
79
use rustc_span::symbol::{kw, Ident};
810
use rustc_span::{sym, Span, Symbol};
9-
use {rustc_ast as ast, rustc_hir as hir};
1011

1112
use super::LoweringContext;
1213

@@ -243,7 +244,10 @@ fn make_argument<'hir>(
243244
hir::LangItem::FormatArgument,
244245
match ty {
245246
Format(Display) => sym::new_display,
246-
Format(Debug) => sym::new_debug,
247+
Format(Debug) => match ctx.tcx.sess.opts.unstable_opts.fmt_debug {
248+
FmtDebug::Full | FmtDebug::Shallow => sym::new_debug,
249+
FmtDebug::None => sym::new_debug_noop,
250+
},
247251
Format(LowerExp) => sym::new_lower_exp,
248252
Format(UpperExp) => sym::new_upper_exp,
249253
Format(Octal) => sym::new_octal,

compiler/rustc_builtin_macros/src/deriving/debug.rs

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use rustc_ast::{self as ast, EnumDef, MetaItem};
22
use rustc_expand::base::{Annotatable, ExtCtxt};
3+
use rustc_session::config::FmtDebug;
34
use rustc_span::symbol::{sym, Ident, Symbol};
45
use rustc_span::Span;
56
use thin_vec::{thin_vec, ThinVec};
@@ -49,6 +50,11 @@ fn show_substructure(cx: &ExtCtxt<'_>, span: Span, substr: &Substructure<'_>) ->
4950
// We want to make sure we have the ctxt set so that we can use unstable methods
5051
let span = cx.with_def_site_ctxt(span);
5152

53+
let fmt_detail = cx.sess.opts.unstable_opts.fmt_debug;
54+
if fmt_detail == FmtDebug::None {
55+
return BlockOrExpr::new_expr(cx.expr_ok(span, cx.expr_tuple(span, ThinVec::new())));
56+
}
57+
5258
let (ident, vdata, fields) = match substr.fields {
5359
Struct(vdata, fields) => (substr.type_ident, *vdata, fields),
5460
EnumMatching(_, v, fields) => (v.ident, &v.data, fields),
@@ -61,6 +67,13 @@ fn show_substructure(cx: &ExtCtxt<'_>, span: Span, substr: &Substructure<'_>) ->
6167
let name = cx.expr_str(span, ident.name);
6268
let fmt = substr.nonselflike_args[0].clone();
6369

70+
// Fieldless enums have been special-cased earlier
71+
if fmt_detail == FmtDebug::Shallow {
72+
let fn_path_write_str = cx.std_path(&[sym::fmt, sym::Formatter, sym::write_str]);
73+
let expr = cx.expr_call_global(span, fn_path_write_str, thin_vec![fmt, name]);
74+
return BlockOrExpr::new_expr(expr);
75+
}
76+
6477
// Struct and tuples are similar enough that we use the same code for both,
6578
// with some extra pieces for structs due to the field names.
6679
let (is_struct, args_per_field) = match vdata {

compiler/rustc_codegen_llvm/src/back/write.rs

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ pub(crate) unsafe fn llvm_optimize(
571571
cgcx.opts.cg.linker_plugin_lto.enabled(),
572572
config.no_prepopulate_passes,
573573
config.verify_llvm_ir,
574+
config.lint_llvm_ir,
574575
using_thin_buffers,
575576
config.merge_functions,
576577
unroll_loops,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2225,6 +2225,7 @@ unsafe extern "C" {
22252225
IsLinkerPluginLTO: bool,
22262226
NoPrepopulatePasses: bool,
22272227
VerifyIR: bool,
2228+
LintIR: bool,
22282229
UseThinLTOBuffers: bool,
22292230
MergeFunctions: bool,
22302231
UnrollLoops: bool,

compiler/rustc_codegen_ssa/src/back/write.rs

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pub struct ModuleConfig {
112112
// Miscellaneous flags. These are mostly copied from command-line
113113
// options.
114114
pub verify_llvm_ir: bool,
115+
pub lint_llvm_ir: bool,
115116
pub no_prepopulate_passes: bool,
116117
pub no_builtins: bool,
117118
pub time_module: bool,
@@ -237,6 +238,7 @@ impl ModuleConfig {
237238
bc_cmdline: sess.target.bitcode_llvm_cmdline.to_string(),
238239

239240
verify_llvm_ir: sess.verify_llvm_ir(),
241+
lint_llvm_ir: sess.opts.unstable_opts.lint_llvm_ir,
240242
no_prepopulate_passes: sess.opts.cg.no_prepopulate_passes,
241243
no_builtins: no_builtins || sess.target.no_builtins,
242244

compiler/rustc_feature/src/builtin_attrs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const GATED_CFGS: &[GatedCfg] = &[
3737
(sym::relocation_model, sym::cfg_relocation_model, cfg_fn!(cfg_relocation_model)),
3838
(sym::sanitizer_cfi_generalize_pointers, sym::cfg_sanitizer_cfi, cfg_fn!(cfg_sanitizer_cfi)),
3939
(sym::sanitizer_cfi_normalize_integers, sym::cfg_sanitizer_cfi, cfg_fn!(cfg_sanitizer_cfi)),
40+
// this is consistent with naming of the compiler flag it's for
41+
(sym::fmt_debug, sym::fmt_debug, cfg_fn!(fmt_debug)),
4042
];
4143

4244
/// Find a gated cfg determined by the `pred`icate which is given the cfg's name.

compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ declare_features! (
471471
(unstable, ffi_const, "1.45.0", Some(58328)),
472472
/// Allows the use of `#[ffi_pure]` on foreign functions.
473473
(unstable, ffi_pure, "1.45.0", Some(58329)),
474+
/// Controlling the behavior of fmt::Debug
475+
(unstable, fmt_debug, "CURRENT_RUSTC_VERSION", Some(129709)),
474476
/// Allows using `#[repr(align(...))]` on function items
475477
(unstable, fn_align, "1.53.0", Some(82232)),
476478
/// Support delegating implementation of functions to other already implemented functions.

compiler/rustc_interface/src/tests.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use rustc_errors::{registry, ColorConfig};
1010
use rustc_session::config::{
1111
build_configuration, build_session_options, rustc_optgroups, BranchProtection, CFGuard, Cfg,
1212
CollapseMacroDebuginfo, CoverageLevel, CoverageOptions, DebugInfo, DumpMonoStatsFormat,
13-
ErrorOutputType, ExternEntry, ExternLocation, Externs, FunctionReturn, InliningThreshold,
14-
Input, InstrumentCoverage, InstrumentXRay, LinkSelfContained, LinkerPluginLto, LocationDetail,
15-
LtoCli, NextSolverConfig, OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey,
16-
PacRet, Passes, PatchableFunctionEntry, Polonius, ProcMacroExecutionStrategy, Strip,
17-
SwitchWithOptPath, SymbolManglingVersion, WasiExecModel,
13+
ErrorOutputType, ExternEntry, ExternLocation, Externs, FmtDebug, FunctionReturn,
14+
InliningThreshold, Input, InstrumentCoverage, InstrumentXRay, LinkSelfContained,
15+
LinkerPluginLto, LocationDetail, LtoCli, NextSolverConfig, OomStrategy, Options, OutFileName,
16+
OutputType, OutputTypes, PAuthKey, PacRet, Passes, PatchableFunctionEntry, Polonius,
17+
ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, SymbolManglingVersion, WasiExecModel,
1818
};
1919
use rustc_session::lint::Level;
2020
use rustc_session::search_paths::SearchPath;
@@ -780,6 +780,7 @@ fn test_unstable_options_tracking_hash() {
780780
tracked!(fewer_names, Some(true));
781781
tracked!(fixed_x18, true);
782782
tracked!(flatten_format_args, false);
783+
tracked!(fmt_debug, FmtDebug::Shallow);
783784
tracked!(force_unstable_if_unmarked, true);
784785
tracked!(fuel, Some(("abc".to_string(), 99)));
785786
tracked!(function_return, FunctionReturn::ThunkExtern);
@@ -794,6 +795,7 @@ fn test_unstable_options_tracking_hash() {
794795
tracked!(instrument_xray, Some(InstrumentXRay::default()));
795796
tracked!(link_directives, false);
796797
tracked!(link_only, true);
798+
tracked!(lint_llvm_ir, true);
797799
tracked!(llvm_module_flag, vec![("bar".to_string(), 123, "max".to_string())]);
798800
tracked!(llvm_plugins, vec![String::from("plugin_name")]);
799801
tracked!(location_detail, LocationDetail { file: true, line: false, column: false });

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ extern "C" LLVMRustResult LLVMRustOptimize(
713713
LLVMModuleRef ModuleRef, LLVMTargetMachineRef TMRef,
714714
LLVMRustPassBuilderOptLevel OptLevelRust, LLVMRustOptStage OptStage,
715715
bool IsLinkerPluginLTO, bool NoPrepopulatePasses, bool VerifyIR,
716-
bool UseThinLTOBuffers, bool MergeFunctions, bool UnrollLoops,
716+
bool LintIR, bool UseThinLTOBuffers, bool MergeFunctions, bool UnrollLoops,
717717
bool SLPVectorize, bool LoopVectorize, bool DisableSimplifyLibCalls,
718718
bool EmitLifetimeMarkers, LLVMRustSanitizerOptions *SanitizerOptions,
719719
const char *PGOGenPath, const char *PGOUsePath, bool InstrumentCoverage,
@@ -842,6 +842,13 @@ extern "C" LLVMRustResult LLVMRustOptimize(
842842
});
843843
}
844844

845+
if (LintIR) {
846+
PipelineStartEPCallbacks.push_back(
847+
[](ModulePassManager &MPM, OptimizationLevel Level) {
848+
MPM.addPass(createModuleToFunctionPassAdaptor(LintPass()));
849+
});
850+
}
851+
845852
if (InstrumentGCOV) {
846853
PipelineStartEPCallbacks.push_back(
847854
[](ModulePassManager &MPM, OptimizationLevel Level) {

compiler/rustc_macros/src/diagnostics/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use synstructure::Structure;
5555
///
5656
/// See rustc dev guide for more examples on using the `#[derive(Diagnostic)]`:
5757
/// <https://rustc-dev-guide.rust-lang.org/diagnostics/diagnostic-structs.html>
58-
pub fn diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
58+
pub(super) fn diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
5959
s.underscore_const(true);
6060
DiagnosticDerive::new(s).into_tokens()
6161
}
@@ -102,7 +102,7 @@ pub fn diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
102102
///
103103
/// See rustc dev guide for more examples on using the `#[derive(LintDiagnostic)]`:
104104
/// <https://rustc-dev-guide.rust-lang.org/diagnostics/diagnostic-structs.html#reference>
105-
pub fn lint_diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
105+
pub(super) fn lint_diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
106106
s.underscore_const(true);
107107
LintDiagnosticDerive::new(s).into_tokens()
108108
}
@@ -153,7 +153,7 @@ pub fn lint_diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
153153
///
154154
/// diag.subdiagnostic(RawIdentifierSuggestion { span, applicability, ident });
155155
/// ```
156-
pub fn subdiagnostic_derive(mut s: Structure<'_>) -> TokenStream {
156+
pub(super) fn subdiagnostic_derive(mut s: Structure<'_>) -> TokenStream {
157157
s.underscore_const(true);
158158
SubdiagnosticDerive::new().into_tokens(s)
159159
}

compiler/rustc_macros/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![feature(proc_macro_diagnostic)]
77
#![feature(proc_macro_span)]
88
#![feature(proc_macro_tracked_env)]
9+
#![warn(unreachable_pub)]
910
// tidy-alphabetical-end
1011

1112
use proc_macro::TokenStream;

compiler/rustc_macros/src/lift.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quote::quote;
22
use syn::parse_quote;
33

4-
pub fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
4+
pub(super) fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
55
s.add_bounds(synstructure::AddBounds::Generics);
66
s.bind_with(|_| synstructure::BindStyle::Move);
77
s.underscore_const(true);

compiler/rustc_macros/src/query.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ fn add_query_desc_cached_impl(
307307
});
308308
}
309309

310-
pub fn rustc_queries(input: TokenStream) -> TokenStream {
310+
pub(super) fn rustc_queries(input: TokenStream) -> TokenStream {
311311
let queries = parse_macro_input!(input as List<Query>);
312312

313313
let mut query_stream = quote! {};

compiler/rustc_macros/src/serialize.rs

+20-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use quote::{quote, quote_spanned};
33
use syn::parse_quote;
44
use syn::spanned::Spanned;
55

6-
pub fn type_decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
6+
pub(super) fn type_decodable_derive(
7+
mut s: synstructure::Structure<'_>,
8+
) -> proc_macro2::TokenStream {
79
let decoder_ty = quote! { __D };
810
let bound = if s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
911
quote! { <I = ::rustc_middle::ty::TyCtxt<'tcx>> }
@@ -20,7 +22,9 @@ pub fn type_decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
2022
decodable_body(s, decoder_ty)
2123
}
2224

23-
pub fn meta_decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
25+
pub(super) fn meta_decodable_derive(
26+
mut s: synstructure::Structure<'_>,
27+
) -> proc_macro2::TokenStream {
2428
if !s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
2529
s.add_impl_generic(parse_quote! { 'tcx });
2630
}
@@ -32,7 +36,7 @@ pub fn meta_decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
3236
decodable_body(s, decoder_ty)
3337
}
3438

35-
pub fn decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
39+
pub(super) fn decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
3640
let decoder_ty = quote! { __D };
3741
s.add_impl_generic(parse_quote! { #decoder_ty: ::rustc_span::SpanDecoder });
3842
s.add_bounds(synstructure::AddBounds::Generics);
@@ -41,7 +45,9 @@ pub fn decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Toke
4145
decodable_body(s, decoder_ty)
4246
}
4347

44-
pub fn decodable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
48+
pub(super) fn decodable_generic_derive(
49+
mut s: synstructure::Structure<'_>,
50+
) -> proc_macro2::TokenStream {
4551
let decoder_ty = quote! { __D };
4652
s.add_impl_generic(parse_quote! { #decoder_ty: ::rustc_serialize::Decoder });
4753
s.add_bounds(synstructure::AddBounds::Generics);
@@ -123,7 +129,9 @@ fn decode_field(field: &syn::Field) -> proc_macro2::TokenStream {
123129
quote_spanned! { field_span=> #decode_inner_method(#__decoder) }
124130
}
125131

126-
pub fn type_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
132+
pub(super) fn type_encodable_derive(
133+
mut s: synstructure::Structure<'_>,
134+
) -> proc_macro2::TokenStream {
127135
let bound = if s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
128136
quote! { <I = ::rustc_middle::ty::TyCtxt<'tcx>> }
129137
} else if s.ast().generics.type_params().any(|ty| ty.ident == "I") {
@@ -140,7 +148,9 @@ pub fn type_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
140148
encodable_body(s, encoder_ty, false)
141149
}
142150

143-
pub fn meta_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
151+
pub(super) fn meta_encodable_derive(
152+
mut s: synstructure::Structure<'_>,
153+
) -> proc_macro2::TokenStream {
144154
if !s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
145155
s.add_impl_generic(parse_quote! { 'tcx });
146156
}
@@ -152,7 +162,7 @@ pub fn meta_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
152162
encodable_body(s, encoder_ty, true)
153163
}
154164

155-
pub fn encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
165+
pub(super) fn encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
156166
let encoder_ty = quote! { __E };
157167
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_span::SpanEncoder });
158168
s.add_bounds(synstructure::AddBounds::Generics);
@@ -161,7 +171,9 @@ pub fn encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Toke
161171
encodable_body(s, encoder_ty, false)
162172
}
163173

164-
pub fn encodable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
174+
pub(super) fn encodable_generic_derive(
175+
mut s: synstructure::Structure<'_>,
176+
) -> proc_macro2::TokenStream {
165177
let encoder_ty = quote! { __E };
166178
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_serialize::Encoder });
167179
s.add_bounds(synstructure::AddBounds::Generics);

compiler/rustc_macros/src/symbols.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl Errors {
131131
}
132132
}
133133

134-
pub fn symbols(input: TokenStream) -> TokenStream {
134+
pub(super) fn symbols(input: TokenStream) -> TokenStream {
135135
let (mut output, errors) = symbols_with_errors(input);
136136

137137
// If we generated any errors, then report them as compiler_error!() macro calls.

compiler/rustc_macros/src/type_foldable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quote::{quote, ToTokens};
22
use syn::parse_quote;
33

4-
pub fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
4+
pub(super) fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
55
if let syn::Data::Union(_) = s.ast().data {
66
panic!("cannot derive on union")
77
}

compiler/rustc_macros/src/type_visitable.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use quote::quote;
22
use syn::parse_quote;
33

4-
pub fn type_visitable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
4+
pub(super) fn type_visitable_derive(
5+
mut s: synstructure::Structure<'_>,
6+
) -> proc_macro2::TokenStream {
57
if let syn::Data::Union(_) = s.ast().data {
68
panic!("cannot derive on union")
79
}

compiler/rustc_metadata/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#![feature(proc_macro_internals)]
1717
#![feature(rustdoc_internals)]
1818
#![feature(trusted_len)]
19+
#![warn(unreachable_pub)]
1920
// tidy-alphabetical-end
2021

2122
extern crate proc_macro;

compiler/rustc_metadata/src/rmeta/decoder.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ impl std::ops::Deref for MetadataBlob {
5656

5757
impl MetadataBlob {
5858
/// Runs the [`MemDecoder`] validation and if it passes, constructs a new [`MetadataBlob`].
59-
pub fn new(slice: OwnedSlice) -> Result<Self, ()> {
59+
pub(crate) fn new(slice: OwnedSlice) -> Result<Self, ()> {
6060
if MemDecoder::new(&slice, 0).is_ok() { Ok(Self(slice)) } else { Err(()) }
6161
}
6262

6363
/// Since this has passed the validation of [`MetadataBlob::new`], this returns bytes which are
6464
/// known to pass the [`MemDecoder`] validation.
65-
pub fn bytes(&self) -> &OwnedSlice {
65+
pub(crate) fn bytes(&self) -> &OwnedSlice {
6666
&self.0
6767
}
6868
}
@@ -332,12 +332,12 @@ impl<'a, 'tcx> DecodeContext<'a, 'tcx> {
332332
}
333333

334334
#[inline]
335-
pub fn blob(&self) -> &'a MetadataBlob {
335+
pub(crate) fn blob(&self) -> &'a MetadataBlob {
336336
self.blob
337337
}
338338

339339
#[inline]
340-
pub fn cdata(&self) -> CrateMetadataRef<'a> {
340+
fn cdata(&self) -> CrateMetadataRef<'a> {
341341
debug_assert!(self.cdata.is_some(), "missing CrateMetadata in DecodeContext");
342342
self.cdata.unwrap()
343343
}
@@ -377,7 +377,7 @@ impl<'a, 'tcx> DecodeContext<'a, 'tcx> {
377377
}
378378

379379
#[inline]
380-
pub fn read_raw_bytes(&mut self, len: usize) -> &[u8] {
380+
fn read_raw_bytes(&mut self, len: usize) -> &[u8] {
381381
self.opaque.read_raw_bytes(len)
382382
}
383383
}

compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ parameterized_over_tcx! {
1717

1818
impl DefPathHashMapRef<'_> {
1919
#[inline]
20-
pub fn def_path_hash_to_def_index(&self, def_path_hash: &DefPathHash) -> DefIndex {
20+
pub(crate) fn def_path_hash_to_def_index(&self, def_path_hash: &DefPathHash) -> DefIndex {
2121
match *self {
2222
DefPathHashMapRef::OwnedFromMetadata(ref map) => {
2323
map.get(&def_path_hash.local_hash()).unwrap()

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ fn encode_root_position(mut file: &File, pos: usize) -> Result<(), std::io::Erro
23092309
Ok(())
23102310
}
23112311

2312-
pub fn provide(providers: &mut Providers) {
2312+
pub(crate) fn provide(providers: &mut Providers) {
23132313
*providers = Providers {
23142314
doc_link_resolutions: |tcx, def_id| {
23152315
tcx.resolutions(())

0 commit comments

Comments
 (0)