Oneirical
2e659f5894
Add test batch 1
2025-08-27 00:23:26 -04:00
Karol Zwolak
d14b83e378
bless tests with new lint messages
2025-08-19 21:27:10 +02:00
Kivooeo
e9959aa74e
comments
2025-07-25 20:38:54 +05:00
Kivooeo
9f38ca97ea
move 28 tests
2025-07-25 20:38:54 +05:00
dianne
41e6f767b6
future-incompat lints: don't link to the nightly edition-guide version
2025-07-16 01:44:02 -07:00
Kivooeo
259512e3b6
cleaned up some tests
2025-07-10 18:50:35 +05:00
Kivooeo
1fb5e0149f
moved tests
2025-07-01 23:33:59 +05:00
Oli Scherer
7f4093e78b
Loop check anon consts on their own
2025-06-10 08:41:23 +00:00
Michael Goulet
11392f4978
Emit dummy open drop for unsafe binder
2025-05-23 10:43:21 +00:00
Vadim Petrochenkov
20faf8532b
compiletest: Make diagnostic kind mandatory on line annotations
2025-04-30 10:44:24 +03:00
Vadim Petrochenkov
b3f75353a2
UI tests: add missing diagnostic kinds where possible
2025-04-08 23:06:31 +03:00
lcnr
d4b8fa9e4c
remove feature(inline_const_pat)
2025-03-21 09:35:31 +01:00
Eric Huss
3e80697972
Use links to edition guide for edition migrations
2024-12-15 20:28:16 -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
Esteban Küber
c09c73b996
Reword suggestion message
2024-11-16 20:03:31 +00:00
Michael Goulet
f2a80a0f89
A raw ref of a deref is always safe
2024-10-06 22:35:40 -04:00
Michael Goulet
12f2bcde63
Check params for unsafety in THIR
2024-09-18 16:45:48 -04:00
Ralf Jung
49316f871c
also stabilize const_refs_to_cell
2024-09-15 10:20:47 +02:00
Ralf Jung
3175cc2814
stabilize const_mut_refs
2024-09-15 09:51:32 +02:00
Veera
f003e92a5b
Don't Suggest Labeling const and unsafe Blocks
2024-08-06 14:50:09 -04:00
Veera
764675e01a
Add Tests
2024-08-06 14:06:29 -04:00
Esteban Küber
a5e7da0cf6
Tweak raw-pointer field access and array indexing suggestions
2024-07-04 06:06:33 +00:00
Esteban Küber
e6bd6c2044
Use parenthetical notation for Fn traits
...
Always use the `Fn(T) -> R` format when printing closure traits instead of `Fn<(T,), Output = R>`.
Fix #67100 :
```
error[E0277]: expected a `Fn()` closure, found `F`
--> file.rs:6:13
|
6 | call_fn(f)
| ------- ^ expected an `Fn()` closure, found `F`
| |
| required by a bound introduced by this call
|
= note: wrap the `F` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `call_fn`
--> file.rs:1:15
|
1 | fn call_fn<F: Fn() -> ()>(f: &F) {
| ^^^^^^^^^^ required by this bound in `call_fn`
help: consider further restricting this bound
|
5 | fn call_any<F: std::any::Any + Fn()>(f: &F) {
| ++++++
```
2024-05-29 22:26:54 +00:00
León Orell Valerian Liehr
ae49dbe707
Cleanup: Fix up some diagnostics
2024-05-22 22:40:34 +02:00
Santiago Pastorino
6b46a919e1
Rename Unsafe to Safety
2024-05-17 18:33:37 -03:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives
2024-02-16 20:02:50 +00:00
Matthew Jasper
4feec41e05
#![feature(inline_const_pat)] is no longer incomplete
2024-02-01 10:27:54 +00:00
bors
d5fd099729
Auto merge of #120242 - matthiaskrgr:rollup-a93yj3i, r=matthiaskrgr
...
Rollup of 10 pull requests
Successful merges:
- #117910 (Refactor uses of `objc_msgSend` to no longer have clashing definitions)
- #118639 (Undeprecate lint `unstable_features` and make use of it in the compiler)
- #119801 (Fix deallocation with wrong allocator in (A)Rc::from_box_in)
- #120058 (bootstrap: improvements for compiler builds)
- #120059 (Make generic const type mismatches not hide trait impls from the trait solver)
- #120097 (Report unreachable subpatterns consistently)
- #120137 (Validate AggregateKind types in MIR)
- #120164 (`maybe_lint_impl_trait`: separate `is_downgradable` from `is_object_safe`)
- #120181 (Allow any `const` expression blocks in `thread_local!`)
- #120218 (rustfmt: Check that a token can begin a nonterminal kind before parsing it as a macro arg)
r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-22 18:22:32 +00:00
Nadrieril
0a9bb97229
Consistently warn unreachable subpatterns
2024-01-18 17:29:54 +01:00
asquared31415
a8bb418ae5
make unsafe_op_in_unsafe_fn MachineApplicable and add it to 2024 compatibility
2024-01-15 23:06:39 +00:00
George-lewis
d56cdd48cb
Bless tests
...
Update tests
2024-01-13 12:46:58 -05:00
Matthew Jasper
7832ebbd4f
Handle context for const patterns correctly
2024-01-05 10:00:59 +00:00
Matthew Jasper
26f48b4cba
Stabilize THIR unsafeck
2024-01-05 10:00:59 +00:00
Matthew Jasper
982b49494e
Remove revisions for THIR unsafeck
...
This is to make the diff when stabilizing it easier to review.
2024-01-05 09:30:27 +00:00
jyn
eb53721a34
recurse into refs when comparing tys for diagnostics
2023-12-07 23:00:46 -05: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
Esteban Küber
4f7dddd4a1
recover primary span label
2023-11-16 17:00:23 +00:00
Matthew Jasper
868de8e76b
Visit patterns in THIR let expressions
...
This fixes some THIR unsafety checking errors not being emitted for
let expressions in these situations.
2023-11-06 16:23:09 +00:00
Matthew Jasper
2b59992736
Add suggestion to THIR unsafe_op_in_unsafe_fn lint
2023-11-06 16:23:09 +00:00
Michael Goulet
c83f642f12
Pretty print Fn traits in rustc_on_unimplemented
2023-11-02 20:57:05 +00:00
Matthew Jasper
dc3d428a8a
Make THIR unused_unsafe lint consistent with MIR
...
Updates THIR behavior to match the changes from #93678
2023-10-25 10:10:13 +00:00
bors
df63c5f140
Auto merge of #112038 - Nemo157:edition-2024-unsafe_op_in_unsafe_fn, r=RalfJung
...
Change `unsafe_op_in_unsafe_fn` to be `warn`-by-default from edition 2024
This was previously FCPed: https://github.com/rust-lang/rust/issues/71668#issuecomment-1189396886
There were two blocking requirements:
* Fix the `unused_unsafe` lint, done in https://github.com/rust-lang/rust/pull/100081
* Have `cargo fix` able to fix the lint, done in https://github.com/rust-lang/rust/pull/112017
2023-09-14 11:52:08 +00:00
mojave2
cfa2119563
add a regression test
2023-09-06 17:46:46 +08:00
Wim Looman
119e0fff8a
Change unsafe_op_in_unsafe_fn to be warn-by-default from edition 2024
2023-09-06 09:30:04 +02:00
Michael Goulet
bf66723c0e
Test and note unsafe ctor to fn ptr coercion
...
Also remove a note that I don't consider to be very useful in context.
2023-08-30 15:09:40 -07:00
Michael Goulet
0100a94231
rustc_layout_scalar_valid_range makes ctors unsafe
2023-08-30 15:01:58 -07:00
syvb
2cfe8ed37d
Implement "items do not inherit unsafety" for THIR unsafeck
2023-07-15 11:59:38 -04:00
Wim Looman
802c1d5979
Add test cases for suggestions with unsafe operations contained inside macros
2023-06-13 15:48:57 +02:00
Wim Looman
8f3e876e52
Add note about unsafe functions body not being unsafe
2023-06-13 15:48:57 +02:00