Michael Goulet
c55eefe8bc
Try to explain borrow for tail expr temporary drop order change in 2024
2025-01-08 16:02:44 +00:00
Michael Goulet
4a099b29cd
Don't do AccessDepth::Drop for types with no drop impl
2025-01-08 15:58:10 +00:00
Michael Goulet
197f6d8081
Don't create cycles by normalizing opaques defined in the body we're checking
2025-01-08 15:58:10 +00:00
Ding Xiang Fei
045271cccc
run borrowck tests on BIDs and emit tail-expr-drop-order lints for
...
potential violations
2025-01-08 15:58:09 +00:00
Michael Goulet
b893221517
Always run tail_expr_drop_order lint on promoted MIR
2024-12-23 20:25:41 +00:00
Michael Goulet
42d1a4c48b
Handle DropKind::ForLint in coroutines correctly
2024-12-20 18:18:06 +00:00
Eric Huss
3e80697972
Use links to edition guide for edition migrations
2024-12-15 20:28:16 -08:00
Esteban Küber
49a22a4245
Filter empty lines, comments and delimiters from previous to last multiline span rendering
2024-12-12 23:36:27 +00:00
Esteban Küber
65a54a7f27
Tweak multispan rendering
...
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-12 23:36:27 +00:00
Ding Xiang Fei
2d61c0906a
reduce false positives on some common cases from if-let-rescope
2024-12-02 18:30:29 +08:00
Eric Huss
6005d1c9f7
Update more 2024 tests to remove -Zunstable-options
2024-11-28 14:32:45 -08:00
许杰友 Jieyou Xu (Joe)
95ff642797
tests: remove //@ pretty-expanded usages
...
Done with
```bash
sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs
```
and
```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
2024-11-26 02:50:48 +08:00
Eric Huss
31c9222639
Stabilize the 2024 edition
2024-11-22 11:12:15 -08:00
Ding Xiang Fei
297b618944
reduce false positives of tail-expr-drop-order from consumed values
...
take 2
open up coroutines
tweak the wordings
the lint works up until 2021
We were missing one case, for ADTs, which was
causing `Result` to yield incorrect results.
only include field spans with significant types
deduplicate and eliminate field spans
switch to emit spans to impl Drops
Co-authored-by: Niko Matsakis <nikomat@amazon.com>
collect drops instead of taking liveness diff
apply some suggestions and add explantory notes
small fix on the cache
let the query recurse through coroutine
new suggestion format with extracted variable name
fine-tune the drop span and messages
bugfix on runtime borrows
tweak message wording
filter out ecosystem types earlier
apply suggestions
clippy
check lint level at session level
further restrict applicability of the lint
translate bid into nop for stable mir
detect cycle in type structure
2024-11-20 20:53:11 +08:00
Matthias Krüger
5d6c49938e
Rollup merge of #131984 - dingxiangfei2009:stabilize-if-let-rescope, r=traviscross,lcnr
...
Stabilize if_let_rescope
Close #131154
Tracked by #124085
2024-10-29 18:38:57 +01:00
Ding Xiang Fei
6d569f769c
stabilize if_let_rescope
2024-10-24 04:33:14 +08:00
Ding Xiang Fei
0689b2139f
stabilize shorter-tail-lifetimes
2024-10-24 01:56:08 +08:00
Ding Xiang Fei
ed5443fcdf
apply suggestions
2024-09-30 22:21:45 +08:00
Ding Xiang Fei
6d1a25ad7e
preserve brackets around if-lets and skip while-lets
2024-09-30 04:21:10 +08:00
Obei Sideg
3b0ce1bc33
Update tests for hidden references to mutable static
2024-09-13 14:10:56 +03:00
Ding Xiang Fei
b4b2b356d9
simplify the suggestion notes
2024-09-13 02:43:49 +08:00
Ding Xiang Fei
89682a5313
downgrade borrowck suggestion level due to possible span conflict
2024-09-11 04:10:04 +08:00
Ding Xiang Fei
e2120a7c38
coalesce lint suggestions that can intersect
2024-09-11 04:10:03 +08:00
Ding Xiang Fei
f93df1f7dc
rescope temp lifetime in let-chain into IfElse
...
apply rules by span edition
2024-09-11 04:10:00 +08:00
Ding Xiang Fei
ef25fbd0b4
lint on tail expr drop order change in Edition 2024
2024-08-21 01:05:21 +08:00
Esteban Küber
abf92c049d
Use more accurate span for addr_of! suggestion
...
Use a multipart suggestion instead of a single whole-span replacement:
```
error[E0796]: creating a shared reference to a mutable static
--> $DIR/reference-to-mut-static-unsafe-fn.rs:10:18
|
LL | let _y = &X;
| ^^ shared reference to mutable static
|
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
help: use `addr_of!` instead to create a raw pointer
|
LL | let _y = addr_of!(X);
| ~~~~~~~~~ +
```
2024-07-18 18:39:20 +00:00
Ding Xiang Fei
0f8c3f7882
tail expression behind terminating scope
2024-06-18 04:14:43 +08:00
Oli Scherer
aef0f4024a
Error on using yield without also using #[coroutine] on the closure
...
And suggest adding the `#[coroutine]` to the closure
2024-04-24 08:05:29 +00:00
Esteban Küber
e17388b809
Handle more cases of value suggestions
2024-04-10 20:36:14 +00:00
Matthias Krüger
cc422cee97
add test for ICE #106444
...
Fixes #106444
2024-03-23 12:38:50 +01:00
Caio
2aab000105
Move tests
2024-03-03 16:30:48 -03:00
bors
b0d3e04ca9
Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkin
...
Implement RFC 3373: Avoid non-local definitions in functions
This PR implements [RFC 3373: Avoid non-local definitions in functions](https://github.com/rust-lang/rust/issues/120363 ).
2024-02-25 19:11:06 +00:00
Nicholas Nethercote
2903bbbc15
Convert bugs back to delayed_bugs.
...
This commit undoes some of the previous commit's mechanical changes,
based on human judgment.
2024-02-21 10:35:54 +11:00
Oli Scherer
9062697917
Always evaluate free constants and statics, even if previous errors occurred
2024-02-19 22:11:13 +00:00
Obei Sideg
408eeae59d
Improve wording of static_mut_ref
...
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-18 06:01:40 +03:00
Urgau
80c81c53ac
Allow newly added non_local_definitions lint in tests
2024-02-17 13:59:45 +01:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives
2024-02-16 20:02:50 +00:00
Matthias Krüger
30057f0266
Rollup merge of #120802 - oli-obk:drop_elab_ice, r=compiler-errors
...
Bail out of drop elaboration when encountering error types
fixes #120788
2024-02-13 06:27:38 +01:00
Oli Scherer
2d73597b93
Bail out of drop elaboration when encountering error types
2024-02-08 17:51:32 +00:00
Oli Scherer
ad511ef92e
Avoid ICE in drop recursion check in case of invalid drop impls
2024-02-08 17:33:04 +00:00
r0cky
c7519d42c2
Update tests
2024-02-07 10:42:01 +08:00
Obei Sideg
a8aa6878f6
Update test for E0796 and static_mut_ref lint
2024-01-07 17:29:25 +03:00
Jake Goulding
53eca9fa87
Adjust compiler tests for unused_tuple_struct_fields -> dead_code
2024-01-02 15:34:37 -05:00
Matthew Jasper
d437a111f5
Give temporaries in if let guards correct scopes
...
- Make temporaries in if-let guards be the same variable in MIR when
the guard is duplicated due to or-patterns.
- Change the "destruction scope" for match arms to be the arm scope rather
than the arm body scope.
- Add tests.
2023-12-21 13:35:56 +00:00
Nilstrieb
41e8d152dc
Show number in error message even for one error
...
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Oli Scherer
e96ce20b34
s/generator/coroutine/
2023-10-20 21:14:01 +00:00
Oli Scherer
60956837cf
s/Generator/Coroutine/
2023-10-20 21:10:38 +00:00
Matthew Jasper
b49140295c
Add more if let guard tests
2023-09-19 12:48:40 +00:00
Urgau
c93d9c1794
Rename drop_ref lint to dropping_references
2023-05-21 14:16:41 +02:00
Urgau
1c7ab18c08
Rename drop_copy lint to dropping_copy_types
2023-05-21 13:37:32 +02:00