Skip to content

Commit fdcf5a9

Browse files
committed
yeet unused stuff
1 parent d6412ce commit fdcf5a9

File tree

5 files changed

+6
-49
lines changed

5 files changed

+6
-49
lines changed

compiler/rustc_borrowck/messages.ftl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ borrowck_moved_due_to_usage_in_operator =
156156
*[false] operator
157157
}
158158
159-
borrowck_opaque_type_lifetime_mismatch =
160-
opaque type used twice with different lifetimes
161-
.label = lifetime `{$arg}` used here
162-
.prev_lifetime_label = lifetime `{$prev}` previously used here
163-
.note = if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types
164-
165159
borrowck_partial_var_move_by_use_in_closure =
166160
variable {$is_partial ->
167161
[true] partially moved

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ impl<'tcx> RegionErrors<'tcx> {
8787
let guar = self.1.sess.dcx().delayed_bug(format!("{val:?}"));
8888
self.0.push((val, guar));
8989
}
90-
pub(crate) fn is_empty(&self) -> bool {
91-
self.0.is_empty()
92-
}
9390
pub(crate) fn into_iter(
9491
self,
9592
) -> impl Iterator<Item = (RegionErrorKind<'tcx>, ErrorGuaranteed)> {

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_span::hygiene::DesugaringKind;
2222
use rustc_span::{DUMMY_SP, Span};
2323
use tracing::{debug, instrument, trace};
2424

25-
use crate::constraints::graph::{self, NormalConstraintGraph, RegionGraph};
25+
use crate::constraints::graph::NormalConstraintGraph;
2626
use crate::constraints::{ConstraintSccIndex, OutlivesConstraint, OutlivesConstraintSet};
2727
use crate::dataflow::BorrowIndex;
2828
use crate::diagnostics::{RegionErrorKind, RegionErrors, UniverseInfo};
@@ -271,7 +271,6 @@ enum Trace<'a, 'tcx> {
271271
StartRegion,
272272
FromGraph(&'a OutlivesConstraint<'tcx>),
273273
FromStatic(RegionVid),
274-
FromMember(RegionVid, RegionVid, Span),
275274
NotVisited,
276275
}
277276

@@ -1510,20 +1509,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
15101509
result.push(c);
15111510
}
15121511

1513-
Trace::FromMember(sup, sub, span) => {
1514-
let c = OutlivesConstraint {
1515-
sup,
1516-
sub,
1517-
locations: Locations::All(span),
1518-
span,
1519-
category: ConstraintCategory::OpaqueType,
1520-
variance_info: ty::VarianceDiagInfo::default(),
1521-
from_closure: false,
1522-
};
1523-
p = c.sup;
1524-
result.push(c);
1525-
}
1526-
15271512
Trace::StartRegion => {
15281513
result.reverse();
15291514
return Some((result, r));
@@ -1892,11 +1877,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
18921877
&self.constraint_sccs
18931878
}
18941879

1895-
/// Access to the region graph, built from the outlives constraints.
1896-
pub(crate) fn region_graph(&self) -> RegionGraph<'_, 'tcx, graph::Normal> {
1897-
self.constraint_graph.region_graph(&self.constraints, self.universal_regions().fr_static)
1898-
}
1899-
19001880
/// Returns the representative `RegionVid` for a given SCC.
19011881
/// See `RegionTracker` for how a region variable ID is chosen.
19021882
///

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ use rustc_middle::ty::{
1616
Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, fold_regions,
1717
};
1818
use rustc_mir_dataflow::points::DenseLocationMap;
19-
use rustc_span::sym::opaque;
20-
use rustc_span::{ErrorGuaranteed, Span};
19+
use rustc_span::Span;
2120
use rustc_trait_selection::error_reporting::infer::region::unexpected_hidden_region_diagnostic;
2221
use rustc_trait_selection::opaque_types::check_opaque_type_parameter_valid;
2322
use tracing::{debug, instrument};
@@ -131,7 +130,7 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
131130
}
132131
});
133132

134-
let mut hidden_type = hidden_type.fold_with(&mut OpaqueHiddenTypeFolder {
133+
let hidden_type = hidden_type.fold_with(&mut OpaqueHiddenTypeFolder {
135134
infcx,
136135

137136
opaque_type_key,
@@ -163,7 +162,7 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
163162
}
164163

165164
if !unexpected_hidden_regions.is_empty() {
166-
let guar = report_unexpected_hidden_region_errors(
165+
report_unexpected_hidden_region_errors(
167166
root_cx,
168167
infcx,
169168
universal_region_relations,
@@ -559,7 +558,7 @@ impl<'tcx> InferCtxt<'tcx> {
559558
}
560559
}
561560

562-
pub(super) fn report_unexpected_hidden_region_errors<'tcx>(
561+
fn report_unexpected_hidden_region_errors<'tcx>(
563562
root_cx: &mut BorrowCheckRootCtxt<'tcx>,
564563
infcx: &BorrowckInferCtxt<'tcx>,
565564
universal_region_relations: &Frozen<UniversalRegionRelations<'tcx>>,

compiler/rustc_borrowck/src/session_diagnostics.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_errors::MultiSpan;
22
use rustc_errors::codes::*;
33
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
4-
use rustc_middle::ty::{GenericArg, Ty};
4+
use rustc_middle::ty::Ty;
55
use rustc_span::Span;
66

77
use crate::diagnostics::RegionName;
@@ -294,19 +294,6 @@ pub(crate) struct MoveBorrow<'a> {
294294
pub borrow_span: Span,
295295
}
296296

297-
#[derive(Diagnostic)]
298-
#[diag(borrowck_opaque_type_lifetime_mismatch)]
299-
pub(crate) struct LifetimeMismatchOpaqueParam<'tcx> {
300-
pub arg: GenericArg<'tcx>,
301-
pub prev: GenericArg<'tcx>,
302-
#[primary_span]
303-
#[label]
304-
#[note]
305-
pub span: Span,
306-
#[label(borrowck_prev_lifetime_label)]
307-
pub prev_span: Span,
308-
}
309-
310297
#[derive(Subdiagnostic)]
311298
pub(crate) enum CaptureReasonLabel<'a> {
312299
#[label(borrowck_moved_due_to_call)]

0 commit comments

Comments
 (0)