Esteban Küber
4483ac2206
Fix windows test that has different stderr output
2023-10-06 15:51:04 +00:00
Camille GILLOT
b704697fba
Bless incremental tests.
2023-10-06 15:46:11 +00:00
Camille GILLOT
27d6a57e58
Preserve DebugInfo in DeadStoreElimination.
2023-10-06 15:46:11 +00:00
bors
64fa0c34d7
Auto merge of #115304 - Enselic:trailing-gt, r=cjgillot
...
Allow file names to end with '>'
The [`rustc_span::FileName`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_span/enum.FileName.html ) enum already differentiates between real files and "fake" files such as `<anon>`. We do not need to artificially forbid real file names from ending in `>`.
Closes #73419
2023-10-06 14:57:09 +00:00
Guillaume Gomez
5674092e76
Rollup merge of #116475 - notriddle:notriddle/impl-trait-null, r=GuillaumeGomez
...
rustdoc-search: fix bug with multi-item impl trait
Preview searches:
- https://notriddle.com/rustdoc-html-demo-5/compiler-doc-impl-trait-bugfix/index.html?search=-%3E%20globalctxt
- https://notriddle.com/rustdoc-html-demo-5/compiler-doc-impl-trait-bugfix/index.html?search=globalctxt
2023-10-06 13:18:35 +02:00
Guillaume Gomez
9e28a9349c
Rollup merge of #116329 - RalfJung:swap-comments, r=scottmcm
...
update some comments around swap()
Based on ``@eddyb's`` comment [here](https://github.com/rust-lang/unsafe-code-guidelines/issues/461#issuecomment-1742156410 ).
And then I noticed the wrong capitalization for Miri and fixed it in some other places as well.
2023-10-06 13:18:35 +02:00
bjorn3
ecf271cfb6
Use pushsection/popsection
2023-10-06 11:02:11 +00:00
bors
d4ba2b4c7c
Auto merge of #116018 - DianQK:simd-wide-sum-test, r=scottmcm
...
Increasing the SIMD size improves the vectorization possibilities
Change the `simd-wide-sum.rs` to pass tests based on the LLVM main branch.
For smaller lengths, we cannot expect to always get vectorized.
A related discussion at https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/LLVM.20HEAD.3A.20codegen.2Fsimd.2Fsimd-wide-sum.2Ers.20newly.20failing .
r? scottmcm
2023-10-06 08:04:53 +00:00
scottmcm
e300847864
Add a wishlist FIXME
2023-10-06 07:05:09 +00:00
Michael Howell
1eb2a76641
rustdoc-search: fix bug with multi-item impl trait
2023-10-05 22:32:37 -07:00
Matthias Krüger
7d7004d3e6
Rollup merge of #116421 - Urgau:inter-mut-invalid_ref_casting, r=oli-obk
...
Clarify `invalid_reference_casting` lint around interior mutable types
This is PR intends to clarify the `invalid_reference_casting` lint around interior mutable types by adding a note for them saying that they should go through `UnsafeCell::get`.
So for this code:
```rust
let cell = &std::cell::UnsafeCell::new(0);
let _num = &mut *(cell as *const _ as *mut i32);
```
the following note will be added to the lint output:
```diff
error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
--> $DIR/reference_casting.rs:68:16
|
LL | let _num = &mut *(cell as *const _ as *mut i32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html >
+ = note: even for types with interior mutability, the only legal way to obtain a mutable pointer from a shared reference is through `UnsafeCell::get`
```
Suggestion are welcome around the note contents.
Fixes https://github.com/rust-lang/rust/issues/116410
cc `@RalfJung`
2023-10-06 06:23:48 +02:00
bjorn3
9facf0bf72
Properly export function defined in test which uses global_asm!()
...
Currently the test passes with the LLVM backend as the codegen unit
partitioning logic happens to place both the global_asm!() and the
function which calls the function defined by the global_asm!() in the
same CGU. With the Cranelift backend it breaks however as it will place
all assembly in separate codegen units to be passed to an external
linker.
2023-10-05 19:42:25 +00:00
bors
cae0791da4
Auto merge of #116417 - ouz-a:trait_type_detective, r=compiler-errors
...
Remove is global hack
In attempt to fix https://github.com/rust-lang/rust/issues/114057 we found several issues with how compiler computes layouts, this change removes `is_global` from `and` to stop impl from being shadowed.
In depth conversation can be read here https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Getting.20different.20types.20from.20almost.20same.20inputs
This is a fix candidate opened for performance run.
r? `@lcnr`
2023-10-05 19:42:05 +00:00
Oğuz Ağcayazı
e30d27be00
remove is global hack
2023-10-05 21:38:12 +03:00
Martin Nordholts
8a1be9942d
Allow file names to end with '>'
...
The `rustc_span::FileName` enum already differentiates between real
files and "fake" files such as `<anon>`. We do not need to artificially
forbid real file names from ending in `>`.
2023-10-05 20:17:48 +02:00
Matthias Krüger
c1c5ab717e
Rollup merge of #116428 - Alexendoo:note-duplicate-diagnostics, r=compiler-errors,estebank
...
Add a note to duplicate diagnostics
Helps explain why there may be a difference between manual testing and the test suite output and highlights them as something to potentially look into
For existing duplicate diagnostics I just blessed them other than a few files that had other `NOTE` annotations in
2023-10-05 19:24:35 +02:00
Matthias Krüger
08cc7428d9
Rollup merge of #116415 - ouz-a:move_subtyper, r=oli-obk
...
Move subtyper below reveal_all and change reveal_all
In previous attempt https://github.com/rust-lang/rust/pull/116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist.
r? ``@oli-obk``
Fixes https://github.com/rust-lang/rust/issues/116332
Fixes https://github.com/rust-lang/rust/issues/116265
Fixes https://github.com/rust-lang/rust/issues/116383
Fixes https://github.com/rust-lang/rust/issues/116333
2023-10-05 19:24:34 +02:00
Matthias Krüger
b301bd4220
Rollup merge of #116288 - ouz-a:smir_spans, r=spastorino
...
Add Span to various smir types
Had to make few extra changes to few structs to attach spans to them.
r? ``@oli-obk``
2023-10-05 19:24:34 +02:00
ouz-a
3088c4b046
move subtyper change reveal_all
2023-10-05 18:56:30 +03:00
francorbacho
c8ee7db6ea
Only give autofix suggestion when no named args are present
2023-10-05 16:11:31 +02:00
francorbacho
38b0182832
Add suggestion test
2023-10-05 16:11:31 +02:00
francorbacho
905bace904
Highlight redundant arguments instead of the whole format string
2023-10-05 16:11:31 +02:00
francorbacho
fcdd5c0b2d
Plurals in format redundant arguments suggestion
2023-10-05 16:11:31 +02:00
francorbacho
04fc051a34
Use diagnostic impls and add suggestions in redundant format!() args
2023-10-05 16:09:57 +02:00
francorbacho
93df9e6d7d
Suggest removing redundant arguments in format!()
2023-10-05 16:05:42 +02:00
bors
5c3a0e932b
Auto merge of #116427 - cjgillot:no-internal, r=oli-obk
...
Remove mir::LocalDecl::internal.
It does not serve any purpose, as we don't have typeck-based generator witnesses any more.
2023-10-05 09:59:14 +00:00
ouz-a
a79567b01c
add span to statements
2023-10-05 11:15:34 +03:00
Jubilee
4a14a80605
Rollup merge of #116432 - notriddle:master, r=fmease
...
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 2)
Follow up https://github.com/rust-lang/rust/pull/116214
2023-10-05 00:56:31 -07:00
Jubilee
d7b02c3d40
Rollup merge of #116431 - estebank:issue-80476, r=compiler-errors
...
Tweak wording of E0562
Fix #80476 .
2023-10-05 00:56:30 -07:00
Jubilee
a9a389cf44
Rollup merge of #116429 - fmease:clean-up-struct-field-suggs, r=compiler-errors
...
Diagnostics: Be more careful when suggesting struct fields
Consolidate the various places which filter out struct fields that shouldn't be suggested into a single function.
Previously, each of those code paths had slightly different and incomplete metrics for no good reason. Now, there's only a single 'complete' metric (namely `is_field_suggestable`) which also filters out hygienic fields that come from different syntax contexts.
Fixes #116334 .
2023-10-05 00:56:30 -07:00
Jubilee
cfce3a919d
Rollup merge of #116296 - compiler-errors:default-return, r=estebank
...
More accurately point to where default return type should go
When getting the "default return type" span, instead of pointing to the low span of the next token, point to the high span of the previous token. This:
1. Makes forming return type suggestions more uniform, since we expect them all in the same place.
2. Arguably makes labels easier to understand, since we're pointing to where the implicit `-> ()` would've gone, rather than the starting brace or the semicolon.
r? ```@estebank```
2023-10-05 00:56:29 -07:00
Jubilee
ea3454eabb
Rollup merge of #116223 - catandcoder:master, r=cjgillot
...
Fix misuses of a vs an
Fixes the misuse of "a" vs "an", according to English grammatical
expectations and using https://www.a-or-an.com/
2023-10-05 00:56:29 -07:00
bors
5236c8e1fa
Auto merge of #116273 - compiler-errors:refine2, r=tmandry
...
Only trigger `refining_impl_trait` lint on reachable traits
Public but unreachable traits don't matter 😸
r? `@tmandry`
2023-10-05 03:00:30 +00:00
bors
b781645332
Auto merge of #116184 - compiler-errors:afit-lint, r=tmandry
...
Add `async_fn_in_trait` lint
cc https://github.com/rust-lang/rust/pull/115822#issuecomment-1731168465
Mostly unsure what the messaging should be. Feedback required.
r? `@tmandry`
2023-10-05 01:14:25 +00:00
Alex Macleod
5453a9f34d
Add a note to duplicate diagnostics
2023-10-05 01:04:41 +00:00
Michael Goulet
dfbb1bfc89
Also closures
2023-10-05 00:05:45 +00:00
Michael Goulet
966f27977a
Structurally normalize async fn return type in deduce_future_output_from_obligations
2023-10-05 00:05:20 +00:00
Nadrieril
c1b29b338d
Fix handling slices of empty types
2023-10-05 00:58:14 +02:00
Michael Goulet
137b6d0b01
Point to where missing return type should go
2023-10-04 21:09:54 +00:00
bors
2bbb619893
Auto merge of #114417 - chinedufn:fix-expect-unused-in-impl-block-rust-issue-114416, r=cjgillot
...
Fix multiple `expect` attribs in impl block
Closes #114416
2023-10-04 20:44:38 +00:00
Urgau
e46236cceb
Clarify invalid_reference_casting lint around interior mutable types
2023-10-04 22:06:16 +02:00
Michael Howell
a46ccd8d3f
Add URL to test case issues
2023-10-04 13:04:45 -07:00
Michael Howell
9266270ef5
Rename issue-\d+.rs tests to have meaningful names
2023-10-04 12:58:06 -07:00
Esteban Küber
041e54bd92
Tweak wording of E0562
...
Fix #80476 .
2023-10-04 19:51:43 +00:00
León Orell Valerian Liehr
867cc41b5b
clean up struct field suggestions
2023-10-04 21:36:04 +02:00
Michael Howell
a198aff4a4
Add crate_name to test so that it can be renamed
2023-10-04 12:13:01 -07:00
Esteban Küber
8d92c996ca
Fix test on WASM target by making ambiguity pruning more agressive
2023-10-04 18:58:06 +00:00
Camille GILLOT
e63d19c4dd
Remove mir::LocalDecl::internal.
2023-10-04 17:55:15 +00:00
bors
f306362fb9
Auto merge of #116413 - nnethercote:rm-E0551, r=compiler-errors
...
Remove E0551
Because it's the same as E0539.
Fixes #51489 .
r? `@Nilstrieb`
2023-10-04 16:51:42 +00:00
bors
65519f5fc0
Auto merge of #116360 - compiler-errors:async-span, r=oli-obk
...
Point to full `async fn` for future
Semi-follow-up to https://github.com/rust-lang/rust/pull/116296#discussion_r1342007575
cc `@asquared31415`
2023-10-04 09:55:02 +00:00