Skip to content

Commit d569987

Browse files
committed
Auto merge of #111882 - matthiaskrgr:rollup-1xyv5mq, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #111427 ([rustdoc][JSON] Use exclusively externally tagged enums in the JSON representation) - #111486 (Pretty-print inherent projections correctly) - #111722 (Document stack-protector option) - #111761 (fix(resolve): not defined `extern crate shadow_name`) - #111845 (Update books) - #111851 (CFI: Fix encode_region: unexpected ReEarlyBound(0, 'a)) - #111871 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 52dd1cd + f737ec4 commit d569987

File tree

118 files changed

+882
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+882
-755
lines changed

Cargo.lock

+10
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ dependencies = [
246246
"serde",
247247
]
248248

249+
[[package]]
250+
name = "bincode"
251+
version = "1.3.3"
252+
source = "registry+https://github.com/rust-lang/crates.io-index"
253+
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
254+
dependencies = [
255+
"serde",
256+
]
257+
249258
[[package]]
250259
name = "bitflags"
251260
version = "1.3.2"
@@ -4351,6 +4360,7 @@ dependencies = [
43514360
name = "rustdoc-json-types"
43524361
version = "0.1.0"
43534362
dependencies = [
4363+
"bincode",
43544364
"rustc-hash",
43554365
"serde",
43564366
"serde_json",

compiler/rustc_const_eval/src/util/type_name.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
5858
// Types with identity (print the module path).
5959
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), substs)
6060
| ty::FnDef(def_id, substs)
61-
| ty::Alias(_, ty::AliasTy { def_id, substs, .. })
61+
| ty::Alias(ty::Projection | ty::Opaque, ty::AliasTy { def_id, substs, .. })
6262
| ty::Closure(def_id, substs)
6363
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),
6464
ty::Foreign(def_id) => self.print_def_path(def_id, &[]),
6565

66+
ty::Alias(ty::Inherent, _) => bug!("type_name: unexpected inherent projection"),
6667
ty::GeneratorWitness(_) => bug!("type_name: unexpected `GeneratorWitness`"),
6768
ty::GeneratorWitnessMIR(..) => bug!("type_name: unexpected `GeneratorWitnessMIR`"),
6869
}

compiler/rustc_middle/src/ty/print/pretty.rs

+21-1
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,22 @@ pub trait PrettyPrinter<'tcx>:
11641164
traits.entry(trait_ref).or_default().extend(proj_ty);
11651165
}
11661166

1167+
fn pretty_print_inherent_projection(
1168+
self,
1169+
alias_ty: &ty::AliasTy<'tcx>,
1170+
) -> Result<Self::Path, Self::Error> {
1171+
let def_key = self.tcx().def_key(alias_ty.def_id);
1172+
self.path_generic_args(
1173+
|cx| {
1174+
cx.path_append(
1175+
|cx| cx.path_qualified(alias_ty.self_ty(), None),
1176+
&def_key.disambiguated_data,
1177+
)
1178+
},
1179+
&alias_ty.substs[1..],
1180+
)
1181+
}
1182+
11671183
fn ty_infer_name(&self, _: ty::TyVid) -> Option<Symbol> {
11681184
None
11691185
}
@@ -2821,7 +2837,11 @@ define_print_and_forward_display! {
28212837
}
28222838

28232839
ty::AliasTy<'tcx> {
2824-
p!(print_def_path(self.def_id, self.substs));
2840+
if let DefKind::Impl { of_trait: false } = cx.tcx().def_kind(cx.tcx().parent(self.def_id)) {
2841+
p!(pretty_print_inherent_projection(self))
2842+
} else {
2843+
p!(print_def_path(self.def_id, self.substs));
2844+
}
28252845
}
28262846

28272847
ty::ClosureKind {

compiler/rustc_resolve/src/build_reduced_graph.rs

+5
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,11 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
873873
let msg = "macro-expanded `extern crate` items cannot \
874874
shadow names passed with `--extern`";
875875
self.r.tcx.sess.span_err(item.span, msg);
876+
// `return` is intended to discard this binding because it's an
877+
// unregistered ambiguity error which would result in a panic
878+
// caused by inconsistency `path_res`
879+
// more details: https://github.com/rust-lang/rust/pull/111761
880+
return;
876881
}
877882
}
878883
let entry = self.r.extern_prelude.entry(ident.normalize_to_macros_2_0()).or_insert(

compiler/rustc_resolve/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl Determinacy {
106106
/// A specific scope in which a name can be looked up.
107107
/// This enum is currently used only for early resolution (imports and macros),
108108
/// but not for late resolution yet.
109-
#[derive(Clone, Copy)]
109+
#[derive(Clone, Copy, Debug)]
110110
enum Scope<'a> {
111111
DeriveHelpers(LocalExpnId),
112112
DeriveHelpersCompat,

compiler/rustc_symbol_mangling/src/legacy.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolPrinter<'tcx> {
220220
match *ty.kind() {
221221
// Print all nominal types as paths (unlike `pretty_print_type`).
222222
ty::FnDef(def_id, substs)
223-
| ty::Alias(_, ty::AliasTy { def_id, substs, .. })
223+
| ty::Alias(ty::Projection | ty::Opaque, ty::AliasTy { def_id, substs, .. })
224224
| ty::Closure(def_id, substs)
225225
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),
226226

@@ -241,6 +241,8 @@ impl<'tcx> Printer<'tcx> for &mut SymbolPrinter<'tcx> {
241241
Ok(self)
242242
}
243243

244+
ty::Alias(ty::Inherent, _) => panic!("unexpected inherent projection"),
245+
244246
_ => self.pretty_print_type(ty),
245247
}
246248
}

compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,11 @@ fn encode_region<'tcx>(
272272
s.push('E');
273273
compress(dict, DictKey::Region(region), &mut s);
274274
}
275-
RegionKind::ReErased => {
275+
RegionKind::ReEarlyBound(..) | RegionKind::ReErased => {
276276
s.push_str("u6region");
277277
compress(dict, DictKey::Region(region), &mut s);
278278
}
279-
RegionKind::ReEarlyBound(..)
280-
| RegionKind::ReFree(..)
279+
RegionKind::ReFree(..)
281280
| RegionKind::ReStatic
282281
| RegionKind::ReError(_)
283282
| RegionKind::ReVar(..)
@@ -704,14 +703,15 @@ fn transform_predicates<'tcx>(
704703
) -> &'tcx List<ty::PolyExistentialPredicate<'tcx>> {
705704
let predicates: Vec<ty::PolyExistentialPredicate<'tcx>> = predicates
706705
.iter()
707-
.map(|predicate| match predicate.skip_binder() {
706+
.filter_map(|predicate| match predicate.skip_binder() {
708707
ty::ExistentialPredicate::Trait(trait_ref) => {
709708
let trait_ref = ty::TraitRef::identity(tcx, trait_ref.def_id);
710-
ty::Binder::dummy(ty::ExistentialPredicate::Trait(
709+
Some(ty::Binder::dummy(ty::ExistentialPredicate::Trait(
711710
ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref),
712-
))
711+
)))
713712
}
714-
_ => predicate,
713+
ty::ExistentialPredicate::Projection(..) => None,
714+
ty::ExistentialPredicate::AutoTrait(..) => Some(predicate),
715715
})
716716
.collect();
717717
tcx.mk_poly_existential_predicates(&predicates)

compiler/rustc_symbol_mangling/src/v0.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
433433
// Mangle all nominal types as paths.
434434
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), substs)
435435
| ty::FnDef(def_id, substs)
436-
| ty::Alias(_, ty::AliasTy { def_id, substs, .. })
436+
| ty::Alias(ty::Projection | ty::Opaque, ty::AliasTy { def_id, substs, .. })
437437
| ty::Closure(def_id, substs)
438438
| ty::Generator(def_id, substs, _) => {
439439
self = self.print_def_path(def_id, substs)?;
@@ -482,6 +482,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
482482
self = r.print(self)?;
483483
}
484484

485+
ty::Alias(ty::Inherent, _) => bug!("symbol_names: unexpected inherent projection"),
485486
ty::GeneratorWitness(_) => bug!("symbol_names: unexpected `GeneratorWitness`"),
486487
ty::GeneratorWitnessMIR(..) => bug!("symbol_names: unexpected `GeneratorWitnessMIR`"),
487488
}

src/doc/embedded-book

src/doc/rustc/src/exploit-mitigations.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ equivalent.
115115
<tr>
116116
<td>Stack smashing protection
117117
</td>
118-
<td>No
118+
<td>Yes
119119
</td>
120-
<td>
120+
<td>Nightly
121121
</td>
122122
</tr>
123123
<tr>
@@ -432,18 +432,16 @@ saved return instruction pointer, and checking if this value has changed
432432
when returning from a function. This is also known as “Stack Protector” or
433433
“Stack Smashing Protector (SSP)”.
434434

435-
The Rust compiler does not support stack smashing protection. However, more
436-
comprehensive alternatives to stack smashing protection exist, such as
437-
shadow and safe stack (see backward-edge control flow protection).
435+
The Rust compiler supports stack smashing protection on nightly builds[42].
438436

439437
![Screenshot of IDA Pro listing cross references to __stack_chk_fail in hello-rust.](images/image3.png "Cross references to __stack_chk_fail in hello-rust.")
440438
Fig. 14. IDA Pro listing cross references to `__stack_chk_fail` in
441439
hello-rust.
442440

443441
To check if stack smashing protection is enabled for a given binary, search
444-
for cross references to `__stack_chk_fail`. The only cross references to
445-
`__stack_chk_fail` in hello-rust are from the statically-linked libbacktrace
446-
library (see Fig. 14).
442+
for cross references to `__stack_chk_fail`. The presence of these
443+
cross-references in Rust-compiled code (e.g., `hello_rust::main`) indicates
444+
that the stack smashing protection is enabled (see Fig. 14).
447445

448446

449447
### Forward-edge control flow protection
@@ -697,3 +695,6 @@ defaults (unrelated to `READ_IMPLIES_EXEC`).
697695

698696
41. “ControlFlowIntegrity.” The Rust Unstable Book.
699697
[https://doc.rust-lang.org/unstable-book/compiler-flags/sanitizer.html#controlflowintegrity](../unstable-book/compiler-flags/sanitizer.html#controlflowintegrity).
698+
699+
42. bbjornse. “add codegen option for using LLVM stack smash protection #84197.”
700+
GitHub. <https://github.com/rust-lang/rust/pull/84197>

src/doc/rustc/src/images/image3.png

-52.1 KB
Loading

src/rustdoc-json-types/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ rustc-hash = "1.1.0"
1212

1313
[dev-dependencies]
1414
serde_json = "1.0"
15+
bincode = "1"

src/rustdoc-json-types/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
88
use std::path::PathBuf;
99

1010
/// rustdoc format-version.
11-
pub const FORMAT_VERSION: u32 = 25;
11+
pub const FORMAT_VERSION: u32 = 26;
1212

1313
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1414
/// about the language items in the local crate, as well as info about external items to allow
@@ -83,7 +83,6 @@ pub struct Item {
8383
/// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)
8484
pub attrs: Vec<String>,
8585
pub deprecation: Option<Deprecation>,
86-
#[serde(flatten)]
8786
pub inner: ItemEnum,
8887
}
8988

@@ -222,7 +221,7 @@ pub enum ItemKind {
222221
}
223222

224223
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
225-
#[serde(tag = "kind", content = "inner", rename_all = "snake_case")]
224+
#[serde(rename_all = "snake_case")]
226225
pub enum ItemEnum {
227226
Module(Module),
228227
ExternCrate {
@@ -543,7 +542,6 @@ pub enum Term {
543542

544543
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
545544
#[serde(rename_all = "snake_case")]
546-
#[serde(tag = "kind", content = "inner")]
547545
pub enum Type {
548546
/// Structs, enums, and unions
549547
ResolvedPath(Path),

src/rustdoc-json-types/tests.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ fn test_struct_info_roundtrip() {
88
impls: vec![],
99
});
1010

11+
// JSON
1112
let struct_json = serde_json::to_string(&s).unwrap();
12-
1313
let de_s = serde_json::from_str(&struct_json).unwrap();
14-
1514
assert_eq!(s, de_s);
15+
16+
// Bincode
17+
let encoded: Vec<u8> = bincode::serialize(&s).unwrap();
18+
let decoded: ItemEnum = bincode::deserialize(&encoded).unwrap();
19+
assert_eq!(s, decoded);
1620
}
1721

1822
#[test]
@@ -24,9 +28,13 @@ fn test_union_info_roundtrip() {
2428
impls: vec![],
2529
});
2630

31+
// JSON
2732
let union_json = serde_json::to_string(&u).unwrap();
28-
2933
let de_u = serde_json::from_str(&union_json).unwrap();
30-
3134
assert_eq!(u, de_u);
35+
36+
// Bincode
37+
let encoded: Vec<u8> = bincode::serialize(&u).unwrap();
38+
let decoded: ItemEnum = bincode::deserialize(&encoded).unwrap();
39+
assert_eq!(u, decoded);
3240
}

tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,15 @@ pub fn foo149(_: Type14<Bar>, _: Type14<Bar>, _: Type14<Bar>) { }
536536
// CHECK: ![[TYPE93]] = !{i64 0, !"_ZTSFvPFu3i32S_EE"}
537537
// CHECK: ![[TYPE94]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_E"}
538538
// CHECK: ![[TYPE95]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_S0_E"}
539-
// CHECK: ![[TYPE96]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEEE"}
540-
// CHECK: ![[TYPE97]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEES6_E"}
541-
// CHECK: ![[TYPE98]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEES6_S6_E"}
542-
// CHECK: ![[TYPE99]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEEE"}
543-
// CHECK: ![[TYPE100]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEES6_E"}
544-
// CHECK: ![[TYPE101]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEES6_S6_E"}
545-
// CHECK: ![[TYPE102]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEEE"}
546-
// CHECK: ![[TYPE103]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEES6_E"}
547-
// CHECK: ![[TYPE104]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu{{[0-9]+}}NtNtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnce6OutputIu5tupleIu3i32EES1_u6regionEES6_S6_E"}
539+
// CHECK: ![[TYPE96]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEEE"}
540+
// CHECK: ![[TYPE97]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEES3_E"}
541+
// CHECK: ![[TYPE98]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEES3_S3_E"}
542+
// CHECK: ![[TYPE99]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEEE"}
543+
// CHECK: ![[TYPE100]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEES3_E"}
544+
// CHECK: ![[TYPE101]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEES3_S3_E"}
545+
// CHECK: ![[TYPE102]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEEE"}
546+
// CHECK: ![[TYPE103]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEES3_E"}
547+
// CHECK: ![[TYPE104]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEES3_S3_E"}
548548
// CHECK: ![[TYPE105]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEEE"}
549549
// CHECK: ![[TYPE106]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES2_E"}
550550
// CHECK: ![[TYPE107]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES2_S2_E"}

tests/codegen/sanitizer-cfi-emit-type-metadata-trait-objects.rs

+31
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ impl<T, U> Trait3<U> for T {
3939
}
4040
}
4141

42+
pub trait Trait4<'a, T> {
43+
type Output: 'a;
44+
fn qux(&self, _: &T) -> Self::Output;
45+
}
46+
47+
pub struct Type4;
48+
49+
impl<'a, T, U> Trait4<'a, U> for T {
50+
type Output = &'a i32;
51+
fn qux(&self, _: &U) -> Self::Output {
52+
&0
53+
}
54+
}
55+
4256
pub fn foo1(a: &dyn Trait1) {
4357
a.foo();
4458
// CHECK-LABEL: define{{.*}}4foo1{{.*}}!type !{{[0-9]+}}
@@ -84,6 +98,23 @@ pub fn bar3() {
8498
// CHECK: call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE3:[[:print:]]+]]")
8599
}
86100

101+
pub fn foo4<'a>(a: &dyn Trait4<'a, Type4, Output = &'a i32>) {
102+
let b = Type4;
103+
a.qux(&b);
104+
// CHECK-LABEL: define{{.*}}4foo4{{.*}}!type !{{[0-9]+}}
105+
// CHECK: call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE4:[[:print:]]+]]")
106+
}
107+
108+
pub fn bar4<'a>() {
109+
let a = Type4;
110+
foo4(&a);
111+
let b = &a as &dyn Trait4<'a, Type4, Output = &'a i32>;
112+
b.qux(&a);
113+
// CHECK-LABEL: define{{.*}}4bar4{{.*}}!type !{{[0-9]+}}
114+
// CHECK: call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE4:[[:print:]]+]]")
115+
}
116+
87117
// CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE1]]"}
88118
// CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE2]]"}
89119
// CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE3]]"}
120+
// CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE4]]"}

0 commit comments

Comments
 (0)