Skip to content

Commit

Permalink
Auto merge of rust-lang#105397 - matthiaskrgr:rollup-xv5imz8, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#105298 (llvm-wrapper: adapt for an LLVM API change)
 - rust-lang#105358 (Add a test for rust-lang#104260)
 - rust-lang#105380 (add const generics ping files things for me)
 - rust-lang#105382 (remove an excess `this`)
 - rust-lang#105388 (rustdoc: remove redundant CSS `.import-item .stab { font-size }`)
 - rust-lang#105390 (unstable-book: Add `ignore` to `abi_efiapi` example code)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Dec 7, 2022
2 parents 023b513 + 62d5bee commit d43674e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 6 deletions.
11 changes: 10 additions & 1 deletion compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ enum class LLVMRustCodeModel {
None,
};

static Optional<CodeModel::Model> fromRust(LLVMRustCodeModel Model) {
#if LLVM_VERSION_LT(16, 0)
static Optional<CodeModel::Model>
#else
static std::optional<CodeModel::Model>
#endif
fromRust(LLVMRustCodeModel Model) {
switch (Model) {
case LLVMRustCodeModel::Tiny:
return CodeModel::Tiny;
Expand Down Expand Up @@ -638,7 +643,11 @@ LLVMRustOptimize(
LLVMSelfProfileInitializeCallbacks(PIC,LlvmSelfProfiler,BeforePassCallback,AfterPassCallback);
}

#if LLVM_VERSION_LT(16, 0)
Optional<PGOOptions> PGOOpt;
#else
std::optional<PGOOptions> PGOOpt;
#endif
if (PGOGenPath) {
assert(!PGOUsePath && !PGOSampleUsePath);
PGOOpt = PGOOptions(PGOGenPath, "", "", PGOOptions::IRInstr,
Expand Down
16 changes: 16 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#include "llvm/Pass.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/Support/Signals.h"
#if LLVM_VERSION_LT(16, 0)
#include "llvm/ADT/Optional.h"
#endif

#include <iostream>

Expand Down Expand Up @@ -708,7 +710,11 @@ enum class LLVMRustChecksumKind {
SHA256,
};

#if LLVM_VERSION_LT(16, 0)
static Optional<DIFile::ChecksumKind> fromRust(LLVMRustChecksumKind Kind) {
#else
static std::optional<DIFile::ChecksumKind> fromRust(LLVMRustChecksumKind Kind) {
#endif
switch (Kind) {
case LLVMRustChecksumKind::None:
return None;
Expand Down Expand Up @@ -787,8 +793,18 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFile(
const char *Filename, size_t FilenameLen,
const char *Directory, size_t DirectoryLen, LLVMRustChecksumKind CSKind,
const char *Checksum, size_t ChecksumLen) {

#if LLVM_VERSION_LT(16, 0)
Optional<DIFile::ChecksumKind> llvmCSKind = fromRust(CSKind);
#else
std::optional<DIFile::ChecksumKind> llvmCSKind = fromRust(CSKind);
#endif

#if LLVM_VERSION_LT(16, 0)
Optional<DIFile::ChecksumInfo<StringRef>> CSInfo{};
#else
std::optional<DIFile::ChecksumInfo<StringRef>> CSInfo{};
#endif
if (llvmCSKind)
CSInfo.emplace(*llvmCSKind, StringRef{Checksum, ChecksumLen});
return wrap(Builder->createFile(StringRef(Filename, FilenameLen),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn is_const_evaluatable<'tcx>(
ty::ConstKind::Expr(_) => {
// FIXME(generic_const_exprs): we have a `ConstKind::Expr` which is fully concrete, but
// currently it is not possible to evaluate `ConstKind::Expr` so we are unable to tell if it
// is evaluatable or not. For now we just ICE until this is implemented this.
// is evaluatable or not. For now we just ICE until this is implemented.
Err(NotConstEvaluatable::Error(tcx.sess.delay_span_bug(
span,
"evaluating `ConstKind::Expr` is not currently supported",
Expand Down
2 changes: 1 addition & 1 deletion src/doc/unstable-book/src/language-features/abi-efiapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Specification].

Example:

```rust
```rust,ignore (not-all-targets-support-uefi)
#![feature(abi_efiapi)]
extern "efiapi" { fn f1(); }
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
.import-item .stab {
border-radius: 3px;
display: inline-block;
font-size: 0.875rem;
line-height: 1.2;
margin-bottom: 0;
margin-left: 0.3125em;
Expand Down
14 changes: 14 additions & 0 deletions src/test/ui/associated-inherent-types/issue-104260.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// check-pass

#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

struct Foo;

impl Foo {
type Bar<T> = u8;
}

fn main() {
let a: Foo::Bar<()>;
}
12 changes: 10 additions & 2 deletions triagebot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,16 @@ message = "Some changes occurred to MIR optimizations"
cc = ["@rust-lang/wg-mir-opt"]

[mentions."compiler/rustc_trait_selection/src/traits/const_evaluatable.rs"]
message = "Some changes occurred in const_evaluatable.rs"
cc = ["@lcnr"]
message = "Some changes occurred in `const_evaluatable.rs`"
cc = ["@BoxyUwU"]

[mentions."compiler/rustc_middle/src/ty/abstract_const.rs"]
message = "Some changes occured in `abstract_const.rs`"
cc = ["@BoxyUwU"]

[mentions."compiler/rustc_ty_utils/src/consts.rs"]
message = "Some changes occured in `rustc_ty_utils::consts.rs`"
cc = ["@BoxyUwU"]

[mentions."compiler/rustc_trait_selection/src/traits/engine.rs"]
message = """
Expand Down

0 comments on commit d43674e

Please sign in to comment.