Skip to content

Commit 0d1d004

Browse files
committed
Sync from rust d7f6ebacee13b6c03623c4b74197280454ede8de
2 parents ee188ca + 5c6849b commit 0d1d004

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

example/issue-72793.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
#![feature(type_alias_impl_trait)]
44

5-
trait T {
6-
type Item;
7-
}
5+
mod helper {
6+
pub trait T {
7+
type Item;
8+
}
89

9-
type Alias<'a> = impl T<Item = &'a ()>;
10+
pub type Alias<'a> = impl T<Item = &'a ()>;
1011

11-
struct S;
12-
impl<'a> T for &'a S {
13-
type Item = &'a ();
14-
}
12+
struct S;
13+
impl<'a> T for &'a S {
14+
type Item = &'a ();
15+
}
1516

16-
fn filter_positive<'a>() -> Alias<'a> {
17-
&S
17+
pub fn filter_positive<'a>() -> Alias<'a> {
18+
&S
19+
}
1820
}
21+
use helper::*;
1922

2023
fn with_positive(fun: impl Fn(Alias<'_>)) {
2124
fun(filter_positive());

patches/0029-stdlib-rawdylib-processprng.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/wind
1212
index ad8e01bfa9b..9ca8e4c16ce 100644
1313
--- a/library/std/src/sys/pal/windows/c.rs
1414
+++ b/library/std/src/sys/pal/windows/c.rs
15-
@@ -323,7 +323,7 @@ pub unsafe fn NtWriteFile(
15+
@@ -312,7 +312,7 @@ pub unsafe fn NtWriteFile(
1616

1717
// Use raw-dylib to import ProcessPrng as we can't rely on there being an import library.
1818
cfg_if::cfg_if! {
@@ -26,8 +26,8 @@ index e427546222a..f2fe42a4d51 100644
2626
--- a/library/std/src/sys/pal/windows/rand.rs
2727
+++ b/library/std/src/sys/pal/windows/rand.rs
2828
@@ -2,7 +2,7 @@
29-
use core::mem;
30-
use core::ptr;
29+
30+
use crate::sys::c;
3131

3232
-#[cfg(not(target_vendor = "win7"))]
3333
+#[cfg(any())]

src/inline_asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::fmt::Write;
44

55
use cranelift_codegen::isa::CallConv;
66
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
7+
use rustc_hir::LangItem;
78
use rustc_span::sym;
89
use rustc_target::asm::*;
910
use target_lexicon::BinaryFormat;
@@ -927,7 +928,7 @@ fn call_inline_asm<'tcx>(
927928
fn asm_clif_type<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> Option<types::Type> {
928929
match ty.kind() {
929930
// Adapted from https://github.com/rust-lang/rust/blob/f3c66088610c1b80110297c2d9a8b5f9265b013f/compiler/rustc_hir_analysis/src/check/intrinsicck.rs#L136-L151
930-
ty::Adt(adt, args) if Some(adt.did()) == fx.tcx.lang_items().maybe_uninit() => {
931+
ty::Adt(adt, args) if fx.tcx.is_lang_item(adt.did(), LangItem::MaybeUninit) => {
931932
let fields = &adt.non_enum_variant().fields;
932933
let ty = fields[FieldIdx::from_u32(1)].ty(fx.tcx, args);
933934
let ty::Adt(ty, args) = ty.kind() else {

src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
// tidy-alphabetical-start
2+
#![allow(rustc::diagnostic_outside_of_impl)]
3+
#![allow(rustc::untranslatable_diagnostic)]
14
#![cfg_attr(doc, allow(internal_features))]
2-
#![cfg_attr(doc, feature(rustdoc_internals))]
35
#![cfg_attr(doc, doc(rust_logo))]
6+
#![cfg_attr(doc, feature(rustdoc_internals))]
7+
// Note: please avoid adding other feature gates where possible
48
#![feature(rustc_private)]
59
// Note: please avoid adding other feature gates where possible
6-
#![allow(rustc::diagnostic_outside_of_impl)]
7-
#![allow(rustc::untranslatable_diagnostic)]
810
#![warn(rust_2018_idioms)]
9-
#![warn(unused_lifetimes)]
1011
#![warn(unreachable_pub)]
12+
#![warn(unused_lifetimes)]
13+
// tidy-alphabetical-end
1114

1215
extern crate jobserver;
1316
#[macro_use]

src/unsize.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ pub(crate) fn unsized_info<'tcx>(
3939
}
4040

4141
// trait upcasting coercion
42-
let vptr_entry_idx =
43-
fx.tcx.vtable_trait_upcasting_coercion_new_vptr_slot((source, target));
42+
let vptr_entry_idx = fx.tcx.supertrait_vtable_slot((source, target));
4443

4544
if let Some(entry_idx) = vptr_entry_idx {
4645
let entry_idx = u32::try_from(entry_idx).unwrap();

0 commit comments

Comments
 (0)