bors
603270011e
Auto merge of #109944 - cjgillot:lint-cstring-macro, r=Nilstrieb
...
Do not suppress temporary_cstring_as_ptr in macros.
There isn't really a reason to skip the lint when part of the expression comes from an expansion.
Fixes https://github.com/rust-lang/rust/issues/94694
2023-04-04 22:35:09 +00:00
bors
700938c078
Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoerister
...
Extend -Cdebuginfo with new options and named aliases
This is a rebase of https://github.com/rust-lang/rust/pull/83947 , along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F ). The description for the original PR follows below.
Note that the changes in this PR have already been through FCP: https://github.com/rust-lang/rust/pull/83947#issuecomment-878384979
Closes https://github.com/rust-lang/rust/pull/109311 . Helps with https://github.com/rust-lang/rust/pull/104968 .
r? `@michaelwoerister` cc `@cuviper`
---
The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options.
Fix https://github.com/rust-lang/rust/issues/60020
Fix https://github.com/rust-lang/rust/issues/64405
2023-04-04 20:01:05 +00:00
Scott McMurray
21bb8ef24e
Use FieldIdx in FieldsShape
...
Finally got to the main motivating example from the MCP :)
2023-04-04 12:38:06 -07:00
Camille GILLOT
8528ac6e35
Do not suppress temporary_cstring_as_ptr in macros.
2023-04-04 18:55:02 +00:00
Michael Goulet
b0483e8004
Rollup merge of #109938 - oli-obk:try_norm, r=compiler-errors
...
Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible
fixes #109743
This hack didn't need to live in the mir interpreter. For const-prop-lint it is entirely correct to avoid doing any const prop if normalization fails at this stage. Most likely we couldn't const propagate anything anyway, and if revealing was needed (so opaque types were involved), we wouldn't want to be too smart and leak the hidden type anyway.
2023-04-04 09:27:47 -07:00
Michael Goulet
a5c395ed94
Rollup merge of #109914 - compiler-errors:rtn-bad-parens, r=oli-obk
...
Emit feature error for parenthesized generics in associated type bounds
We don't actually do AST->HIR lowering with some `-Zunpretty` flags, so it's not correct to just delay a bug instead of emitting a feature error.
Some diagnostics regressed because of the new errors, but oh well. 🤷
Fixes #109898
2023-04-04 09:27:46 -07:00
Michael Goulet
5485a54e19
Rollup merge of #109913 - scottmcm:index-slice, r=WaffleLapkin
...
Doc-comment `IndexVec::from_elem` and use it in a few more places
Since this PR is a reply to https://github.com/rust-lang/rust/pull/109819#discussion_r1156128164 ,
r? ``@WaffleLapkin``
2023-04-04 09:27:45 -07:00
Michael Goulet
ed17b599df
Rollup merge of #109901 - cjgillot:validate-debuginfo, r=b-naber
...
Enforce VarDebugInfo::Place in MIR validation.
2023-04-04 09:27:44 -07:00
Michael Goulet
4d32de6fcb
Rollup merge of #109838 - clubby789:non-exhaustive-span, r=Nilstrieb
...
Fix `non_exhaustive_omitted_patterns` lint span
Fixes #109837
`DUMMY_SP` was being passed as the span in many cases where we have a span available to use. This meant that the location of the violating pattern wasn't shown, or the list of un-covered variants
r? `@Nilstrieb`
2023-04-04 09:27:44 -07:00
Michael Goulet
ec22850c2c
Rollup merge of #109723 - oli-obk:ast_refactor, r=Nilstrieb
...
Pull some tuple variant fields out into their own struct
This is groundwork for adding more fields to those new structs, but I believe the change to be useful on its own.
r? `@Nilstrieb` but feel free to reroll for `compiler`
2023-04-04 09:27:43 -07:00
IQuant
3fb6d6b2f4
Now passes tests
2023-04-04 19:18:34 +03:00
IQuant
467d367df7
Rename tuple_wrap_err_subdiag to suggest_wrap_to_build_a_tuple, making it more consistent with similar functions
2023-04-04 18:50:07 +03:00
IQuant
21d5bedd5f
Extract suggest_specify_actual_length into a separate function
2023-04-04 18:50:07 +03:00
IQuant
6a05cd85ad
A more general implementation of IntoDiagnosticArg for Binder (Also removes DiagArg, as it's no longer necessary)
2023-04-04 18:50:07 +03:00
IQuant
fd18d9a584
Renamed TypeErrorAdditionalDiags (was Error0308Subdiags) and ObligationCauseFailureCode (was FailureCodeDiagnostics)
2023-04-04 18:50:07 +03:00
IQuant
aa33a6fca2
Move and document escape_literal function
2023-04-04 18:50:07 +03:00
IQuant
e813b6d6e1
Update compiler/rustc_infer/src/infer/error_reporting/suggest.rs
...
Co-authored-by: David Wood <agile.lion3441@fuligin.ink >
2023-04-04 18:50:07 +03:00
IQuant
1f09bc77c1
Migrate (most of) report_and_explain_type_error
2023-04-04 18:50:02 +03:00
IQuant
ab11b4389e
FailureCode::Error0038 is unreachable, so can be removed
2023-04-04 18:34:50 +03:00
IQuant
b610ce72ce
Migrate TupleTrailingCommaSuggestion
2023-04-04 18:34:50 +03:00
IQuant
d18adb7d56
Migrate SuggestTuplePattern
2023-04-04 18:34:50 +03:00
IQuant
23b8567a78
Migrate SuggestBoxingForReturnImplTrait, Fix typo in infer_fn_consider_casting
2023-04-04 18:34:50 +03:00
IQuant
d56b304bc8
Migrate SuggestAccessingField
2023-04-04 18:34:50 +03:00
IQuant
b36abea285
Migrate SuggestAsRefWhereAppropriate
2023-04-04 18:34:50 +03:00
IQuant
37f55691f4
Ported FunctionPointerSuggestion
2023-04-04 18:34:50 +03:00
Oli Scherer
373807a95c
Rename ast::Static to ast::StaticItem to match ast::ConstItem
2023-04-04 15:34:40 +00:00
Oli Scherer
4bebdd7104
box a bunch of large types
2023-04-04 13:58:50 +00:00
clubby789
ebde2ab363
Deny useing tool paths
2023-04-04 14:10:13 +01:00
Michael Woerister
6117c06306
incr.comp.: Make sure dependencies are recorded when feeding queries during eval-always queries.
2023-04-04 14:38:46 +02:00
klensy
f41e711b7e
replace
...
LLVMRustBuildIntCast -> LLVMBuildIntCast2
LLVMRustAddHandler -> LLVMAddHandler
2023-04-04 15:12:36 +03:00
klensy
cc77ae07a9
Use existing llvm methods, instead of rust wrappers for:
...
LLVMRustBuildCleanupPad -> LLVMBuildCleanupPad
LLVMRustBuildCleanupRet -> LLVMBuildCleanupRet
LLVMRustBuildCatchPad -> LLVMBuildCatchPad
LLVMRustBuildCatchRet -> LLVMBuildCatchRet
LLVMRustBuildCatchSwitch -> LLVMBuildCatchSwitch
2023-04-04 15:12:36 +03:00
klensy
076116bb4c
replace LLVMRustAppendModuleInlineAsm with LLVMAppendModuleInlineAsm, LLVMRustMetadataTypeInContext with LLVMMetadataTypeInContext
2023-04-04 15:12:35 +03:00
klensy
c53a9faa6f
replace LLVMRustMetadataAsValue with LLVMMetadataAsValue
2023-04-04 15:12:35 +03:00
klensy
7d6181e4d8
add bunch of fixmes: currently there exist some functions that accept LLVMValueRef, some that accept LLVMMetadataRef, and replacing one with another not always possible without explicit convertion
2023-04-04 15:12:33 +03:00
klensy
0b5f9ac73e
replace deprecated LLVMSetCurrentDebugLocation with LLVMSetCurrentDebugLocation2
2023-04-04 15:12:32 +03:00
bors
be8e5ba157
Auto merge of #109917 - compiler-errors:remove-relation-methods, r=oli-obk
...
Remove `intercrate` and `mark_ambiguous` from `TypeRelation`
Fixes #109863
Pulls this logic into `super_combine_tys`, which has access to `InferCtxt` and takes a `ObligationEmittingRelation` -- both of which simplify the logic here.
r? `@oli-obk` `@aliemjay`
2023-04-04 11:08:23 +00:00
Oli Scherer
b5d96d5ec5
Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible
2023-04-04 10:39:26 +00:00
Oli Scherer
ec74653652
Split out ast::ItemKind::Const into its own struct
2023-04-04 09:44:50 +00:00
Oli Scherer
e3828777a6
rust-analyzer guided tuple field to named field
2023-04-04 09:44:50 +00:00
Oli Scherer
b08a557f80
rust-analyzer guided enum variant structification
2023-04-04 09:44:45 +00:00
zhaixiaojuan
737e1d2569
loongarch64: calculate the ELF header flags
2023-04-04 17:11:40 +08:00
zhaixiaojuan
b7c5323d42
Add loongarch64 to fn create_object_file
2023-04-04 17:05:08 +08:00
zhaixiaojuan
ccf5417799
Enable loongarch64 LLVM target
2023-04-04 17:05:08 +08:00
zhaixiaojuan
ad26dab27c
Initial support for loongarch64-unknown-linux-gnu
2023-04-04 17:05:07 +08:00
Oli Scherer
54214c8d8d
Use a simpler atomic operation than the compare_exchange hammer
2023-04-04 09:01:44 +00:00
Oli Scherer
300901b705
Use new iteration helpers instead of manually rolling them
2023-04-04 09:01:44 +00:00
Oli Scherer
a1d20cf7a2
Another AppendOnlyVec
2023-04-04 09:01:44 +00:00
Oli Scherer
7edd1d8799
Replace another lock with an append-only vec
2023-04-04 09:01:44 +00:00
Oli Scherer
4699632637
Remove a lock in favor of an AppendOnlyVec
2023-04-04 09:01:44 +00:00
Oli Scherer
daee746771
Add a usize-indexed append-only-vec
2023-04-04 09:01:44 +00:00