Skip to content

Rollup of 13 pull requests #142333

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

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b2bfa10
Add discriminant_for_variant to AdtDef
NotLebedev May 27, 2025
a2d5942
Add discriminant_for_variant to CoroutineDef
NotLebedev May 27, 2025
7d13f8d
Implement Stable for Discr
NotLebedev Mar 27, 2025
becdd21
Add test for `AdtDef::discriminant_for_variant`
NotLebedev Jun 4, 2025
a39e98f
Add test for `AdtDef::discriminant_for_variant` polymorphic over para…
NotLebedev Jun 4, 2025
443e45c
Fix test description
NotLebedev Jun 6, 2025
3fce086
Make E0621 missing lifetime suggestion verbose
estebank Jun 4, 2025
643a9d2
tests: Change "fastcall" to "system" in some tests
workingjubilee Jun 6, 2025
518eb0d
rustdoc-json: Rearrange deck chairs in ABI testing
workingjubilee Jun 2, 2025
5906998
tests: Copy dont-shuffle-bswaps per tested opt level
workingjubilee Jun 7, 2025
cb3d074
Only run `citool` tests on the `auto` branch
Kobzol Jun 10, 2025
6b0deb2
tests: Revise dont-shuffle-bswaps-opt3 per tested arch
workingjubilee Jun 7, 2025
de8a91b
Add supported asm types for LoongArch32
heiher Jun 9, 2025
8ef8062
Extract target no-std hack to `build_helpers`
jieyouxu Jun 10, 2025
e10b2f6
Implement `//@ needs-target-std` directive in compiletest
jieyouxu Jun 10, 2025
c5b8123
Document `//@ needs-target-std` in rustc-dev-guide
jieyouxu Jun 10, 2025
97270ed
Make loongarch-none target maintainers more easily pingable
jieyouxu Jun 10, 2025
c558db3
Modify some run-make tests to use `//@ needs-target-std`
jieyouxu Jun 10, 2025
6f48758
Configure bootstrap backport nominations via triagebot
jieyouxu Jun 3, 2025
6227acc
Dont unwrap and re-wrap typing envs
compiler-errors Jun 10, 2025
1cc4d35
Detect when attribute is provided by missing `derive` macro
estebank Dec 28, 2024
ed06f36
Remove unneeded `FunctionCx` from some codegen methods
scottmcm Jun 10, 2025
199b808
feat: Add `bit_width` for unsigned integer types
sorairolake Jun 7, 2025
1e48cbd
Rollup merge of #134841 - estebank:serde-attr-4, r=wesleywiser
workingjubilee Jun 11, 2025
1643831
Rollup merge of #141639 - NotLebedev:stable-mir-93, r=oli-obk
workingjubilee Jun 11, 2025
8312006
Rollup merge of #141967 - jieyouxu:bootstrap-backports, r=Kobzol
workingjubilee Jun 11, 2025
1022065
Rollup merge of #142042 - estebank:explicit-lifetime-verbose-suggesti…
workingjubilee Jun 11, 2025
bd4f391
Rollup merge of #142176 - workingjubilee:dont-shuffle-bswaps-per-arch…
workingjubilee Jun 11, 2025
74fbf92
Rollup merge of #142248 - heiher:loong32-asm-types, r=Amanieu
workingjubilee Jun 11, 2025
46c8211
Rollup merge of #142272 - workingjubilee:change-some-abi-tests, r=aDo…
workingjubilee Jun 11, 2025
1e79a5b
Rollup merge of #142282 - Kobzol:citool-skip-tests, r=marcoieni
workingjubilee Jun 11, 2025
932bded
Rollup merge of #142297 - jieyouxu:needs-target-std, r=Kobzol
workingjubilee Jun 11, 2025
15a9cf8
Rollup merge of #142298 - jieyouxu:loongarch-maintainer-list, r=fee1-…
workingjubilee Jun 11, 2025
9260e76
Rollup merge of #142306 - compiler-errors:nit-reveal-param-env-query,…
workingjubilee Jun 11, 2025
3170324
Rollup merge of #142324 - scottmcm:less-functioncx, r=workingjubilee
workingjubilee Jun 11, 2025
e250a34
Rollup merge of #142328 - sorairolake:feature/uint-bit-width, r=tgross35
workingjubilee Jun 11, 2025
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
12 changes: 8 additions & 4 deletions compiler/rustc_trait_selection/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ pub enum ExplicitLifetimeRequired<'a> {
#[suggestion(
trait_selection_explicit_lifetime_required_sugg_with_ident,
code = "{new_ty}",
applicability = "unspecified"
applicability = "unspecified",
style = "verbose"
)]
new_ty_span: Span,
#[skip_arg]
Expand All @@ -774,7 +775,8 @@ pub enum ExplicitLifetimeRequired<'a> {
#[suggestion(
trait_selection_explicit_lifetime_required_sugg_with_param_type,
code = "{new_ty}",
applicability = "unspecified"
applicability = "unspecified",
style = "verbose"
)]
new_ty_span: Span,
#[skip_arg]
Expand Down Expand Up @@ -1462,7 +1464,8 @@ pub enum SuggestAccessingField<'a> {
#[suggestion(
trait_selection_suggest_accessing_field,
code = "{snippet}.{name}",
applicability = "maybe-incorrect"
applicability = "maybe-incorrect",
style = "verbose"
)]
Safe {
#[primary_span]
Expand All @@ -1474,7 +1477,8 @@ pub enum SuggestAccessingField<'a> {
#[suggestion(
trait_selection_suggest_accessing_field,
code = "unsafe {{ {snippet}.{name} }}",
applicability = "maybe-incorrect"
applicability = "maybe-incorrect",
style = "verbose"
)]
Unsafe {
#[primary_span]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ LL | }
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/without-precise-captures-we-are-powerless.rs:38:5
|
LL | fn through_field_and_ref<'a>(x: &S<'a>) {
| ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>`
...
LL | outlives::<'a>(call_once(c));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn through_field_and_ref<'a>(x: &'a S<'a>) {
| ++

error[E0597]: `c` does not live long enough
--> $DIR/without-precise-captures-we-are-powerless.rs:43:20
Expand All @@ -131,11 +133,13 @@ LL | }
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/without-precise-captures-we-are-powerless.rs:44:5
|
LL | fn through_field_and_ref_move<'a>(x: &S<'a>) {
| ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>`
...
LL | outlives::<'a>(call_once(c));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn through_field_and_ref_move<'a>(x: &'a S<'a>) {
| ++

error: aborting due to 10 previous errors

Expand Down
9 changes: 6 additions & 3 deletions tests/ui/async-await/issues/issue-63388-1.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
error[E0621]: explicit lifetime required in the type of `foo`
--> $DIR/issue-63388-1.rs:14:9
|
LL | &'a self, foo: &dyn Foo
| -------- help: add explicit lifetime `'a` to the type of `foo`: `&'a (dyn Foo + 'a)`
...
LL | foo
| ^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `foo`
|
LL - &'a self, foo: &dyn Foo
LL + &'a self, foo: &'a (dyn Foo + 'a)
|

error: aborting due to 1 previous error

Expand Down
9 changes: 6 additions & 3 deletions tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/must_outlive_least_region_or_bound.rs:15:41
|
LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
| ---- ^ lifetime `'a` required
| |
| help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
| ^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ++

error: lifetime may not live long enough
--> $DIR/must_outlive_least_region_or_bound.rs:30:55
Expand Down
8 changes: 5 additions & 3 deletions tests/ui/issues/issue-13058.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
error[E0621]: explicit lifetime required in the type of `cont`
--> $DIR/issue-13058.rs:14:21
|
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
| -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
LL | {
LL | let cont_iter = cont.iter();
| ^^^^^^^^^^^ lifetime `'r` required
|
help: add explicit lifetime `'r` to the type of `cont`
|
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &'r T) -> bool
| ++

error: aborting due to 1 previous error

Expand Down
8 changes: 6 additions & 2 deletions tests/ui/issues/issue-14285.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
error[E0621]: explicit lifetime required in the type of `a`
--> $DIR/issue-14285.rs:12:5
|
LL | fn foo<'a>(a: &dyn Foo) -> B<'a> {
| -------- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
LL | B(a)
| ^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `a`
|
LL - fn foo<'a>(a: &dyn Foo) -> B<'a> {
LL + fn foo<'a>(a: &'a (dyn Foo + 'a)) -> B<'a> {
|

error: aborting due to 1 previous error

Expand Down
7 changes: 5 additions & 2 deletions tests/ui/issues/issue-15034.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `lexer`
--> $DIR/issue-15034.rs:17:9
|
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
| ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
LL | Parser { lexer: lexer }
| ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `lexer`
|
LL | pub fn new(lexer: &'a mut Lexer<'a>) -> Parser<'a> {
| ++++

error: aborting due to 1 previous error

Expand Down
7 changes: 5 additions & 2 deletions tests/ui/issues/issue-3154.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/issue-3154.rs:6:5
|
LL | fn thing<'a,Q>(x: &Q) -> Thing<'a,Q> {
| -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
LL | Thing { x: x }
| ^^^^^^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn thing<'a,Q>(x: &'a Q) -> Thing<'a,Q> {
| ++

error: aborting due to 1 previous error

Expand Down
16 changes: 10 additions & 6 deletions tests/ui/issues/issue-40288-2.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/issue-40288-2.rs:9:5
|
LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | out[0]
| ^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `y`
|
LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &'a T) -> &'a T {
| ++

error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/issue-40288-2.rs:24:5
|
LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | out.head
| ^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `y`
|
LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &'a T) -> &'a T {
| ++

error: aborting due to 2 previous errors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/42701_one_named_and_one_anonymous.rs:10:9
|
LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
...
LL | &*x
| ^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 {
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
error[E0621]: explicit lifetime required in the type of `other`
--> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:11:21
|
LL | fn bar(&self, other: Foo) -> Foo<'a> {
| --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
...
LL | other
| ^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `other`
|
LL | fn bar(&self, other: Foo<'a>) -> Foo<'a> {
| ++++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/ex1-return-one-existing-name-if-else-2.rs:2:16
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if x > y { x } else { y }
| ^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in parameter type
--> $DIR/ex1-return-one-existing-name-if-else-3.rs:2:27
|
LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
| --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
LL | if x > y { x } else { y }
| ^ lifetime `'a` required
|
help: add explicit lifetime `'a` to type
|
LL | fn foo<'a>((x, y): (&'a i32, &'a i32)) -> &'a i32 {
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:4:15
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if x > y { x } else { y }
| ^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:7:36
|
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if true { &self.field } else { x }
| ^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo<'a>(&'a self, x: &'a i32) -> &i32 {
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/ex1-return-one-existing-name-if-else.rs:2:27
|
LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
| ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
LL | if x > y { x } else { y }
| ^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `y`
|
LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/ex2a-push-one-existing-name-2.rs:6:5
|
LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
| -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
LL | y.push(x);
| ^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo<'a>(x: Ref<'a, i32>, y: &mut Vec<Ref<'a, i32>>) {
| +++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/ex2a-push-one-existing-name-early-bound.rs:8:5
|
LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | x.push(y);
| ^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `y`
|
LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &'a T)
| ++

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/ex2a-push-one-existing-name.rs:6:5
|
LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
| -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
LL | x.push(y);
| ^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `y`
|
LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<'a, i32>) {
| +++

error: aborting due to 1 previous error

Expand Down
9 changes: 6 additions & 3 deletions tests/ui/lifetimes/noisy-follow-up-erro.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ LL | struct Foo<'c, 'd>(&'c (), &'d ());
error[E0621]: explicit lifetime required in the type of `foo`
--> $DIR/noisy-follow-up-erro.rs:14:9
|
LL | fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> {
| -------------------- help: add explicit lifetime `'a` to the type of `foo`: `&mut Foo<'_, 'a>`
LL |
LL | self.bar().map_err(|()| foo.acc(self))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `foo`
|
LL - fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> {
LL + fn boom(&self, foo: &mut Foo<'_, 'a>) -> Result<(), &'a ()> {
|

error: aborting due to 2 previous errors

Expand Down
Loading