Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #128142

Merged
merged 27 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
91af6b5
Add edge-case examples to `{count,leading,trailing}_{ones,zeros}` met…
fitzgen Jul 2, 2024
6519c14
Reset sigpipe not supported for vxworks
Jul 8, 2024
287b66b
size_of_val_raw: for length 0 this is safe to call
RalfJung Jun 8, 2024
f6fe7e4
lib: replace some `mem::forget`'s with `ManuallyDrop`
GrigorenkoPV Jul 14, 2024
c807ac0
Use verbose suggestion for "wrong # of generics"
estebank Jul 5, 2024
5c2b36a
Change suggestion message wording
estebank Jul 5, 2024
b30fdec
On generic and lifetime removal suggestion, do not leave behind stray…
estebank Jul 5, 2024
921de9d
Revert suggestion verbosity change
estebank Jul 22, 2024
2561d91
Allow unused unsafe for vxworks in read_at and write at
Jul 23, 2024
a598ca0
Disable dirfd for vxworks, Return unsupported error from set_times an…
Jul 23, 2024
5c9f376
Cfg disable on_broken_pipe_flag_used() for vxworks
Jul 23, 2024
786ad3d
Update process vxworks, set default stack size of 256 Kib for vxworks…
Jul 23, 2024
23e346e
make tidy fast without compromising case alternation
donno2048 Jul 23, 2024
b82f878
Gate AsyncFn* under async_closure feature
compiler-errors Jul 23, 2024
0ea5694
Add chroot unsupported implementation for VxWorks
Jul 24, 2024
9b87fbc
Import `core::ffi::c_void` in more places
ChrisDenton Jul 24, 2024
7cd25b1
Forbid unsafe_op_in_unsafe_fn in sys/pal/windows
ChrisDenton Jul 24, 2024
ac26b88
Improve spans on evaluated `cfg_attr`s.
nnethercote Jul 24, 2024
130d15e
Rollup merge of #126152 - RalfJung:size_of_val_raw, r=saethlin
matthiaskrgr Jul 24, 2024
720c6f1
Rollup merge of #127252 - fitzgen:edge-cases-for-bitwise-operations, …
matthiaskrgr Jul 24, 2024
91c03ef
Rollup merge of #127374 - estebank:wrong-generic-args, r=oli-obk
matthiaskrgr Jul 24, 2024
122b0b2
Rollup merge of #127457 - donno2048:master, r=albertlarsan68
matthiaskrgr Jul 24, 2024
ce523d6
Rollup merge of #127480 - biabbas:vxworks, r=workingjubilee
matthiaskrgr Jul 24, 2024
34abb96
Rollup merge of #127733 - GrigorenkoPV:don't-forget, r=Amanieu
matthiaskrgr Jul 24, 2024
e342efe
Rollup merge of #128120 - compiler-errors:async-fn-name, r=oli-obk
matthiaskrgr Jul 24, 2024
f3a7c3f
Rollup merge of #128131 - ChrisDenton:stuff, r=workingjubilee
matthiaskrgr Jul 24, 2024
2dc88bf
Rollup merge of #128133 - nnethercote:fix-cfg_attr-spans, r=petrochenkov
matthiaskrgr Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change suggestion message wording
  • Loading branch information
estebank committed Jul 22, 2024
commit 5c2b36a21cabafb1f08e278f4c6ed61753a654cf
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {

let num_redundant_lt_args = lt_arg_spans.len() - self.num_expected_lifetime_args();
let msg_lifetimes = format!(
"remove {these} lifetime argument{s}",
these = pluralize!("this", num_redundant_lt_args),
"remove the lifetime argument{s}",
s = pluralize!(num_redundant_lt_args),
);

Expand Down Expand Up @@ -989,8 +988,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
let num_redundant_gen_args =
gen_arg_spans.len() - self.num_expected_type_or_const_args();
let msg_types_or_consts = format!(
"remove {these} generic argument{s}",
these = pluralize!("this", num_redundant_gen_args),
"remove the unnecessary generic argument{s}",
s = pluralize!(num_redundant_gen_args),
);

Expand Down Expand Up @@ -1036,7 +1034,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
.with_lo(self.path_segment.ident.span.hi());

let msg = format!(
"remove these {}generics",
"remove the unnecessary {}generics",
if self.gen_args.parenthesized == hir::GenericArgsParentheses::ParenSugar {
"parenthetical "
} else {
Expand Down
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ note: associated type defined here, with 0 generic parameters
|
LL | type Y<'a>;
| ^
help: remove these generics
help: remove the unnecessary generics
|
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
Expand Down Expand Up @@ -60,7 +60,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
Expand Down Expand Up @@ -95,7 +95,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/mismatched_arg_count.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: type alias defined here, with 1 lifetime parameter: `'a`
|
LL | type Alias<'a, T> = <T as Trait<'a>>::Assoc;
| ^^^^^ --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
LL + fn bar<'a, T: Trait<'a>>(_: Alias<'a, , T>) {}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/argument-suggestions/issue-100154.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: function defined here, with 0 generic parameters
LL | fn foo(i: impl std::fmt::Display) {}
| ^^^
= note: `impl Trait` cannot be explicitly specified as a generic argument
help: remove these generics
help: remove the unnecessary generics
|
LL - foo::<()>(());
LL + foo(());
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: struct defined here, with 0 lifetime parameters
|
LL | struct LockedMarket<T>(T);
| ^^^^^^^^^^^^
help: remove these generics
help: remove the unnecessary generics
|
LL - async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
LL + async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket {
Expand Down Expand Up @@ -43,7 +43,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct LockedMarket<T>(T);
| ^^^^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
LL + async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments we
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME>,
| ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments
|
help: remove this generic argument
help: remove the unnecessary generic argument
|
LL - Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME>,
LL + Dst: BikeshedIntrinsicFrom<Src, Context, >,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ note: struct defined here, with 2 generic parameters: `T`, `N`
|
LL | struct All<'a, T, const N: usize> {
| ^^^ - --------------
help: remove this generic argument
help: remove the unnecessary generic argument
|
LL - let a: All<_, _, _>;
LL + let a: All<_, _, >;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: function defined here, with 1 generic parameter: `N`
|
LL | fn foo<const N: usize>(
| ^^^ --------------
help: remove this generic argument
help: remove the unnecessary generic argument
|
LL - foo::<_, L>([(); L + 1 + L]);
LL + foo::<_, >([(); L + 1 + L]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ note: associated type defined here, with 0 generic parameters
|
LL | type Y<'a>;
| ^
help: remove these generics
help: remove the unnecessary generics
|
LL - fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f2<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
Expand Down Expand Up @@ -60,7 +60,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f2<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
Expand Down Expand Up @@ -95,7 +95,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f2<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ note: function defined here, with 2 generic parameters: `X`, `Y`
|
LL | fn foo<const X: usize, const Y: usize>() -> usize {
| ^^^ -------------- --------------
help: remove this generic argument
help: remove the unnecessary generic argument
|
LL - foo::<0, 0, 0>();
LL + foo::<0, 0, >();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ help: consider moving this generic argument to the `TryInto` trait, which takes
|
LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: remove these generics
help: remove the unnecessary generics
|
LL - let _: u32 = 5i32.try_into::<32>().unwrap();
LL + let _: u32 = 5i32.try_into().unwrap();
Expand All @@ -34,7 +34,7 @@ note: struct defined here, with 0 generic parameters
|
LL | struct S;
| ^
help: remove these generics
help: remove the unnecessary generics
|
LL - S::<0>;
LL + S;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/const-generics/invalid-constant-in-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl
LL | let _: Cell<&str, "a"> = Cell::new("");
| ^^^^ expected 1 generic argument
|
help: remove this generic argument
help: remove the unnecessary generic argument
|
LL - let _: Cell<&str, "a"> = Cell::new("");
LL + let _: Cell<&str, > = Cell::new("");
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/constructor-lifetime-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
|
LL | struct S<'a, 'b>(&'a u8, &'b u8);
| ^ -- --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - S::<'static, 'static, 'static>(&0, &0);
LL + S::<'static, 'static, >(&0, &0);
Expand Down Expand Up @@ -62,7 +62,7 @@ note: enum defined here, with 2 lifetime parameters: `'a`, `'b`
|
LL | enum E<'a, 'b> {
| ^ -- --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - E::V::<'static, 'static, 'static>(&0);
LL + E::V::<'static, 'static, >(&0);
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/consts/effect_param.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
LL | i8::checked_sub::<false>(42, 43);
| ^^^^^^^^^^^ expected 0 generic arguments
|
help: remove these generics
help: remove the unnecessary generics
|
LL - i8::checked_sub::<false>(42, 43);
LL + i8::checked_sub(42, 43);
Expand All @@ -16,7 +16,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
LL | i8::checked_sub::<true>(42, 43);
| ^^^^^^^^^^^ expected 0 generic arguments
|
help: remove these generics
help: remove the unnecessary generics
|
LL - i8::checked_sub::<true>(42, 43);
LL + i8::checked_sub(42, 43);
Expand All @@ -28,7 +28,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
LL | i8::checked_sub::<true>(42, 43);
| ^^^^^^^^^^^ expected 0 generic arguments
|
help: remove these generics
help: remove the unnecessary generics
|
LL - i8::checked_sub::<true>(42, 43);
LL + i8::checked_sub(42, 43);
Expand All @@ -40,7 +40,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
LL | i8::checked_sub::<false>(42, 43);
| ^^^^^^^^^^^ expected 0 generic arguments
|
help: remove these generics
help: remove the unnecessary generics
|
LL - i8::checked_sub::<false>(42, 43);
LL + i8::checked_sub(42, 43);
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/error-codes/E0107.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ struct Baz<'a, 'b, 'c> {

bar: Bar<'a>,
//~^ ERROR enum takes 0 lifetime arguments
//~| HELP remove these generics
//~| HELP remove the unnecessary generics

foo2: Foo<'a, 'b, 'c>,
//~^ ERROR struct takes 1 lifetime argument
//~| HELP remove these lifetime arguments
//~| HELP remove the lifetime arguments

qux1: Qux<'a, 'b, i32>,
//~^ ERROR struct takes 1 lifetime argument
//~| HELP remove this lifetime argument
//~| HELP remove the lifetime argument

qux2: Qux<'a, i32, 'b>,
//~^ ERROR struct takes 1 lifetime argument
//~| HELP remove this lifetime argument
//~| HELP remove the lifetime argument

qux3: Qux<'a, 'b, 'c, i32>,
//~^ ERROR struct takes 1 lifetime argument
//~| HELP remove these lifetime arguments
//~| HELP remove the lifetime arguments

qux4: Qux<'a, i32, 'b, 'c>,
//~^ ERROR struct takes 1 lifetime argument
//~| HELP remove these lifetime arguments
//~| HELP remove the lifetime arguments

qux5: Qux<'a, 'b, i32, 'c>,
//~^ ERROR struct takes 1 lifetime argument
//~| HELP remove this lifetime argument
//~| HELP remove the lifetime argument

quux: Quux<'a, i32, 'b>,
//~^ ERROR struct takes 0 lifetime arguments
//~| HELP remove this lifetime argument
//~| HELP remove the lifetime argument
}

pub trait T {
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/error-codes/E0107.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ note: enum defined here, with 0 lifetime parameters
|
LL | enum Bar {
| ^^^
help: remove these generics
help: remove the unnecessary generics
|
LL - bar: Bar<'a>,
LL + bar: Bar,
Expand All @@ -44,7 +44,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
|
LL | struct Foo<'a>(&'a str);
| ^^^ --
help: remove these lifetime arguments
help: remove the lifetime arguments
|
LL - foo2: Foo<'a, 'b, 'c>,
LL + foo2: Foo<'a, >,
Expand All @@ -61,7 +61,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
|
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - qux1: Qux<'a, 'b, i32>,
LL + qux1: Qux<'a, , i32>,
Expand All @@ -78,7 +78,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
|
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - qux2: Qux<'a, i32, 'b>,
LL + qux2: Qux<'a, i32, >,
Expand All @@ -95,7 +95,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
|
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
help: remove these lifetime arguments
help: remove the lifetime arguments
|
LL - qux3: Qux<'a, 'b, 'c, i32>,
LL + qux3: Qux<'a, , i32>,
Expand All @@ -112,7 +112,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
|
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
help: remove these lifetime arguments
help: remove the lifetime arguments
|
LL - qux4: Qux<'a, i32, 'b, 'c>,
LL + qux4: Qux<'a, i32, >,
Expand All @@ -129,7 +129,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
|
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - qux5: Qux<'a, 'b, i32, 'c>,
LL + qux5: Qux<'a, , i32, 'c>,
Expand All @@ -146,7 +146,7 @@ note: struct defined here, with 0 lifetime parameters
|
LL | struct Quux<T>(T);
| ^^^^
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - quux: Quux<'a, i32, 'b>,
LL + quux: Quux<, i32, 'b>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ note: associated type defined here, with 0 generic parameters
|
LL | type Y<'a>;
| ^
help: remove these generics
help: remove the unnecessary generics
|
LL - fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
LL + fn foo<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
Expand Down Expand Up @@ -85,7 +85,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
LL + fn foo<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
Expand Down Expand Up @@ -120,7 +120,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
help: remove the unnecessary generics
|
LL - fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
LL + fn foo<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: associated type defined here, with 1 lifetime parameter: `'a`
|
LL | type E<'a, T>;
| ^ --
help: remove this lifetime argument
help: remove the lifetime argument
|
LL - type FErr1 = Self::E<'static, 'static>;
LL + type FErr1 = Self::E<'static, >;
Expand Down Expand Up @@ -42,7 +42,7 @@ note: associated type defined here, with 1 generic parameter: `T`
|
LL | type E<'a, T>;
| ^ -
help: remove this generic argument
help: remove the unnecessary generic argument
|
LL - type FErr2<T> = Self::E<'static, T, u32>;
LL + type FErr2<T> = Self::E<'static, T, >;
Expand Down
Loading