Commit Graph

245338 Commits

Author SHA1 Message Date
Deadbeef
96108c5981 make effect infer variables suggestable in diagnostics
it works when a non-const context that does not enable effects
calls into a const effects-enabled trait. We'd simply suggest the
non-const trait bound in this case consistent to its fallback.
2024-02-04 11:30:59 +08:00
Deadbeef
c9192be561 Reconstify Add 2024-02-04 11:30:59 +08:00
trevyn
a4cb55f2ac For E0223, suggest methods that look similar to the path 2024-02-03 19:29:28 -08:00
Ben Kimock
934618fe47 Emit a diagnostic for invalid target options 2024-02-03 22:03:25 -05:00
Weihang Lo
dff2114b46
Update cargo 2024-02-03 19:29:16 -05:00
Matthias Krüger
edd24948bc
Rollup merge of #120533 - androm3da:bcain/update_hex_docs, r=wesleywiser
Correct paths for hexagon-unknown-none-elf platform doc

Update the library paths to correctly refer to libdemo{1,2}_hexagon and switch to the release build instead.

Update references to libstandalone to the specific G0/PIC archive instead.
2024-02-03 22:25:17 +01:00
Matthias Krüger
7d516c57df
Rollup merge of #120531 - oli-obk:track_errors7, r=estebank
Remove a bunch of `has_errors` checks that have no meaningful or the wrong effect

r? `@nnethercote`
2024-02-03 22:25:16 +01:00
Matthias Krüger
69920786ba
Rollup merge of #120529 - nikic:llvm-18-datalayout-fixes, r=cuviper
Update data layouts in custom target tests for LLVM 18

Apply the data layout changes from https://github.com/rust-lang/rust/pull/116672 to custom target specs as well, as we started validating them since https://github.com/rust-lang/rust/pull/120062.

Fixes https://github.com/rust-lang/rust/issues/120492.

r? ```@cuviper```
2024-02-03 22:25:16 +01:00
Matthias Krüger
3e24351677
Rollup merge of #120528 - GnomedDev:atomicu8-backtrace-style, r=cuviper
Store SHOULD_CAPTURE as AtomicU8

`BacktraceStyle` easily fits into a u8, so `SHOULD_CAPTURE`, which is just `Atomic<Option<BacktraceStyle>>`, should be stored as `AtomicU8`
2024-02-03 22:25:16 +01:00
Matthias Krüger
a3ea64719b
Rollup merge of #120523 - a1phyr:improve_read_buf_exact, r=the8472
Improve `io::Read::read_buf_exact` error case

- Use `const_io_error` instead of `Error::new`
- Use the same message as `read_exact`
2024-02-03 22:25:15 +01:00
Matthias Krüger
ceeaa8a852
Rollup merge of #120517 - Nadrieril:lower-never-as-wildcard, r=compiler-errors
never patterns: It is correct to lower `!` to `_`.

This is just a comment update but a non-trivial one: it is correct to lower `!` patterns as `_`. The reasoning is that `!` matches all the possible values of the type, since the type is empty. Moreover, we do want to warn that the `Err` is redundant in:
```rust
match x {
  !,
  Err(!),
}
```
which is consistent with `!` behaving like a wildcard.

I did try to introduce `Constructor::Never` and it ended up needing to behave exactly like `Constructor::Wildcard`.

r? ```@compiler-errors```
2024-02-03 22:25:15 +01:00
Matthias Krüger
f3ebf1e50f
Rollup merge of #120516 - Nadrieril:cleanup-impls, r=compiler-errors
pattern_analysis: cleanup manual impls

https://github.com/rust-lang/rust/pull/120420 introduced some unneeded manual impls. I remove them here.

r? ```@Nilstrieb```
2024-02-03 22:25:14 +01:00
Matthias Krüger
6f24836a5b
Rollup merge of #120484 - Teapot4195:issue-120480-fix, r=compiler-errors
Avoid ICE when is_val_statically_known is not of a supported type

2 ICE with 1 stone!
1. Implement `llvm.is.constant.ptr` to avoid first ICE in linked issue.
2. return `false` when the argument is not one of `i*`/`f*`/`ptr` to avoid second ICE.

fixes #120480
2024-02-03 22:25:14 +01:00
Matthias Krüger
326839bf7f
Rollup merge of #120616 - fmease:fix-ice-const-eval-fail-undef-field-access, r=compiler-errors
Fix ICE on field access on a tainted type after const-eval failure

Fixes #120615.

r? oli-obk or compiler
2024-02-03 21:29:45 +01:00
Matthias Krüger
2a8fc94697
Rollup merge of #120610 - petrochenkov:maybeownogen, r=cjgillot
hir: Remove the generic type parameter from `MaybeOwned`

It's only ever used with a reference to `OwnerInfo` as an argument.

Follow up to https://github.com/rust-lang/rust/pull/120346.
2024-02-03 21:29:44 +01:00
Matthias Krüger
968cff7cf3
Rollup merge of #120592 - trevyn:cleanup-to-string, r=Nilstrieb
Remove unnecessary `.to_string()`/`.as_str()`s
2024-02-03 21:29:43 +01:00
Matthias Krüger
019d28151d
Rollup merge of #120573 - nnethercote:rm-BorrowckErrors-tainted_by_errors, r=oli-obk
Remove `BorrowckErrors::tainted_by_errors`

This PR removes one of the `tainted_by_errors` occurrences, replacing it with direct use of `ErrorGuaranteed`.

r? `@oli-obk`
2024-02-03 21:29:43 +01:00
Matthias Krüger
b9c87b41d3
Rollup merge of #120571 - nnethercote:misc-diagnostics, r=oli-obk
Miscellaneous diagnostics cleanups

All found while working on some speculative, invasive changes, but worth doing in their own right.

r? `@oli-obk`
2024-02-03 21:29:42 +01:00
Matthias Krüger
7c932d9940
Rollup merge of #120570 - fmease:change-ty-to-ct-param-sugg, r=compiler-errors
Suggest changing type to const parameters if we encounter a type in the trait bound position

The first commit is just drive-by cleanup.

Provide a structured suggestion if the user forgot to prefix a “const parameter” with `const`, e.g., in `struct Tagged<TAG: u64>;`. This happens to me from time to time. Maybe C++ devs are also prone to this mistake given template syntax looks like `template<typename T, uint32_t N>`.
2024-02-03 21:29:42 +01:00
Matthias Krüger
892b0fd787
Rollup merge of #120566 - Zalathar:edition, r=compiler-errors
coverage: Use normal `edition:` headers in coverage tests

Some of these tests were originally written as part of a custom `run-make` test, so at that time they weren't able to use the normal compiletest header directive parser.

Now that they're properly integrated, there's no need for them to use `compile-flags` to specify the edition, since they can use `edition` instead.

In most cases the `.cov-map` snapshot isn't affected at all, but in a few cases we add or remove a line, which slightly disturbs the first line number in each instrumented function.
2024-02-03 21:29:41 +01:00
Matthias Krüger
977945d285
Rollup merge of #120562 - oli-obk:revert_stuff, r=cuviper
Revert unsound libcore changes

fixes #120537

these were introduced in #119911
2024-02-03 21:29:41 +01:00
Matthias Krüger
98d0d4595e
Rollup merge of #120004 - Mark-Simulacrum:relnotes-1.76, r=Mark-Simulacrum
Release notes for 1.76

Cargo, library stabilizations and some cleanups, particularly to future compat, still pending.

cc `@cuviper` `@rust-lang/release`
2024-02-03 21:29:40 +01:00
Matthias Krüger
17670ca5df
Rollup merge of #119543 - usamoi:avx512fp16, r=oli-obk
add avx512fp16 to x86 target features

std_detect avx512fp16: https://github.com/rust-lang/stdarch/pull/1508
2024-02-03 21:29:40 +01:00
León Orell Valerian Liehr
4f773af1cc
Check for presence of field in typeck results before visiting it
Co-authored-by: Michael Goulet <michael@errs.io>
2024-02-03 19:41:18 +01:00
Mark Rousskov
8f1573a585 Release notes for 1.76 2024-02-03 13:38:44 -05:00
bors
b11fbfbf35 Auto merge of #120617 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump to 1.78

r? `@Mark-Simulacrum`
2024-02-03 18:21:03 +00:00
Mark Rousskov
8ef369be88 Bump to 1.78 2024-02-03 13:14:34 -05:00
bors
0113bc9388 Auto merge of #16479 - lnicola:macos-12, r=lnicola
internal: Bump release runners to MacOS 12
2024-02-03 17:27:05 +00:00
Laurențiu Nicola
a605b9605e Bump release runners to MacOS 12 2024-02-03 19:16:32 +02:00
Vadim Petrochenkov
c5eca333fc hir: Remove the generic type parameter from MaybeOwned
It's only ever used with a reference to `OwnerInfo` as an argument.
2024-02-03 15:50:14 +03:00
klensy
17f0919e8a rustc_monomorphize: fix outdated comment in partition 2024-02-03 14:50:24 +03:00
Conrad Ludgate
4c694db252 add another test to make sure it still works with full reads 2024-02-03 11:46:54 +00:00
Vadim Petrochenkov
f5d6eb30a8 hir: Stop keeping prefixes for most of use list stems
And make sure all other imports have non-empty resolution lists.
2024-02-03 14:41:46 +03:00
Conrad Ludgate
a27e45a71b fix #120603 by adding a check in default_read_buf 2024-02-03 11:30:26 +00:00
trevyn
ef37dcb7db Remove unnecessary .to_string()/.as_str()s 2024-02-02 15:16:05 -08:00
Nicholas Nethercote
be64802854 Use StringPart more. 2024-02-03 09:02:50 +11:00
Nicholas Nethercote
0621cd46f2 Simplify future breakage control flow.
`emit_future_breakage` calls
`self.dcx().take_future_breakage_diagnostics()` and then passes the
result to `self.dcx().emit_future_breakage_report(diags)`. This commit
removes the first of these and lets `emit_future_breakage_report` do the
taking.

It also inlines and removes what is left of `emit_future_breakage`,
which has a single call site.
2024-02-03 09:02:50 +11:00
Nicholas Nethercote
b506cce579 Fix an incorrect comment. 2024-02-03 09:02:50 +11:00
Nicholas Nethercote
cd4c5cd8b8 Improve a local variable name. 2024-02-03 09:02:50 +11:00
Nicholas Nethercote
6fdaf3ef7f Use DiagnosticArgName in a few more places. 2024-02-03 09:02:50 +11:00
Nicholas Nethercote
df322fc29f Remove some unnecessary clone calls. 2024-02-03 09:02:50 +11:00
Nicholas Nethercote
8ba25d0989 SilentEmitter::fatal_note doesn't need to be optional. 2024-02-03 09:02:50 +11:00
Nicholas Nethercote
a9a2e1565a Diagnostic cleanups
- `emitted_at` isn't used outside the crate.
- `code` and `messages` are public fields, so there's no point have
  trivial getters/setters for them.
- `suggestions` is public, so the comment about "functionality on
  `Diagnostic`" isn't needed.
2024-02-03 09:02:50 +11:00
Nicholas Nethercote
585367f15f Remove an out-of-date comment.
`DiagnosticBuilderInner` was removed some time ago.
2024-02-03 09:02:50 +11:00
Nicholas Nethercote
54c4f94896 Make some fatal errors more concise. 2024-02-03 09:02:50 +11:00
Lukas Markeffsky
30e7b87e26 miri: normalize struct tail in ABI compat check 2024-02-02 21:39:00 +01:00
Ralf Jung
61d1ebe50b
fix typo
Co-authored-by: teor <teor@riseup.net>
2024-02-02 20:12:37 +01:00
Michael Goulet
e951bcff96 Normalize the whole PolyTypeOutlivesPredicate, more simplifications 2024-02-02 18:31:35 +00:00
Michael Goulet
a371059933 Don't hang when there's an infinite loop of outlives obligations 2024-02-02 18:30:21 +00:00
Michael Goulet
7d1fda7b40 Normalize type outlives obligations in NLL 2024-02-02 18:30:21 +00:00