Skip to content

Rollup of 9 pull requests #139482

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

Merged
merged 32 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9f089e0
Add `{ast,hir,thir}::PatKind::Missing` variants.
nnethercote Mar 26, 2025
909f449
Remove `kw::Extra` checks that are no longer necessary.
nnethercote Mar 27, 2025
3123df8
Implement `super let`.
m-ou-se Mar 27, 2025
f02e278
Fix typo in pretty printing super let.
m-ou-se Apr 2, 2025
3e6cc76
Boolean hate.
m-ou-se Apr 2, 2025
b9babad
Add feature gate test for cfg'd out super let.
m-ou-se Apr 4, 2025
6c3417d
fixup! Implement `super let`.
m-ou-se Apr 4, 2025
0522ed0
Default auto traits: fix perf
Bryanskiy Apr 4, 2025
ccbef74
Add tests for super let.
m-ou-se Apr 4, 2025
de57c05
Let `const_to_pat` handle the `ExpandedConstant` wrapping
Nadrieril Mar 29, 2025
090d764
Remove the `is_inline` field from `PatKind::ExpandedConstant`
Nadrieril Mar 29, 2025
50e10b3
Tweak `lower_pat_expr`
Nadrieril Mar 29, 2025
961c746
Add the inline const type annotation in pattern lowering
Nadrieril Mar 29, 2025
d912c03
Reuse `parent_args`
Nadrieril Mar 29, 2025
5eb535c
remove compiler support for `extern "rust-intrinsic"` blocks
Skgland Apr 6, 2025
51b51b5
remove rust-analyser support for `extern "rust-intrinsic"` blocks
Skgland Apr 6, 2025
6dfb296
update docs
Skgland Apr 6, 2025
7dd57f0
update/bless tests
Skgland Apr 6, 2025
c8649a3
Stop calling source_span query in significant drop order code
compiler-errors Apr 6, 2025
d111aa8
Trivial tweaks to stop tracking source span directly
compiler-errors Apr 7, 2025
4322b6e
coverage: Build the CGU's global file table as late as possible
Zalathar Mar 31, 2025
d6467d3
handle sret for scalar autodiff
ZuseZ4 Apr 7, 2025
ca5bea3
move old tests, add sret test
ZuseZ4 Apr 7, 2025
82df622
Rollup merge of #139035 - nnethercote:PatKind-Missing, r=oli-obk
Zalathar Apr 7, 2025
9955b76
Rollup merge of #139108 - Nadrieril:simplify-expandedconstant, r=oli-obk
Zalathar Apr 7, 2025
27c6e40
Rollup merge of #139112 - m-ou-se:super-let, r=lcnr
Zalathar Apr 7, 2025
f4c429f
Rollup merge of #139365 - Bryanskiy:leak-perf, r=lcnr
Zalathar Apr 7, 2025
ddf099f
Rollup merge of #139397 - Zalathar:virtual, r=jieyouxu
Zalathar Apr 7, 2025
9209c5e
Rollup merge of #139455 - Skgland:remove_rust-intrinsic_ABI, r=oli-obk
Zalathar Apr 7, 2025
0178254
Rollup merge of #139461 - compiler-errors:significant-drop-span, r=ol…
Zalathar Apr 7, 2025
5863b42
Rollup merge of #139465 - EnzymeAD:autodiff-sret, r=oli-obk
Zalathar Apr 7, 2025
6e0b674
Rollup merge of #139466 - compiler-errors:trivial-incr-tainting, r=ol…
Zalathar Apr 7, 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
Prev Previous commit
Next Next commit
Add tests for super let.
  • Loading branch information
m-ou-se committed Apr 4, 2025
commit ccbef74fc5a6bf5adfdd79fd15601fe91aa22c66
174 changes: 174 additions & 0 deletions tests/ui/super-let.borrowck.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:30:28
|
LL | super let b = DropMe(&mut x);
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:46:28
|
LL | super let b = &DropMe(&mut x);
| --------------
| | |
| | `x` is borrowed here
| a temporary with access to the borrow is created here ...
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:64:32
|
LL | super let b = identity(&DropMe(&mut x));
| --------------
| | |
| | `x` is borrowed here
| a temporary with access to the borrow is created here ...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | };
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:87:36
|
LL | super let b = identity(&DropMe(&mut x));
| --------------
| | |
| | `x` is borrowed here
| a temporary with access to the borrow is created here ...
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | ));
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:107:28
|
LL | super let b = DropMe(&mut x);
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:125:28
|
LL | super let b = DropMe(&mut x);
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:143:28
|
LL | super let b = DropMe(&mut x);
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:159:28
|
LL | b = DropMe(&mut x);
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
LL | drop(a);
| - borrow later used here

error[E0716]: temporary value dropped while borrowed
--> $DIR/super-let.rs:172:33
|
LL | #[cfg(borrowck)] { a = &String::from("asdf"); };
| ^^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
| |
| creates a temporary value which is freed while still in use
...
LL | let _ = a;
| - borrow later used here
|
= note: consider using a `let` binding to create a longer lived value

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:206:28
|
LL | super let d = &DropMe(&mut x);
| --------------
| | |
| | `x` is borrowed here
| a temporary with access to the borrow is created here ...
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:227:32
|
LL | super let d = identity(&DropMe(&mut x));
| --------------
| | |
| | `x` is borrowed here
| a temporary with access to the borrow is created here ...
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | };
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:246:28
|
LL | super let b = DropMe(&mut x);
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`

error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/super-let.rs:263:28
|
LL | let dropme = Some(DropMe(&mut x));
| ------ `x` is borrowed here
...
LL | #[cfg(borrowck)] { x = true; }
| ^^^^^^^^ `x` is assigned to here but it was already borrowed
...
LL | }
| - borrow might be used here, when `x` is dropped and runs the `Drop` code for type `DropMe`

error: aborting due to 13 previous errors

Some errors have detailed explanations: E0506, E0716.
For more information about an error, try `rustc --explain E0506`.
Loading
Loading