Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #105397

Merged
merged 13 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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