Skip to content

Commit d4742e7

Browse files
committed
Auto merge of #18366 - Veykril:veykril/push-uvwvwzxnkmnz, r=Veykril
Fix status bar message not being marked markdown Closes rust-lang/rust-analyzer#18323
2 parents 5087af2 + 76368b8 commit d4742e7

File tree

25 files changed

+81
-58
lines changed

25 files changed

+81
-58
lines changed

src/tools/rust-analyzer/crates/hir-def/src/lower.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<'a> OuterImplTraitGuard<'a> {
3434
}
3535
}
3636

37-
impl<'a> Drop for OuterImplTraitGuard<'a> {
37+
impl Drop for OuterImplTraitGuard<'_> {
3838
fn drop(&mut self) {
3939
self.ctx.outer_impl_trait.replace(self.old);
4040
}

src/tools/rust-analyzer/crates/hir-expand/src/hygiene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub(crate) fn dump_syntax_contexts(db: &dyn ExpandDatabase) -> String {
227227
&'a SyntaxContextData,
228228
);
229229

230-
impl<'a> std::fmt::Debug for SyntaxContextDebug<'a> {
230+
impl std::fmt::Debug for SyntaxContextDebug<'_> {
231231
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
232232
fancy_debug(self.2, self.1, self.0, f)
233233
}

src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'table, 'db> Autoderef<'table, 'db, usize> {
114114
}
115115

116116
#[allow(private_bounds)]
117-
impl<'table, 'db, T: TrackAutoderefSteps> Autoderef<'table, 'db, T> {
117+
impl<T: TrackAutoderefSteps> Autoderef<'_, '_, T> {
118118
pub(crate) fn step_count(&self) -> usize {
119119
self.steps.len()
120120
}

src/tools/rust-analyzer/crates/hir-ty/src/chalk_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ impl chalk_solve::RustIrDatabase<Interner> for ChalkContext<'_> {
521521
}
522522
}
523523

524-
impl<'a> ChalkContext<'a> {
524+
impl ChalkContext<'_> {
525525
fn edition(&self) -> Edition {
526526
self.db.crate_graph()[self.krate].edition
527527
}

src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ impl<'db> PatCx for MatchCheckCtx<'db> {
519519
}
520520
}
521521

522-
impl<'db> fmt::Debug for MatchCheckCtx<'db> {
522+
impl fmt::Debug for MatchCheckCtx<'_> {
523523
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
524524
f.debug_struct("MatchCheckCtx").finish()
525525
}

src/tools/rust-analyzer/crates/hir-ty/src/dyn_compatibility.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ fn contains_illegal_self_type_reference<T: TypeVisitable<Interner>>(
266266
trait_self_param_idx: usize,
267267
allow_self_projection: AllowSelfProjection,
268268
}
269-
impl<'a> TypeVisitor<Interner> for IllegalSelfTypeVisitor<'a> {
269+
impl TypeVisitor<Interner> for IllegalSelfTypeVisitor<'_> {
270270
type BreakTy = ();
271271

272272
fn as_dyn(&mut self) -> &mut dyn TypeVisitor<Interner, BreakTy = Self::BreakTy> {

src/tools/rust-analyzer/crates/hir-ty/src/infer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ impl<'a> InferenceContext<'a> {
10221022
non_assocs: FxHashMap<OpaqueTyId, Ty>,
10231023
}
10241024

1025-
impl<'a, 'b> TypeVisitor<Interner> for TypeAliasImplTraitCollector<'a, 'b> {
1025+
impl TypeVisitor<Interner> for TypeAliasImplTraitCollector<'_, '_> {
10261026
type BreakTy = ();
10271027

10281028
fn as_dyn(&mut self) -> &mut dyn TypeVisitor<Interner, BreakTy = Self::BreakTy> {

src/tools/rust-analyzer/crates/hir-ty/src/mir.rs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,8 @@ pub enum Rvalue {
879879
///
880880
/// **Needs clarification**: Are there weird additional semantics here related to the runtime
881881
/// nature of this operation?
882-
//ThreadLocalRef(DefId),
882+
// ThreadLocalRef(DefId),
883+
ThreadLocalRef(std::convert::Infallible),
883884

884885
/// Creates a pointer with the indicated mutability to the place.
885886
///
@@ -888,7 +889,8 @@ pub enum Rvalue {
888889
///
889890
/// Like with references, the semantics of this operation are heavily dependent on the aliasing
890891
/// model.
891-
//AddressOf(Mutability, Place),
892+
// AddressOf(Mutability, Place),
893+
AddressOf(std::convert::Infallible),
892894

893895
/// Yields the length of the place, as a `usize`.
894896
///
@@ -906,19 +908,21 @@ pub enum Rvalue {
906908
Cast(CastKind, Operand, Ty),
907909

908910
// FIXME link to `pointer::offset` when it hits stable.
909-
// /// * `Offset` has the same semantics as `pointer::offset`, except that the second
910-
// /// parameter may be a `usize` as well.
911-
// /// * The comparison operations accept `bool`s, `char`s, signed or unsigned integers, floats,
912-
// /// raw pointers, or function pointers and return a `bool`. The types of the operands must be
913-
// /// matching, up to the usual caveat of the lifetimes in function pointers.
914-
// /// * Left and right shift operations accept signed or unsigned integers not necessarily of the
915-
// /// same type and return a value of the same type as their LHS. Like in Rust, the RHS is
916-
// /// truncated as needed.
917-
// /// * The `Bit*` operations accept signed integers, unsigned integers, or bools with matching
918-
// /// types and return a value of that type.
919-
// /// * The remaining operations accept signed integers, unsigned integers, or floats with
920-
// /// matching types and return a value of that type.
911+
/// * `Offset` has the same semantics as `pointer::offset`, except that the second
912+
/// parameter may be a `usize` as well.
913+
/// * The comparison operations accept `bool`s, `char`s, signed or unsigned integers, floats,
914+
/// raw pointers, or function pointers and return a `bool`. The types of the operands must be
915+
/// matching, up to the usual caveat of the lifetimes in function pointers.
916+
/// * Left and right shift operations accept signed or unsigned integers not necessarily of the
917+
/// same type and return a value of the same type as their LHS. Like in Rust, the RHS is
918+
/// truncated as needed.
919+
/// * The `Bit*` operations accept signed integers, unsigned integers, or bools with matching
920+
/// types and return a value of that type.
921+
/// * The remaining operations accept signed integers, unsigned integers, or floats with
922+
/// matching types and return a value of that type.
921923
//BinaryOp(BinOp, Box<(Operand, Operand)>),
924+
BinaryOp(std::convert::Infallible),
925+
922926
/// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition.
923927
///
924928
/// When overflow checking is disabled and we are generating run-time code, the error condition
@@ -937,6 +941,7 @@ pub enum Rvalue {
937941

938942
/// Computes a value as described by the operation.
939943
//NullaryOp(NullOp, Ty),
944+
NullaryOp(std::convert::Infallible),
940945

941946
/// Exactly like `BinaryOp`, but less operands.
942947
///
@@ -1095,6 +1100,10 @@ impl MirBody {
10951100
for_operand(op, &mut f, &mut self.projection_store);
10961101
}
10971102
}
1103+
Rvalue::ThreadLocalRef(n)
1104+
| Rvalue::AddressOf(n)
1105+
| Rvalue::BinaryOp(n)
1106+
| Rvalue::NullaryOp(n) => match *n {},
10981107
}
10991108
}
11001109
StatementKind::FakeRead(p) | StatementKind::Deinit(p) => {

src/tools/rust-analyzer/crates/hir-ty/src/mir/borrowck.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ fn moved_out_of_ref(db: &dyn HirDatabase, body: &MirBody) -> Vec<MovedOutOfRef>
167167
for_operand(op, statement.span);
168168
}
169169
}
170+
Rvalue::ThreadLocalRef(n)
171+
| Rvalue::AddressOf(n)
172+
| Rvalue::BinaryOp(n)
173+
| Rvalue::NullaryOp(n) => match *n {},
170174
},
171175
StatementKind::FakeRead(_)
172176
| StatementKind::Deinit(_)
@@ -253,6 +257,10 @@ fn partially_moved(db: &dyn HirDatabase, body: &MirBody) -> Vec<PartiallyMoved>
253257
for_operand(op, statement.span);
254258
}
255259
}
260+
Rvalue::ThreadLocalRef(n)
261+
| Rvalue::AddressOf(n)
262+
| Rvalue::BinaryOp(n)
263+
| Rvalue::NullaryOp(n) => match *n {},
256264
},
257265
StatementKind::FakeRead(_)
258266
| StatementKind::Deinit(_)
@@ -548,6 +556,10 @@ fn mutability_of_locals(
548556
}
549557
}
550558
Rvalue::ShallowInitBox(_, _) | Rvalue::ShallowInitBoxWithAlloc(_) => (),
559+
Rvalue::ThreadLocalRef(n)
560+
| Rvalue::AddressOf(n)
561+
| Rvalue::BinaryOp(n)
562+
| Rvalue::NullaryOp(n) => match *n {},
551563
}
552564
if let Rvalue::Ref(
553565
BorrowKind::Mut {

src/tools/rust-analyzer/crates/hir-ty/src/mir/eval.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,6 +1628,10 @@ impl Evaluator<'_> {
16281628
}
16291629
CastKind::FnPtrToPtr => not_supported!("fn ptr to ptr cast"),
16301630
},
1631+
Rvalue::ThreadLocalRef(n)
1632+
| Rvalue::AddressOf(n)
1633+
| Rvalue::BinaryOp(n)
1634+
| Rvalue::NullaryOp(n) => match *n {},
16311635
})
16321636
}
16331637

@@ -2703,17 +2707,15 @@ impl Evaluator<'_> {
27032707
TyKind::Function(_) => {
27042708
self.exec_fn_pointer(func_data, destination, &args[1..], locals, target_bb, span)
27052709
}
2706-
TyKind::Closure(closure, subst) => {
2707-
return self.exec_closure(
2708-
*closure,
2709-
func_data,
2710-
&Substitution::from_iter(Interner, ClosureSubst(subst).parent_subst()),
2711-
destination,
2712-
&args[1..],
2713-
locals,
2714-
span,
2715-
);
2716-
}
2710+
TyKind::Closure(closure, subst) => self.exec_closure(
2711+
*closure,
2712+
func_data,
2713+
&Substitution::from_iter(Interner, ClosureSubst(subst).parent_subst()),
2714+
destination,
2715+
&args[1..],
2716+
locals,
2717+
span,
2718+
),
27172719
_ => {
27182720
// try to execute the manual impl of `FnTrait` for structs (nightly feature used in std)
27192721
let arg0 = func;

0 commit comments

Comments
 (0)