Commit Graph

239120 Commits

Author SHA1 Message Date
Lukas Wirth
498f39eae2 fix: Diagnose everything in nested items, not just def diagnostics 2023-11-15 10:34:09 +01:00
bors
c94a6afbe6 Auto merge of #15900 - lnicola:no-32bit-vsix, r=lnicola
internal: Disable win32-ia32 VSIX builds

https://code.visualstudio.com/updates/v1_84#_windows-32bit-support-ends
2023-11-15 09:31:18 +00:00
Laurențiu Nicola
fb70fe27d4 Disable win32-ia32 VSIX builds 2023-11-15 11:07:31 +02:00
bors
ee85f7fc48 Auto merge of #117814 - RalfJung:rustc-logger-without-set-var, r=TaKO8Ki
rustc_log: provide a way to init logging based on the values, not names, of the env vars

Miri wants to affect how rustc does logging. So far this required setting environment variables before calling `rustc_driver::init_rustc_env_logger`. However, `set_var` is a function one should really [avoid calling](https://github.com/rust-lang/rust/issues/90308), so this adds the necessary APIs to rustc such that Miri can just pass it the *values* of all the log-relevant environment variables, rather than having to change the global environment.
2023-11-15 08:03:07 +00:00
bors
f888a6eb5f Auto merge of #15899 - lnicola:sync-from-rust, r=Veykril
internal: Sync from rust
2023-11-15 08:01:51 +00:00
Thom Chiovoloni
268f5c57b9 Ensure strings created with const_str get the unnamed_addr attribute 2023-11-15 07:56:40 +00:00
Laurențiu Nicola
6b53c09ef5 Merge branch 'master' into sync-from-rust 2023-11-15 09:46:27 +02:00
Laurențiu Nicola
610eafe009 Merge commit '76633199f4316b9c659d4ec0c102774d693cd940' into sync-from-rust 2023-11-15 09:45:17 +02:00
bors
662ea3f9f4 Auto merge of #11811 - y21:avoid_cx_struct_span_lint, r=Manishearth
disallow calls to `LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir`

`LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir` don't show the link to the clippy documentation, see: #11805

In #11810, the last few calls to those methods were replaced with `span_lint_*`. It seems like we should just disallow them altogether so that no new code tries to use them.

The existing `disallowed_methods` lint makes this easy.

changelog: none
2023-11-15 07:27:46 +00:00
bors
31e62a923d Auto merge of #3165 - rust-lang:rustup-2023-11-15, r=RalfJung
Automatic Rustup
2023-11-15 06:49:27 +00:00
bors
698fcc8219 Auto merge of #117517 - klinvill:smir-projections, r=ouz-a
Add richer structure for Stable MIR Projections

Resolves https://github.com/rust-lang/project-stable-mir/issues/49.

Projections in Stable MIR are currently just strings. This PR replaces that representation with a richer structure, namely projections become vectors of `ProjectionElem`s, just as in MIR. The `ProjectionElem` enum is heavily based off of the MIR `ProjectionElem`.

This PR is a draft since there are several outstanding issues to resolve, including:

- How should `UserTypeProjection`s be represented in Stable MIR? In MIR, the projections are just a vector of `ProjectionElem<(),()>`, meaning `ProjectionElem`s that don't have Local or Type arguments (for `Index`, `Field`, etc. objects). Should `UserTypeProjection`s be represented this way in Stable MIR as well? Or is there a more user-friendly representation that wouldn't drag along all the `ProjectionElem` variants that presumably can't appear?
- What is the expected behavior of a `Place`'s `ty` function? Should it resolve down the chain of projections so that something like `*_1.f` would return the type referenced by field `f`?
- Tests should be added for `UserTypeProjection`
2023-11-15 06:05:54 +00:00
The Miri Conjob Bot
34e83402b8 Merge from rustc 2023-11-15 05:12:10 +00:00
The Miri Conjob Bot
39e142ffd5 Preparing for merge from rustc 2023-11-15 05:05:53 +00:00
Nicholas Nethercote
000767564e Remove unused features. 2023-11-15 15:40:57 +11:00
bors
783b914fae Auto merge of #11804 - y21:issue-11803, r=dswij
[`impl_trait_in_params`]: avoid ICE when function with `impl Trait` type has no parameters

Fixes #11803

If I'm reading the old code correctly, it was taking the span of the first parameter (without checking that it exists, which caused the ICE) and uses that to figure out where the generic parameter to insert should go (cc `@blyxyas` you wrote the lint, is that correct?).
This seemed equivalent to just `generics.span`, which doesn't require calculating the spans like that and simplifies it a fair bit

changelog: don't ICE when function has no parameters but generics have an `impl Trait` type
2023-11-15 04:03:44 +00:00
bors
cc8681b64b Auto merge of #117917 - slanterns:slanterns-1.74-release_note, r=Mark-Simulacrum
Add missing entries in 1.74 release notes
2023-11-15 03:56:07 +00:00
y21
19eec0b7cc disallow struct_span_lint 2023-11-15 03:20:04 +01:00
Kirby Linvill
c036a10ed5
Make UserTypeProjection projections Opaque
Also shifts comments explaining why Stable MIR drops an optional variant
name field, for `Downcast` projection elements, to the `Place::stable`
function.
2023-11-14 19:19:35 -07:00
bors
6d069a0ac7 Auto merge of #117359 - tmiasko:call-def, r=cjgillot
Fix def-use check for call terminators

Fixes #117331.
2023-11-15 01:31:46 +00:00
lcnr
18281d39cf fix doc link 2023-11-15 01:24:44 +00:00
bors
abf01e469b Auto merge of #11810 - Jacherr:cast-possible-wrap-link, r=Manishearth
add help text where missing to lints

Fixes https://github.com/rust-lang/rust-clippy/issues/11805

Essentially just changes the section of code that applies the lint from using `cx.struct_span_lint` and instead opts for `span_lint_and_then`, which automatically appends the help text.

changelog: add missing help text for `cast_possible_wrap`, `mod_module_files`, and `self_named_module_files` lints
2023-11-15 01:23:11 +00:00
Jacherr
11881bee6b also move module_style to span_lint_x functions 2023-11-15 01:10:20 +00:00
Slanterns
563d975364
tidy 2023-11-15 08:56:00 +08:00
Jacherr
a86a57079d replace lint with span_lint_and_then 2023-11-15 00:14:38 +00:00
DropDemBits
3f99a56fae
Fix panic in add_type_ascription
Assist wasn't applicable when the let statement was missing a pattern
before, so we should do the same now.
2023-11-14 18:43:48 -05:00
hrxi
b3073c536b Change if_same_then_else to be a style lint
CC #3770

From https://github.com/rust-lang/rust-clippy/issues/3770#issuecomment-687565594 (@flip1995):

> Oh I thought I replied to this: I definitely see now that having this
> as a correctness lint might be the wrong categorization. What we might
> want to do is to just allow this lint, if there are comments in the
> arm bodies. But a good first step would be to downgrade this lint to
> style or complexity. I would vote for style since merging two arms is
> not always less complex.
2023-11-15 00:33:14 +01:00
bors
003fa886f5 Auto merge of #117915 - matthiaskrgr:rollup-ztljqrr, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #116244 (Apply structured suggestion that allows test to work since 1.64)
 - #117686 (Build pre-coroutine-transform coroutine body on error)
 - #117834 (target_feature: make it more clear what that 'Option' means)
 - #117893 (Suggest dereferencing the LHS for binops such as `&T == T`)
 - #117911 (Fix some typos)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-14 22:36:39 +00:00
DropDemBits
df629627c5
Add tests for LetStmt::set_ty 2023-11-14 17:35:24 -05:00
Slanterns
7f10299d9b
Add missing entries in 1.74 release notes 2023-11-15 06:01:57 +08:00
Mohsen Zohrevandi
ec8c3d9992 Move SGX-specific image base logic to sys_common 2023-11-14 13:27:57 -08:00
bors
c1e65aa588 Auto merge of #15895 - Veykril:unsafe-impls-diagnostic, r=Veykril
Diagnose missing assoc items in trait impls
2023-11-14 21:11:23 +00:00
Lukas Wirth
723d799ec1 Diagnose missing assoc items in trait impls 2023-11-14 22:00:52 +01:00
Matthias Krüger
2e00c6ffd7
Rollup merge of #117911 - catandcoder:master, r=lqd
Fix some typos
2023-11-14 21:50:39 +01:00
Matthias Krüger
52f3a6fdb2
Rollup merge of #117893 - sjwang05:issue-52544-take-1, r=wesleywiser
Suggest dereferencing the LHS for binops such as `&T == T`

Fixes #52544
2023-11-14 21:50:39 +01:00
Matthias Krüger
7435887d6c
Rollup merge of #117834 - RalfJung:target-feature-stability, r=b-naber
target_feature: make it more clear what that 'Option' means

Reading those tables in compiler/rustc_codegen_ssa/src/target_features.rs, it's not immediately clear that `None` means "stable". Let's use an enum with appropriately named variants to make that more obvious.
2023-11-14 21:50:38 +01:00
Matthias Krüger
d2cdf6c479
Rollup merge of #117686 - compiler-errors:gen-body, r=wesleywiser
Build pre-coroutine-transform coroutine body on error

I was accidentally building the post-transform coroutine body, rather than the pre-transform coroutine body. There's no pinning expected here yet, and the return type isn't yet transformed into `CoroutineState`.

Fixes #117670
2023-11-14 21:50:38 +01:00
Matthias Krüger
00ba7fc007
Rollup merge of #116244 - estebank:issue-73497, r=b-naber
Apply structured suggestion that allows test to work since 1.64

Close #73497.
2023-11-14 21:50:37 +01:00
bors
dd430bc8c2 Auto merge of #117907 - nikic:update-llvm-17, r=cuviper
Update to LLVM 17.0.5

Fixes https://github.com/rust-lang/rust/issues/116177.
Fixes the compile-time issue reported at https://internals.rust-lang.org/t/significant-increase-in-fat-lto-time-post-update-to-rustc-1-75-0-nightly/19765.

r? `@cuviper`
2023-11-14 20:39:19 +00:00
bors
989000b8c5 Auto merge of #15893 - Veykril:unsafe-impls-diagnostic, r=Veykril
Diagnose incorrect unsafety for trait impls
2023-11-14 20:24:21 +00:00
Lukas Wirth
e21d21a8fb Diagnose incorrect unsafety for trait impls 2023-11-14 21:05:27 +01:00
bors
49b27f4efb Auto merge of #117701 - lnicola:sync-from-ra, r=onur-ozkan,HKalbasi
Subtree update of `rust-analyzer`

r? `@HKalbasi`
2023-11-14 18:43:27 +00:00
Mohsen Zohrevandi
6e7ea03c26 Adjust frame IP in backtraces relative to image base for SGX target 2023-11-14 10:27:12 -08:00
bors
6e4538a6e9 Auto merge of #15891 - Veykril:orphan-impls, r=Veykril
feat: Diagnose some orphan trait impl cases
2023-11-14 17:55:30 +00:00
Lukas Wirth
d5faad1dae Fix inlay-hint tests being invalidated by minicore chanes 2023-11-14 18:53:48 +01:00
Lukas Wirth
6ddccc9a6e Diagnose some orphan trait impl cases 2023-11-14 18:09:34 +01:00
xFrednet
cab975c713
Changelog for Rust 1.74 🎃 2023-11-14 18:08:00 +01:00
xFrednet
9401cf21e4
Update version attribute for 1.74 lints 2023-11-14 18:08:00 +01:00
Ed Page
c8330ba354 docs(release): Remove unstable cargo change 2023-11-14 10:20:06 -06:00
Tomasz Miąsko
6873465600 Fix def-use check for call terminators 2023-11-14 17:07:34 +01:00
Laurențiu Nicola
d45ff2484f Depend on rustc_driver 2023-11-14 18:07:02 +02:00