Skip to content

Commit 23c2723

Browse files
committed
Auto merge of #92003 - matthiaskrgr:rollup-obgv0rt, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #91172 (Warn when a `#[test]`-like built-in attribute macro is present multiple times.) - #91796 (Fix since attribute for const_manually_drop feature) - #91879 (Remove `in_band_lifetimes` from `rustc_borrowck`) - #91947 (Add `io::Error::other`) - #91967 (Pull in libdevstat on FreeBSD) - #91987 (Add module documentation for rustdoc passes) - #92001 (Fix default_method_body_is_const when used across crates) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5531927 + a97384d commit 23c2723

Some content is hidden

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

41 files changed

+250
-42
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3688,6 +3688,7 @@ dependencies = [
36883688
"rustc_expand",
36893689
"rustc_feature",
36903690
"rustc_lexer",
3691+
"rustc_lint_defs",
36913692
"rustc_parse",
36923693
"rustc_parse_format",
36933694
"rustc_session",

compiler/rustc_borrowck/src/borrow_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub enum LocalsStateAtExit {
8484
}
8585

8686
impl LocalsStateAtExit {
87-
fn build(
87+
fn build<'tcx>(
8888
locals_are_invalidated_at_exit: bool,
8989
body: &Body<'tcx>,
9090
move_data: &MoveData<'tcx>,

compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum UniverseInfoInner<'tcx> {
3131
Other,
3232
}
3333

34-
impl UniverseInfo<'tcx> {
34+
impl<'tcx> UniverseInfo<'tcx> {
3535
crate fn other() -> UniverseInfo<'tcx> {
3636
UniverseInfo(UniverseInfoInner::Other)
3737
}
@@ -191,7 +191,7 @@ struct PredicateQuery<'tcx> {
191191
base_universe: ty::UniverseIndex,
192192
}
193193

194-
impl TypeOpInfo<'tcx> for PredicateQuery<'tcx> {
194+
impl<'tcx> TypeOpInfo<'tcx> for PredicateQuery<'tcx> {
195195
fn fallback_error(&self, tcx: TyCtxt<'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
196196
let mut err = tcx.sess.struct_span_err(span, "higher-ranked lifetime error");
197197
err.note(&format!("could not prove {}", self.canonical_query.value.value.predicate));
@@ -231,7 +231,7 @@ struct NormalizeQuery<'tcx, T> {
231231
base_universe: ty::UniverseIndex,
232232
}
233233

234-
impl<T> TypeOpInfo<'tcx> for NormalizeQuery<'tcx, T>
234+
impl<'tcx, T> TypeOpInfo<'tcx> for NormalizeQuery<'tcx, T>
235235
where
236236
T: Copy + fmt::Display + TypeFoldable<'tcx> + 'tcx,
237237
{
@@ -291,7 +291,7 @@ struct AscribeUserTypeQuery<'tcx> {
291291
base_universe: ty::UniverseIndex,
292292
}
293293

294-
impl TypeOpInfo<'tcx> for AscribeUserTypeQuery<'tcx> {
294+
impl<'tcx> TypeOpInfo<'tcx> for AscribeUserTypeQuery<'tcx> {
295295
fn fallback_error(&self, tcx: TyCtxt<'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
296296
// FIXME: This error message isn't great, but it doesn't show up in the existing UI tests,
297297
// and is only the fallback when the nice error fails. Consider improving this some more.

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,8 +1598,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15981598
location: Location,
15991599
mpi: MovePathIndex,
16001600
) -> (Vec<MoveSite>, Vec<Location>) {
1601-
fn predecessor_locations(
1602-
body: &'a mir::Body<'tcx>,
1601+
fn predecessor_locations<'a>(
1602+
body: &'a mir::Body<'_>,
16031603
location: Location,
16041604
) -> impl Iterator<Item = Location> + 'a {
16051605
if location.statement_index == 0 {

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
409409
/// Add a note that a type does not implement `Copy`
410410
pub(super) fn note_type_does_not_implement_copy(
411411
&self,
412-
err: &mut DiagnosticBuilder<'a>,
412+
err: &mut DiagnosticBuilder<'_>,
413413
place_desc: &str,
414414
ty: Ty<'tcx>,
415415
span: Option<Span>,
@@ -733,7 +733,7 @@ pub(super) enum BorrowedContentSource<'tcx> {
733733
OverloadedIndex(Ty<'tcx>),
734734
}
735735

736-
impl BorrowedContentSource<'tcx> {
736+
impl<'tcx> BorrowedContentSource<'tcx> {
737737
pub(super) fn describe_for_unnamed_place(&self, tcx: TyCtxt<'_>) -> String {
738738
match *self {
739739
BorrowedContentSource::DerefRawPointer => "a raw pointer".to_string(),

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
747747
HirId, ImplItem, ImplItemKind, Item, ItemKind,
748748
};
749749

750-
fn maybe_body_id_of_fn(hir_map: &Map<'tcx>, id: HirId) -> Option<BodyId> {
750+
fn maybe_body_id_of_fn(hir_map: &Map<'_>, id: HirId) -> Option<BodyId> {
751751
match hir_map.find(id) {
752752
Some(Node::Item(Item { kind: ItemKind::Fn(_, _, body_id), .. }))
753753
| Some(Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(_, body_id), .. })) => {
@@ -1066,7 +1066,7 @@ fn is_closure_or_generator(ty: Ty<'_>) -> bool {
10661066
/// LL | s: &'a String
10671067
/// | ---------- use `&'a mut String` here to make mutable
10681068
/// ```
1069-
fn annotate_struct_field(
1069+
fn annotate_struct_field<'tcx>(
10701070
tcx: TyCtxt<'tcx>,
10711071
ty: Ty<'tcx>,
10721072
field: &mir::Field,

compiler/rustc_borrowck/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(bool_to_option)]
44
#![feature(box_patterns)]
55
#![feature(crate_visibility_modifier)]
6-
#![feature(in_band_lifetimes)]
76
#![feature(let_else)]
87
#![feature(min_specialization)]
98
#![feature(stmt_expr_attributes)]

compiler/rustc_borrowck/src/member_constraints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ rustc_index::newtype_index! {
5353
}
5454
}
5555

56-
impl Default for MemberConstraintSet<'tcx, ty::RegionVid> {
56+
impl Default for MemberConstraintSet<'_, ty::RegionVid> {
5757
fn default() -> Self {
5858
Self {
5959
first_constraints: Default::default(),
@@ -97,7 +97,7 @@ impl<'tcx> MemberConstraintSet<'tcx, ty::RegionVid> {
9797
}
9898
}
9999

100-
impl<R1> MemberConstraintSet<'tcx, R1>
100+
impl<'tcx, R1> MemberConstraintSet<'tcx, R1>
101101
where
102102
R1: Copy + Hash + Eq,
103103
{
@@ -140,7 +140,7 @@ where
140140
}
141141
}
142142

143-
impl<R> MemberConstraintSet<'tcx, R>
143+
impl<R> MemberConstraintSet<'_, R>
144144
where
145145
R: Copy + Hash + Eq,
146146
{

compiler/rustc_borrowck/src/path_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub(super) fn borrow_of_local_data(place: Place<'_>) -> bool {
141141
/// then returns the index of the field being projected. Note that this closure will always
142142
/// be `self` in the current MIR, because that is the only time we directly access the fields
143143
/// of a closure type.
144-
pub(crate) fn is_upvar_field_projection(
144+
pub(crate) fn is_upvar_field_projection<'tcx>(
145145
tcx: TyCtxt<'tcx>,
146146
upvars: &[Upvar<'tcx>],
147147
place_ref: PlaceRef<'tcx>,

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ crate struct CreateResult<'tcx> {
5858
crate normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
5959
}
6060

61-
crate fn create(
61+
crate fn create<'tcx>(
6262
infcx: &InferCtxt<'_, 'tcx>,
6363
param_env: ty::ParamEnv<'tcx>,
6464
implicit_region_bound: Option<ty::Region<'tcx>>,
@@ -81,7 +81,7 @@ crate fn create(
8181
.create()
8282
}
8383

84-
impl UniversalRegionRelations<'tcx> {
84+
impl UniversalRegionRelations<'_> {
8585
/// Records in the `outlives_relation` (and
8686
/// `inverse_outlives_relation`) that `fr_a: fr_b`. Invoked by the
8787
/// builder below.
@@ -110,7 +110,7 @@ impl UniversalRegionRelations<'tcx> {
110110
/// outlives `fr` and (b) is not local.
111111
///
112112
/// (*) If there are multiple competing choices, we return all of them.
113-
crate fn non_local_upper_bounds(&'a self, fr: &'a RegionVid) -> Vec<&'a RegionVid> {
113+
crate fn non_local_upper_bounds<'a>(&'a self, fr: &'a RegionVid) -> Vec<&'a RegionVid> {
114114
debug!("non_local_upper_bound(fr={:?})", fr);
115115
let res = self.non_local_bounds(&self.inverse_outlives, fr);
116116
assert!(!res.is_empty(), "can't find an upper bound!?");
@@ -232,7 +232,7 @@ struct UniversalRegionRelationsBuilder<'this, 'tcx> {
232232
region_bound_pairs: RegionBoundPairs<'tcx>,
233233
}
234234

235-
impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
235+
impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
236236
crate fn create(mut self) -> CreateResult<'tcx> {
237237
let unnormalized_input_output_tys = self
238238
.universal_regions

0 commit comments

Comments
 (0)