Skip to content

Commit 8d590dc

Browse files
committed
Resolve rebase
1 parent 35dbec3 commit 8d590dc

File tree

4 files changed

+2
-40
lines changed

4 files changed

+2
-40
lines changed

compiler/rustc_error_messages/locales/en-US/infer.ftl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ infer_region_explanation = {$pref_kind ->
150150
[lf_param_must_outlive] but lifetime parameter must outlive
151151
[lf_instantiated_with] lifetime instantiated with
152152
[lf_must_outlive] but lifetime must outlive
153-
[type_valid_for] the type is valid for
154-
[borrow_lasts_for] but the borrow lasts for
155153
[pointer_valid_for] the pointer is valid for
156154
[data_valid_for] but the referenced data is only valid for
157155
[empty] {""}

compiler/rustc_infer/src/errors/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -971,16 +971,6 @@ pub struct LfBoundNotSatisfied<'a> {
971971
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
972972
}
973973

974-
#[derive(Diagnostic)]
975-
#[diag(infer_borrowed_too_long, code = "E0490")]
976-
pub struct BorrowedTooLong<'a> {
977-
#[primary_span]
978-
pub span: Span,
979-
pub ty: Ty<'a>,
980-
#[subdiagnostic]
981-
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
982-
}
983-
984974
#[derive(Diagnostic)]
985975
#[diag(infer_ref_longer_than_data, code = "E0491")]
986976
pub struct RefLongerThanData<'a> {

compiler/rustc_infer/src/errors/note_and_explain.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ pub enum PrefixKind {
131131
LfParamMustOutlive,
132132
LfInstantiatedWith,
133133
LfMustOutlive,
134-
TypeValidFor,
135-
BorrowLastsFor,
136134
PointerValidFor,
137135
DataValidFor,
138136
}
@@ -157,8 +155,6 @@ impl IntoDiagnosticArg for PrefixKind {
157155
Self::LfParamMustOutlive => "lf_param_must_outlive",
158156
Self::LfInstantiatedWith => "lf_instantiated_with",
159157
Self::LfMustOutlive => "lf_must_outlive",
160-
Self::TypeValidFor => "type_valid_for",
161-
Self::BorrowLastsFor => "borrow_lasts_for",
162158
Self::PointerValidFor => "pointer_valid_for",
163159
Self::DataValidFor => "data_valid_for",
164160
}

compiler/rustc_infer/src/infer/error_reporting/note.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::errors::{
2-
note_and_explain, BorrowedTooLong, FullfillReqLifetime, LfBoundNotSatisfied, OutlivesBound,
3-
OutlivesContent, RefLongerThanData, RegionOriginNote,
2+
note_and_explain, FullfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, OutlivesContent,
3+
RefLongerThanData, RegionOriginNote,
44
};
55
use crate::infer::error_reporting::{note_and_explain_region, TypeErrCtxt};
66
use crate::infer::{self, SubregionOrigin};
@@ -200,28 +200,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
200200
}
201201
.into_diagnostic(&self.tcx.sess.parse_sess.span_diagnostic)
202202
}
203-
infer::DataBorrowed(ty, span) => {
204-
let type_valid = note_and_explain::RegionExplanation::new(
205-
self.tcx,
206-
sub,
207-
None,
208-
note_and_explain::PrefixKind::TypeValidFor,
209-
note_and_explain::SuffixKind::Empty,
210-
);
211-
let borrow_lasts_for = note_and_explain::RegionExplanation::new(
212-
self.tcx,
213-
sup,
214-
None,
215-
note_and_explain::PrefixKind::BorrowLastsFor,
216-
note_and_explain::SuffixKind::Empty,
217-
);
218-
BorrowedTooLong {
219-
span,
220-
ty: self.resolve_vars_if_possible(ty),
221-
notes: type_valid.into_iter().chain(borrow_lasts_for).collect(),
222-
}
223-
.into_diagnostic(&self.tcx.sess.parse_sess.span_diagnostic)
224-
}
225203
infer::ReferenceOutlivesReferent(ty, span) => {
226204
let pointer_valid = note_and_explain::RegionExplanation::new(
227205
self.tcx,

0 commit comments

Comments
 (0)