Commit Graph

239433 Commits

Author SHA1 Message Date
bors
855c6836b7 Auto merge of #118071 - Urgau:check-cfg-cargo-feature, r=petrochenkov
Remove `feature` from the list of well known check-cfg name

This PR removes `feature` from the list of well known check-cfg.

This is done for multiple reasons:
 - Cargo is the source of truth, rustc shouldn't have any knowledge of it
 - It creates a conflict between Cargo and rustc when there are no features defined.
   In this case Cargo won't pass any `--check-cfg` for `feature` since no feature will ever be passed, but rustc by having in it's list adds a implicit `cfg(feature, values(any()))` which is completely wrong. Having any cfg `feature` is unexpected not allow any `feature` value.

While doing this, I took the opportunity to specialise the diagnostic a bit for the case above.

r? `@petrochenkov`
2023-11-22 07:31:13 +00:00
Ralf Jung
32fc54e5fa make the 'abi_unadjusted' feature internal 2023-11-22 07:25:27 +01:00
bors
cc4bb0de20 Auto merge of #117928 - nnethercote:rustc_ast_pretty, r=fee1-dead
`rustc_ast_pretty` cleanups

Some improvements I found while looking at this code.

r? `@fee1-dead`
2023-11-22 05:09:33 +00:00
Michael Goulet
4f958a4802 Allow defining opaques in check_coroutine_obligations 2023-11-22 03:44:13 +00:00
Celina G. Val
c07a6d5c9a Add allocation test and a bit more documentation 2023-11-21 19:16:58 -08:00
Celina G. Val
5b3cf6610b Add support to get virtual table allocation 2023-11-21 19:16:58 -08:00
Celina G. Val
fa5ff859e6 Add support to global allocation to stable-mir 2023-11-21 19:16:53 -08:00
bors
739d556826 Auto merge of #117582 - compiler-errors:uplift-canonical-var, r=jackh726
Uplift `CanonicalVarInfo` and friends into `rustc_type_ir`

Depends on #117580 and #117578

Uplift `CanonicalVarInfo` and friends into `rustc_type_ir` so they can be consumed by an interner-agnostic `Canonicalizer` implementation for the new trait solver ❤️

r? `@ghost`
2023-11-22 02:43:23 +00:00
Nicholas Nethercote
971010ea5a Merge Queries::{ongoing_codegen,linker}.
There is no real need for them to be separate.
2023-11-22 13:22:49 +11:00
Nicholas Nethercote
3a4798c92d Make Compiler::{sess,codegen_backend} public.
And remove the relevant getters on `Compiler` and `Queries`.
2023-11-22 13:22:41 +11:00
Nicholas Nethercote
09c807ed82 Add two useful comments. 2023-11-22 13:20:56 +11:00
Nicholas Nethercote
cf561904db Add comments about a timer. 2023-11-22 13:20:56 +11:00
bors
ed10a53025 Auto merge of #118152 - matthiaskrgr:rollup-bqcck4w, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #117972 (Add VarDebugInfo to Stable MIR)
 - #118109 (rustdoc-search: simplify `checkPath` and `sortResults`)
 - #118110 (Document `DefiningAnchor` a bit more)
 - #118112 (Don't ICE when ambiguity is found when selecting `Index` implementation in typeck)
 - #118135 (Remove quotation from filename in stable_mir)

Failed merges:

 - #118012 (Add support for global allocation in smir)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-22 00:30:56 +00:00
Chris Denton
ad12be3668
allow clippy style in windows/c.rs
We intentional use the Windows API style here.
2023-11-22 00:14:46 +00:00
Nicholas Nethercote
6686221d29 Remove outdated reference to compiler plugins. 2023-11-22 11:06:24 +11:00
Nicholas Nethercote
9fe6bb4a10 Add some comments. 2023-11-22 11:06:16 +11:00
Matthias Krüger
914891fc58
Rollup merge of #118135 - ouz-a:fix_stable_span, r=celinval
Remove quotation from filename in stable_mir

Previously we had quotation marks in filenames which is obviously wrong this fixes that.

r? ```@celinval```
2023-11-21 23:46:20 +01:00
Matthias Krüger
802f71b294
Rollup merge of #118112 - compiler-errors:index-ambiguity-ice, r=aliemjay
Don't ICE when ambiguity is found when selecting `Index` implementation in typeck

Fixes #118111

The problem here is when we're manually "selecting" an impl for `base_ty: Index<?0>`, we don't consider placeholder region errors (leak check) or ambiguous predicates. Those can lead to us not actually emitting any fulfillment errors on line 3131.
2023-11-21 23:46:20 +01:00
Matthias Krüger
a11be28e13
Rollup merge of #118110 - compiler-errors:defining-anchor, r=aliemjay
Document `DefiningAnchor` a bit more

r? types
2023-11-21 23:46:19 +01:00
Matthias Krüger
bdb929e788
Rollup merge of #118109 - notriddle:notriddle/search-cleanup-2, r=GuillaumeGomez
rustdoc-search: simplify `checkPath` and `sortResults`

These two commits reduce the amount of code in search.js with no noticeable change in performance.

https://notriddle.com/rustdoc-html-demo-5/profile-5/index.html
2023-11-21 23:46:19 +01:00
Matthias Krüger
a98698e9c4
Rollup merge of #117972 - ouz-a:stable_debuginfo, r=celinval
Add VarDebugInfo to Stable MIR

Previously we omitted `VarDebugInfo` because we didn't have `Projection` now that https://github.com/rust-lang/rust/pull/117517 is merged it's possible to add `VarDebugInfo` information in `Body`. This PR adds stable version of the `VarDebugInfo` to `Body`

r? ```@celinval```
2023-11-21 23:46:18 +01:00
Arlie Davis
80896cbe35 update -Cehcont-guard and comment 2023-11-21 14:35:02 -08:00
bors
fec80b4475 Auto merge of #118143 - Nilstrieb:only-borrow-what-you-need, r=compiler-errors
Fix `clippy::needless_borrow` in the compiler

`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed now.

r? `@compiler-errors` you told me you want to review this

I will do a self review first (which, for this, is easiest on GitHub once the PR is open) - did it
2023-11-21 22:34:19 +00:00
Arlie Davis
9429d68842 convert ehcont-guard to an unstable option 2023-11-21 14:24:23 -08:00
Arlie Davis
d582f1092b x.py fmt 2023-11-21 13:41:24 -08:00
Arlie Davis
e11d8d147b Add support for generating the EHCont section
In the future Windows will enable Control-flow Enforcement Technology
(CET aka Shadow Stacks). To protect the path where the context is
updated during exception handling, the binary is required to enumerate
valid unwind entrypoints in a dedicated section which is validated when
the context is being set during exception handling.

The required support for EHCONT has already been merged into LLVM,
long ago. This change adds the Rust codegen option to enable it.

Reference:

* https://reviews.llvm.org/D40223

This also adds a new `ehcont-guard` option to the bootstrap config which
enables EHCont Guard when building std.
2023-11-21 13:41:23 -08:00
Nicholas Nethercote
10c8b56af1 Factor out common code in PrintState.
The AST and HIR versions of `State::print_ident` are textually
identical, but the types differ slightly. This commit factors out the
common code they both have by replacing `print_ident` with `ann_post`,
which is a smaller function that still captures the type difference.
2023-11-22 08:13:21 +11:00
Nicholas Nethercote
e16b52d4f0 Streamline PrintState.
`PrintState` is a trait containing code that can be used by both AST and
HIR pretty-printing. But several of its methods are only used by AST
printing.

This commit moves those methods out of the trait and into the AST
`State` impl, so they are not exposed unnecessarily. This commit also
removes four unused methods: `param_to_string`,
`foreign_item_to_string`, `assoc_item_to_string`, and
`print_inner_attributes_inline`.
2023-11-22 08:13:21 +11:00
Nicholas Nethercote
c6a9027102 Remove unused PrintState::generic_params_to_string method. 2023-11-22 08:13:21 +11:00
Nicholas Nethercote
d9443f71c7 Remove or downgrade unnecessary pub visibility markers. 2023-11-22 08:13:21 +11:00
Nicholas Nethercote
33cee0b22c Remove NO_ANN.
This makes `rustc_hir_pretty` more like `rustc_ast_pretty`.
2023-11-22 08:13:21 +11:00
Nicholas Nethercote
ce363bb6e6 Remove IterDelimited.
itertools has `with_position` which does the same thing.
2023-11-22 08:13:21 +11:00
Nicholas Nethercote
3eadc6844b Update itertools to 0.11.
Because the API for `with_position` improved in 0.11 and I want to use
it.
2023-11-22 08:13:21 +11:00
Nicholas Nethercote
1d320ed387 Remove unnecessary derives. 2023-11-22 08:13:21 +11:00
Nicholas Nethercote
2f51f0b290 Remove unneeded features. 2023-11-22 08:13:21 +11:00
Nilstrieb
c089a162d8 Fix some unnecessary casts
`x clippy compiler -Aclippy::all -Wclippy::unnecessary_cast --fix`
with some manual review to ensure every fix is correct.
2023-11-21 22:11:08 +01:00
Michael Howell
28f17d97a9 rustdoc-search: make primitives and keywords less special
The search sorting code already sorts by item type discriminant,
putting things with smaller discriminants first. There was
also a special case for sorting keywords and primitives earlier,
and this commit removes it by giving them lower discriminants.

The sorting code has another criteria where items with descriptions
appear earlier than items without, and that criteria has higher
priority than the item type. This shouldn't matter, though,
because primitives and keywords normally only appear in the
standard library, and it always gives them descriptions.
2023-11-21 13:59:26 -07:00
Michael Howell
d82a08537a rustdoc-search: clean up checkPath
This computes the same result with less code by computing many of
the old checks at once:

* It won't enter the loop if clength > length, because then the
  result of length - clength will be negative and the
  loop conditional will fail.
* i + clength will never be greater than length, because it
  starts out as i = length - clength, implying that i + clength
  equals length, and it only goes down from there.
* The aborted variable is replaced with control flow.
2023-11-21 13:09:53 -07:00
Nilstrieb
21a870515b Fix clippy::needless_borrow in the compiler
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed
now.
2023-11-21 20:13:40 +01:00
Ben Kimock
e6f8edff37 Tighten up linkage settings for LLVM bindings 2023-11-21 13:43:11 -05:00
Michael Goulet
128feaa2b4 Restore closure-kind error messages 2023-11-21 18:35:47 +00:00
Michael Goulet
93298ee0dd Remove ClosureKind predicate kind 2023-11-21 18:35:45 +00:00
Urgau
54c122ec0d [Miri] Do not respect RUSTC_HOST_FLAGS since RUSTFLAGS isn't
When building the standard library with Miri, it appears that cargo-miri
does not respect the RUSTFLAGS and even if they did it would be wrong
since they are created for ToolRustc not Std. To avoid errors ignore
RUSTC_HOST_FLAGS for Miri.
2023-11-21 19:06:58 +01:00
Urgau
1c37997fa7 Improve diagnostic for unexpected feature config name from Cargo 2023-11-21 19:06:58 +01:00
Urgau
9f15acec47 Remove feature from the list of well known check-cfg name 2023-11-21 19:06:58 +01:00
Michael Goulet
d1daf0e841 Uplift CanonicalVarInfo and friends 2023-11-21 17:49:57 +00:00
Michael Goulet
f26e8ff3ac Uplift BoundVar 2023-11-21 17:49:56 +00:00
bors
2f8d81f9db Auto merge of #118137 - roblabla:update-backtrace, r=ChrisDenton
Update backtrace submodule

This PR updates the backtrace submodule, avoiding panics when resolving backtraces on Windows 7:

- https://github.com/rust-lang/backtrace-rs/pull/578

Fixes #117941

I ran the std unit tests locally on a Windows7 machine, and can confirm that this indeed fixes #117941.
2023-11-21 17:23:25 +00:00
roblabla
08803eb4c8 Update backtrace submodule 2023-11-21 16:33:42 +01:00
bors
0ff8610964 Auto merge of #118134 - Nilstrieb:rollup-kyo1l6e, r=Nilstrieb
Rollup of 6 pull requests

Successful merges:

 - #116085 (rustdoc-search: add support for traits and associated types)
 - #117522 (Remove `--check-cfg` checking of command line `--cfg` args)
 - #118029 (Expand Miri's BorTag GC to a Provenance GC)
 - #118035 (Fix early param lifetimes in generic_const_exprs)
 - #118083 (Remove i686-apple-darwin cross-testing)
 - #118091 (Remove now deprecated target x86_64-sun-solaris.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-21 15:08:24 +00:00