Skip to content

Commit 7caad69

Browse files
committed
Auto merge of #131354 - matthiaskrgr:rollup-hprnng2, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #131331 (Revert "warn_old_master_branch" check) - #131344 (Avoid `&Lrc<T>` in various places) - #131346 (Restrict `ignore-mode-*` directives) - #131353 (Add documentation for `runtest::check_rustdoc_test_option` method) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0b16baa + fd2278d commit 7caad69

23 files changed

Lines changed: 53 additions & 128 deletions

File tree

‎compiler/rustc_codegen_ssa/src/back/write.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use rustc_ast::attr;
1111
use rustc_data_structures::fx::{FxHashMap,FxIndexMap};
1212
use rustc_data_structures::memmap::Mmap;
1313
use rustc_data_structures::profiling::{SelfProfilerRef,VerboseTimingGuard};
14-
use rustc_data_structures::sync::Lrc;
1514
use rustc_errors::emitter::Emitter;
1615
use rustc_errors::translation::Translate;
1716
use rustc_errors::{
@@ -1889,7 +1888,7 @@ impl SharedEmitter {
18891888
}
18901889

18911890
implTranslateforSharedEmitter{
1892-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
1891+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
18931892
None
18941893
}
18951894

@@ -1924,7 +1923,7 @@ impl Emitter for SharedEmitter {
19241923
);
19251924
}
19261925

1927-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>{
1926+
fnsource_map(&self) -> Option<&SourceMap>{
19281927
None
19291928
}
19301929
}

‎compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub struct AnnotateSnippetEmitter {
3434
}
3535

3636
implTranslateforAnnotateSnippetEmitter{
37-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
38-
self.fluent_bundle.as_ref()
37+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
38+
self.fluent_bundle.as_deref()
3939
}
4040

4141
fnfallback_fluent_bundle(&self) -> &FluentBundle{
@@ -69,8 +69,8 @@ impl Emitter for AnnotateSnippetEmitter {
6969
);
7070
}
7171

72-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>{
73-
self.source_map.as_ref()
72+
fnsource_map(&self) -> Option<&SourceMap>{
73+
self.source_map.as_deref()
7474
}
7575

7676
fnshould_show_explain(&self) -> bool{

‎compiler/rustc_errors/src/emitter.rs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub trait Emitter: Translate {
205205
false
206206
}
207207

208-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>;
208+
fnsource_map(&self) -> Option<&SourceMap>;
209209

210210
/// Formats the substitutions of the primary_span
211211
///
@@ -481,8 +481,8 @@ pub trait Emitter: Translate {
481481
}
482482

483483
implTranslateforHumanEmitter{
484-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
485-
self.fluent_bundle.as_ref()
484+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
485+
self.fluent_bundle.as_deref()
486486
}
487487

488488
fnfallback_fluent_bundle(&self) -> &FluentBundle{
@@ -491,8 +491,8 @@ impl Translate for HumanEmitter {
491491
}
492492

493493
implEmitterforHumanEmitter{
494-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>{
495-
self.sm.as_ref()
494+
fnsource_map(&self) -> Option<&SourceMap>{
495+
self.sm.as_deref()
496496
}
497497

498498
fnemit_diagnostic(&mutself,mutdiag:DiagInner){
@@ -540,7 +540,7 @@ pub struct SilentEmitter {
540540
}
541541

542542
implTranslateforSilentEmitter{
543-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
543+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
544544
None
545545
}
546546

@@ -552,7 +552,7 @@ impl Translate for SilentEmitter {
552552
}
553553

554554
implEmitterforSilentEmitter{
555-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>{
555+
fnsource_map(&self) -> Option<&SourceMap>{
556556
None
557557
}
558558

‎compiler/rustc_errors/src/json.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ enum EmitTyped<'a> {
111111
}
112112

113113
implTranslateforJsonEmitter{
114-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
115-
self.fluent_bundle.as_ref()
114+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
115+
self.fluent_bundle.as_deref()
116116
}
117117

118118
fnfallback_fluent_bundle(&self) -> &FluentBundle{
@@ -172,7 +172,7 @@ impl Emitter for JsonEmitter {
172172
}
173173
}
174174

175-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>{
175+
fnsource_map(&self) -> Option<&SourceMap>{
176176
Some(&self.sm)
177177
}
178178

‎compiler/rustc_errors/src/lib.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ use registry::Registry;
5959
use rustc_data_structures::AtomicRef;
6060
use rustc_data_structures::fx::{FxHashSet,FxIndexMap,FxIndexSet};
6161
use rustc_data_structures::stable_hasher::{Hash128,StableHasher};
62-
use rustc_data_structures::sync::{Lock,Lrc};
62+
use rustc_data_structures::sync::Lock;
6363
pubuse rustc_error_messages::{
6464
DiagMessage,FluentBundle,LanguageIdentifier,LazyFallbackBundle,MultiSpan,SpanLabel,
6565
SubdiagMessage, fallback_fluent_bundle, fluent_bundle,
@@ -685,13 +685,13 @@ impl DiagCtxt {
685685
unimplemented!("false emitter must only used during `wrap_emitter`")
686686
}
687687

688-
fnsource_map(&self) -> Option<&Lrc<SourceMap>>{
688+
fnsource_map(&self) -> Option<&SourceMap>{
689689
unimplemented!("false emitter must only used during `wrap_emitter`")
690690
}
691691
}
692692

693693
impl translation::TranslateforFalseEmitter{
694-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
694+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
695695
unimplemented!("false emitter must only used during `wrap_emitter`")
696696
}
697697

‎compiler/rustc_errors/src/tests.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_data_structures::sync::{IntoDynSyncSend,Lrc};
1+
use rustc_data_structures::sync::IntoDynSyncSend;
22
use rustc_error_messages::fluent_bundle::resolver::errors::{ReferenceKind,ResolverError};
33
use rustc_error_messages::{DiagMessage, langid};
44

@@ -12,7 +12,7 @@ struct Dummy {
1212
}
1313

1414
implTranslateforDummy{
15-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>{
15+
fnfluent_bundle(&self) -> Option<&FluentBundle>{
1616
None
1717
}
1818

‎compiler/rustc_errors/src/translation.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::borrow::Cow;
22
use std::env;
33
use std::error::Report;
44

5-
use rustc_data_structures::sync::Lrc;
65
pubuse rustc_error_messages::FluentArgs;
76
use tracing::{debug, trace};
87

@@ -33,7 +32,7 @@ pub trait Translate {
3332
/// Return `FluentBundle` with localized diagnostics for the locale requested by the user. If no
3433
/// language was requested by the user then this will be `None` and `fallback_fluent_bundle`
3534
/// should be used.
36-
fnfluent_bundle(&self) -> Option<&Lrc<FluentBundle>>;
35+
fnfluent_bundle(&self) -> Option<&FluentBundle>;
3736

3837
/// Return `FluentBundle` with localized diagnostics for the default locale of the compiler.
3938
/// Used when the user has not requested a specific language or when a localized diagnostic is

‎compiler/rustc_infer/src/infer/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ impl<'tcx> InferCtxt<'tcx> {
749749
definition_span:Span,
750750
hidden_ty:Ty<'tcx>,
751751
region: ty::Region<'tcx>,
752-
in_regions:&Lrc<Vec<ty::Region<'tcx>>>,
752+
in_regions:Lrc<Vec<ty::Region<'tcx>>>,
753753
){
754754
self.inner.borrow_mut().unwrap_region_constraints().member_constraint(
755755
key,

‎compiler/rustc_infer/src/infer/opaque_types/mod.rs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,15 @@ impl<'tcx> InferCtxt<'tcx> {
358358
// not currently sound until we have existential regions.
359359
concrete_ty.visit_with(&mutConstrainOpaqueTypeRegionVisitor{
360360
tcx:self.tcx,
361-
op: |r| self.member_constraint(opaque_type_key, span, concrete_ty, r,&choice_regions),
361+
op: |r| {
362+
self.member_constraint(
363+
opaque_type_key,
364+
span,
365+
concrete_ty,
366+
r,
367+
choice_regions.clone(),
368+
)
369+
},
362370
});
363371
}
364372
}

‎compiler/rustc_infer/src/infer/region_constraints/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
522522
definition_span:Span,
523523
hidden_ty:Ty<'tcx>,
524524
member_region: ty::Region<'tcx>,
525-
choice_regions:&Lrc<Vec<ty::Region<'tcx>>>,
525+
choice_regions:Lrc<Vec<ty::Region<'tcx>>>,
526526
){
527527
debug!("member_constraint({:?} in {:#?})", member_region, choice_regions);
528528

@@ -535,7 +535,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
535535
definition_span,
536536
hidden_ty,
537537
member_region,
538-
choice_regions: choice_regions.clone(),
538+
choice_regions,
539539
});
540540
}
541541

0 commit comments

Comments
 (0)