Skip to content

Commit 2a5cf59

Browse files
committed
Auto merge of rust-lang#115651 - GuillaumeGomez:rollup-hysmaco, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - rust-lang#115345 (MCP661: Move wasm32-wasi-preview1-threads target to Tier 2) - rust-lang#115604 (rustdoc: Render private fields in tuple struct as `/* private fields */`) - rust-lang#115624 (Print the path of a return-position impl trait in trait when `return_type_notation` is enabled) - rust-lang#115629 (Don't suggest dereferencing to unsized type) - rust-lang#115633 (Lint node for `PRIVATE_BOUNDS`/`PRIVATE_INTERFACES` is the item which names the private type) - rust-lang#115634 (Use `newtype_index` for `IntVid` and `FloatVid`.) - rust-lang#115638 (`-Cllvm-args` usability improvement) - rust-lang#115649 (diagnostics: add test case for trait bounds diagnostic) r? `@ghost` `@rustbot` modify labels: rollup
2 parents de4cba3 + 9f27421 commit 2a5cf59

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "llvm/Analysis/AliasAnalysis.h"
1010
#include "llvm/Analysis/TargetLibraryInfo.h"
1111
#include "llvm/Analysis/TargetTransformInfo.h"
12+
#include "llvm/CodeGen/CommandFlags.h"
1213
#include "llvm/CodeGen/TargetSubtargetInfo.h"
1314
#include "llvm/IR/AutoUpgrade.h"
1415
#include "llvm/IR/AssemblyAnnotationWriter.h"
@@ -50,6 +51,8 @@
5051

5152
using namespace llvm;
5253

54+
static codegen::RegisterCodeGenFlags CGF;
55+
5356
typedef struct LLVMOpaquePass *LLVMPassRef;
5457
typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
5558

@@ -421,7 +424,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
421424
return nullptr;
422425
}
423426

424-
TargetOptions Options;
427+
TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags(Trip);
425428

426429
Options.FloatABIType = FloatABI::Default;
427430
if (UseSoftFloat) {

compiler/rustc_privacy/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1463,14 +1463,15 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
14631463
};
14641464

14651465
let vis = self.tcx.local_visibility(local_def_id);
1466-
let hir_id = self.tcx.hir().local_def_id_to_hir_id(local_def_id);
14671466
let span = self.tcx.def_span(self.item_def_id.to_def_id());
14681467
let vis_span = self.tcx.def_span(def_id);
14691468
if self.in_assoc_ty && !vis.is_at_least(self.required_visibility, self.tcx) {
14701469
let vis_descr = match vis {
14711470
ty::Visibility::Public => "public",
14721471
ty::Visibility::Restricted(vis_def_id) => {
1473-
if vis_def_id == self.tcx.parent_module(hir_id).to_local_def_id() {
1472+
if vis_def_id
1473+
== self.tcx.parent_module_from_def_id(local_def_id).to_local_def_id()
1474+
{
14741475
"private"
14751476
} else if vis_def_id.is_top_level_module() {
14761477
"crate-private"
@@ -1504,7 +1505,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
15041505
};
15051506
self.tcx.emit_spanned_lint(
15061507
lint,
1507-
hir_id,
1508+
self.tcx.hir().local_def_id_to_hir_id(self.item_def_id),
15081509
span,
15091510
PrivateInterfacesOrBoundsLint {
15101511
item_span: span,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// check-pass
2+
// compile-flags: --crate-type=lib
3+
4+
#[allow(private_bounds)]
5+
pub trait Foo: FooImpl {}
6+
7+
trait FooImpl {}

0 commit comments

Comments
 (0)