Commit Graph

29 Commits

Author SHA1 Message Date
David Wood 2575b1abc9 session: diagnostic migration lint on more fns
Apply the diagnostic migration lint to more functions on `Session`.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30 17:11:35 +00:00
Arpad Borsos 9f5a933f00 Remove backwards compat for LLVM 12 coverage format 2023-01-09 16:31:24 +01:00
bors aef17b7ae6 Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa
Check AArch64 branch-protection earlier in the pipeline.

As suggested in #93516.

r? `@nagisa`
2022-12-17 12:10:27 +00:00
Jacob Bramley 49f3c0b736 Check AArch64 branch-protection earlier in the pipeline.
As suggested in #93516.
2022-12-06 15:51:57 +00:00
Peter Collingbourne 5873ebeef3 Move linkage type check to HIR analysis and fix semantics issues.
This ensures that the error is printed even for unused variables,
as well as unifying the handling between the LLVM and GCC backends.

This also fixes unusual behavior around exported Rust-defined variables
with linkage attributes. With the previous behavior, it appears to be
impossible to define such a variable such that it can actually be imported
and used by another crate. This is because on the importing side, the
variable is required to be a pointer, but on the exporting side, the
type checker rejects static variables of pointer type because they do
not implement `Sync`. Even if it were possible to import such a type, it
appears that code generation on the importing side would add an unexpected
additional level of pointer indirection, which would break type safety.

This highlighted that the semantics of linkage on Rust-defined variables
is different to linkage on foreign items. As such, we now model the
difference with two different codegen attributes: linkage for Rust-defined
variables, and import_linkage for foreign items.

This change gives semantics to the test
src/test/ui/linkage-attr/auxiliary/def_illtyped_external.rs which was
previously expected to fail to compile. Therefore, convert it into a
test that is expected to successfully compile.

The update to the GCC backend is speculative and untested.
2022-12-05 15:05:43 -08:00
bjorn3 be6708428f Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
2022-11-26 19:35:32 +00:00
SLASHLogin a8a8055cc7 Use LayoutError's implementation of IntoDiagnostic 2022-11-09 14:56:21 +01:00
SLASHLogin 9a1545861e Simplify existing Diagnostic implementations 2022-11-09 14:56:21 +01:00
SLASHLogin 3728e95596 Port diagnostics created by Handler 2022-11-09 14:56:21 +01:00
SLASHLogin 67394e7945 Flatten diagnostic structs 2022-11-09 14:56:21 +01:00
SLASHLogin 185ef7b6de Port MissingFeatures and TargetFeatureDisableOrEnable 2022-11-09 14:56:21 +01:00
SLASHLogin 33ef16f291 Port UnknownArchiveKind 2022-11-09 14:56:21 +01:00
SLASHLogin c01546fcd6 Port DlltoolFailImportLibrary and implement IntoDiagnosticArg for Cow<'a, str> 2022-11-09 14:56:21 +01:00
SLASHLogin 81f7a8d7f1 Port ErrorCallingDllTool 2022-11-09 14:56:21 +01:00
SLASHLogin ddbb650289 Import ErrorWritingDEFFile 2022-11-09 14:56:21 +01:00
SLASHLogin d32caf9ced Port ArchiveBuildFailure 2022-11-09 14:56:21 +01:00
SLASHLogin 978b5f73e4 Port SanitizerMemtagRequiresMte 2022-11-09 14:56:21 +01:00
SLASHLogin 60ee496c74 Port LinkageConstOrMutType error 2022-11-09 14:56:20 +01:00
SLASHLogin 5d79d3c4bb Port InvalidMinimumAlignment 2022-11-09 14:56:20 +01:00
SLASHLogin 39d363fd58 Port layout size overflow 2022-11-09 14:56:20 +01:00
SLASHLogin 59b8aedf0e Port branch protection on aarch64 2022-11-09 14:56:20 +01:00
SLASHLogin ec1e101e1b Fix diag() and formatting 2022-11-09 14:56:20 +01:00
SLASHLogin 9f0c16576b Port symbol_already_defined error 2022-11-09 14:56:20 +01:00
SLASHLogin 4c625dc682 Port Instrument coverage requires llvm 12 to the new struct 2022-11-09 14:56:20 +01:00
SLASHLogin 05ae7ecb74 Import error creating import library 2022-11-09 14:56:20 +01:00
SLASHLogin 69d412a073 Missing lifetime parameter and formatting 2022-11-09 14:56:20 +01:00
SLASHLogin b1647903f8 Change String in structs to &'a str 2022-11-09 14:56:20 +01:00
SLASHLogin a54c8003ab Formatting 2022-11-09 14:56:20 +01:00
SLASHLogin 575f6098da Port unknown feature diagnostic to the new framework 2022-11-09 14:56:20 +01:00