Skip to content

Commit 69a626c

Browse files
authored
Update to Rust v1.83 (#4293)
1 parent 085f912 commit 69a626c

File tree

17 files changed

+38
-37
lines changed

17 files changed

+38
-37
lines changed

crates/backend/src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ struct DescribeImport<'a> {
15001500
wasm_bindgen: &'a syn::Path,
15011501
}
15021502

1503-
impl<'a> ToTokens for DescribeImport<'a> {
1503+
impl ToTokens for DescribeImport<'_> {
15041504
fn to_tokens(&self, tokens: &mut TokenStream) {
15051505
let f = match *self.kind {
15061506
ast::ImportKind::Function(ref f) => f,
@@ -1838,7 +1838,7 @@ struct Descriptor<'a, T> {
18381838
wasm_bindgen: &'a syn::Path,
18391839
}
18401840

1841-
impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> {
1841+
impl<T: ToTokens> ToTokens for Descriptor<'_, T> {
18421842
fn to_tokens(&self, tokens: &mut TokenStream) {
18431843
// It's possible for the same descriptor to be emitted in two different
18441844
// modules (aka a value imported twice in a crate, each in a separate

crates/backend/src/encode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ enum LitOrExpr<'a> {
406406
Lit(&'a str),
407407
}
408408

409-
impl<'a> Encode for LitOrExpr<'a> {
409+
impl Encode for LitOrExpr<'_> {
410410
fn encode(&self, dst: &mut Encoder) {
411411
match self {
412412
LitOrExpr::Expr(expr) => {
@@ -468,14 +468,14 @@ impl Encode for usize {
468468
}
469469
}
470470

471-
impl<'a> Encode for &'a [u8] {
471+
impl Encode for &[u8] {
472472
fn encode(&self, dst: &mut Encoder) {
473473
self.len().encode(dst);
474474
dst.extend_from_slice(self);
475475
}
476476
}
477477

478-
impl<'a> Encode for &'a str {
478+
impl Encode for &str {
479479
fn encode(&self, dst: &mut Encoder) {
480480
self.as_bytes().encode(dst);
481481
}

crates/cli-support/src/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn get(b: &mut &[u8]) -> u8 {
2020
r
2121
}
2222

23-
impl<'src> Deref for LitOrExpr<'src> {
23+
impl Deref for LitOrExpr<'_> {
2424
type Target = str;
2525
fn deref(&self) -> &Self::Target {
2626
self.str

crates/cli-support/src/descriptors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl WasmBindgenDescriptorsSection {
193193
found: bool,
194194
}
195195

196-
impl<'a> Visitor<'a> for FindDescribeClosure {
196+
impl Visitor<'_> for FindDescribeClosure {
197197
fn visit_call(&mut self, call: &Call) {
198198
if call.func == self.wbindgen_describe_closure {
199199
self.found = true;

crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ impl<'a> BackgroundChild<'a> {
669669
}
670670
}
671671

672-
impl<'a> Drop for BackgroundChild<'a> {
672+
impl Drop for BackgroundChild<'_> {
673673
fn drop(&mut self) {
674674
self.child.kill().unwrap();
675675
let status = self.child.wait().unwrap();

crates/js-sys/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ pub struct ArrayIter<'a> {
707707
array: &'a Array,
708708
}
709709

710-
impl<'a> core::iter::Iterator for ArrayIter<'a> {
710+
impl core::iter::Iterator for ArrayIter<'_> {
711711
type Item = JsValue;
712712

713713
fn next(&mut self) -> Option<Self::Item> {
@@ -743,7 +743,7 @@ impl<'a> core::iter::Iterator for ArrayIter<'a> {
743743
}
744744
}
745745

746-
impl<'a> core::iter::DoubleEndedIterator for ArrayIter<'a> {
746+
impl core::iter::DoubleEndedIterator for ArrayIter<'_> {
747747
fn next_back(&mut self) -> Option<Self::Item> {
748748
let index = self.range.next_back()?;
749749
Some(self.array.get(index))
@@ -754,9 +754,9 @@ impl<'a> core::iter::DoubleEndedIterator for ArrayIter<'a> {
754754
}
755755
}
756756

757-
impl<'a> core::iter::FusedIterator for ArrayIter<'a> {}
757+
impl core::iter::FusedIterator for ArrayIter<'_> {}
758758

759-
impl<'a> core::iter::ExactSizeIterator for ArrayIter<'a> {}
759+
impl core::iter::ExactSizeIterator for ArrayIter<'_> {}
760760

761761
impl Array {
762762
/// Returns an iterator over the values of the JS array.
@@ -2311,7 +2311,7 @@ impl<'a> IntoIterator for &'a Iterator {
23112311
}
23122312
}
23132313

2314-
impl<'a> core::iter::Iterator for Iter<'a> {
2314+
impl core::iter::Iterator for Iter<'_> {
23152315
type Item = Result<JsValue, JsValue>;
23162316

23172317
fn next(&mut self) -> Option<Self::Item> {

crates/macro-support/src/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ trait ConvertToAst<Ctx> {
422422
fn convert(self, context: Ctx) -> Result<Self::Target, Diagnostic>;
423423
}
424424

425-
impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs)> for &'a mut syn::ItemStruct {
425+
impl ConvertToAst<(&ast::Program, BindgenAttrs)> for &mut syn::ItemStruct {
426426
type Target = ast::Struct;
427427

428428
fn convert(
@@ -1188,7 +1188,7 @@ impl<'a> MacroParse<(Option<BindgenAttrs>, &'a mut TokenStream)> for syn::Item {
11881188
}
11891189
}
11901190

1191-
impl<'a> MacroParse<BindgenAttrs> for &'a mut syn::ItemImpl {
1191+
impl MacroParse<BindgenAttrs> for &mut syn::ItemImpl {
11921192
fn macro_parse(self, program: &mut ast::Program, opts: BindgenAttrs) -> Result<(), Diagnostic> {
11931193
if self.defaultness.is_some() {
11941194
bail_span!(
@@ -1292,7 +1292,7 @@ fn prepare_for_impl_recursion(
12921292
Ok(())
12931293
}
12941294

1295-
impl<'a> MacroParse<&ClassMarker> for &'a mut syn::ImplItemFn {
1295+
impl MacroParse<&ClassMarker> for &mut syn::ImplItemFn {
12961296
fn macro_parse(
12971297
self,
12981298
program: &mut ast::Program,

crates/webidl/src/idl_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ impl<'a> IdlType<'a> {
10931093
}
10941094
}
10951095

1096-
impl<'a> IdentifierType<'a> {
1096+
impl IdentifierType<'_> {
10971097
/// Converts to syn type if possible.
10981098
pub(crate) fn to_syn_type(
10991099
&self,

src/closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ where
471471
}
472472

473473
// `Closure` can only be passed by reference to imports.
474-
impl<'a, T> IntoWasmAbi for &'a Closure<T>
474+
impl<T> IntoWasmAbi for &Closure<T>
475475
where
476476
T: WasmClosure + ?Sized,
477477
{
@@ -482,7 +482,7 @@ where
482482
}
483483
}
484484

485-
impl<'a, T> OptionIntoWasmAbi for &'a Closure<T>
485+
impl<T> OptionIntoWasmAbi for &Closure<T>
486486
where
487487
T: WasmClosure + ?Sized,
488488
{

src/convert/closures.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ stack_closures! {
134134
(8 invoke8 invoke8_mut A a1 a2 a3 a4 B b1 b2 b3 b4 C c1 c2 c3 c4 D d1 d2 d3 d4 E e1 e2 e3 e4 F f1 f2 f3 f4 G g1 g2 g3 g4 H h1 h2 h3 h4)
135135
}
136136

137-
impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(&A) -> R + 'b)
137+
impl<A, R> IntoWasmAbi for &(dyn Fn(&A) -> R + '_)
138138
where
139139
A: RefFromWasmAbi,
140140
R: ReturnWasmAbi,
@@ -175,7 +175,7 @@ unsafe extern "C" fn invoke1_ref<A: RefFromWasmAbi, R: ReturnWasmAbi>(
175175
ret.return_abi().into()
176176
}
177177

178-
impl<'a, A, R> WasmDescribe for dyn Fn(&A) -> R + 'a
178+
impl<A, R> WasmDescribe for dyn Fn(&A) -> R + '_
179179
where
180180
A: RefFromWasmAbi,
181181
R: ReturnWasmAbi,
@@ -191,7 +191,7 @@ where
191191
}
192192
}
193193

194-
impl<'a, 'b, A, R> IntoWasmAbi for &'a mut (dyn FnMut(&A) -> R + 'b)
194+
impl<A, R> IntoWasmAbi for &mut (dyn FnMut(&A) -> R + '_)
195195
where
196196
A: RefFromWasmAbi,
197197
R: ReturnWasmAbi,
@@ -232,7 +232,7 @@ unsafe extern "C" fn invoke1_mut_ref<A: RefFromWasmAbi, R: ReturnWasmAbi>(
232232
ret.return_abi().into()
233233
}
234234

235-
impl<'a, A, R> WasmDescribe for dyn FnMut(&A) -> R + 'a
235+
impl<A, R> WasmDescribe for dyn FnMut(&A) -> R + '_
236236
where
237237
A: RefFromWasmAbi,
238238
R: ReturnWasmAbi,

src/convert/impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl FromWasmAbi for JsValue {
437437
}
438438
}
439439

440-
impl<'a> IntoWasmAbi for &'a JsValue {
440+
impl IntoWasmAbi for &JsValue {
441441
type Abi = u32;
442442

443443
#[inline]

src/convert/slices.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl<'a> IntoWasmAbi for &'a str {
362362
}
363363
}
364364

365-
impl<'a> OptionIntoWasmAbi for &'a str {
365+
impl OptionIntoWasmAbi for &str {
366366
#[inline]
367367
fn none() -> Self::Abi {
368368
null_slice()

src/describe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ impl<T: WasmDescribe> WasmDescribe for [T] {
144144
}
145145
}
146146

147-
impl<'a, T: WasmDescribe + ?Sized> WasmDescribe for &'a T {
147+
impl<T: WasmDescribe + ?Sized> WasmDescribe for &T {
148148
#[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))]
149149
fn describe() {
150150
inform(REF);
151151
T::describe();
152152
}
153153
}
154154

155-
impl<'a, T: WasmDescribe + ?Sized> WasmDescribe for &'a mut T {
155+
impl<T: WasmDescribe + ?Sized> WasmDescribe for &mut T {
156156
#[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))]
157157
fn describe() {
158158
inform(REFMUT);

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ pub mod __rt {
17331733
borrow: &'b Cell<usize>,
17341734
}
17351735

1736-
impl<'b, T: ?Sized> Deref for Ref<'b, T> {
1736+
impl<T: ?Sized> Deref for Ref<'_, T> {
17371737
type Target = T;
17381738

17391739
#[inline]
@@ -1742,14 +1742,14 @@ pub mod __rt {
17421742
}
17431743
}
17441744

1745-
impl<'b, T: ?Sized> Borrow<T> for Ref<'b, T> {
1745+
impl<T: ?Sized> Borrow<T> for Ref<'_, T> {
17461746
#[inline]
17471747
fn borrow(&self) -> &T {
17481748
self.value
17491749
}
17501750
}
17511751

1752-
impl<'b, T: ?Sized> Drop for Ref<'b, T> {
1752+
impl<T: ?Sized> Drop for Ref<'_, T> {
17531753
fn drop(&mut self) {
17541754
self.borrow.set(self.borrow.get() - 1);
17551755
}
@@ -1760,7 +1760,7 @@ pub mod __rt {
17601760
borrow: &'b Cell<usize>,
17611761
}
17621762

1763-
impl<'b, T: ?Sized> Deref for RefMut<'b, T> {
1763+
impl<T: ?Sized> Deref for RefMut<'_, T> {
17641764
type Target = T;
17651765

17661766
#[inline]
@@ -1769,28 +1769,28 @@ pub mod __rt {
17691769
}
17701770
}
17711771

1772-
impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
1772+
impl<T: ?Sized> DerefMut for RefMut<'_, T> {
17731773
#[inline]
17741774
fn deref_mut(&mut self) -> &mut T {
17751775
self.value
17761776
}
17771777
}
17781778

1779-
impl<'b, T: ?Sized> Borrow<T> for RefMut<'b, T> {
1779+
impl<T: ?Sized> Borrow<T> for RefMut<'_, T> {
17801780
#[inline]
17811781
fn borrow(&self) -> &T {
17821782
self.value
17831783
}
17841784
}
17851785

1786-
impl<'b, T: ?Sized> BorrowMut<T> for RefMut<'b, T> {
1786+
impl<T: ?Sized> BorrowMut<T> for RefMut<'_, T> {
17871787
#[inline]
17881788
fn borrow_mut(&mut self) -> &mut T {
17891789
self.value
17901790
}
17911791
}
17921792

1793-
impl<'b, T: ?Sized> Drop for RefMut<'b, T> {
1793+
impl<T: ?Sized> Drop for RefMut<'_, T> {
17941794
fn drop(&mut self) {
17951795
self.borrow.set(0);
17961796
}

tests/wasm/import_class.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ extern "C" {
9393
/// dox
9494
pub fn foo();
9595

96+
/// dox
9697
pub type Options;
9798
#[wasm_bindgen(constructor)]
9899
fn new() -> Options;

tests/wasm/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct ResetOnDrop<'a> {
6363
flag: &'a mut bool,
6464
}
6565

66-
impl<'a> Drop for ResetOnDrop<'a> {
66+
impl Drop for ResetOnDrop<'_> {
6767
fn drop(&mut self) {
6868
*self.flag = false;
6969
}

tests/wasm/result_jserror.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct ResetOnDrop<'a> {
6060
flag: &'a mut bool,
6161
}
6262

63-
impl<'a> Drop for ResetOnDrop<'a> {
63+
impl Drop for ResetOnDrop<'_> {
6464
fn drop(&mut self) {
6565
*self.flag = false;
6666
}

0 commit comments

Comments
 (0)