Skip to content

Commit 4a09adf

Browse files
committed
Auto merge of rust-lang#101603 - matthiaskrgr:rollup-8y6kf20, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#99207 (Enable eager checks for memory sanitizer) - rust-lang#101253 (fix the suggestion of format for asm_sub_register) - rust-lang#101450 (Add `const_extern_fn` to 1.62 release notes.) - rust-lang#101556 (Tweak future opaque ty pretty printing) - rust-lang#101563 (Link UEFI target documentation from target list) - rust-lang#101593 (Cleanup themes (tooltip)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ab32548 + 8b78fa0 commit 4a09adf

File tree

25 files changed

+269
-199
lines changed

25 files changed

+269
-199
lines changed

RELEASES.md

+2
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Language
217217
- [Fix constants not getting dropped if part of a diverging expression][94775]
218218
- [Support unit struct/enum variant in destructuring assignment][95380]
219219
- [Remove mutable_borrow_reservation_conflict lint and allow the code pattern][96268]
220+
- [`const` functions may now specify `extern "C"` or `extern "Rust"`][95346]
220221

221222
Compiler
222223
--------
@@ -306,6 +307,7 @@ and related tools.
306307
[94872]: https://github.com/rust-lang/rust/pull/94872/
307308
[95006]: https://github.com/rust-lang/rust/pull/95006/
308309
[95035]: https://github.com/rust-lang/rust/pull/95035/
310+
[95346]: https://github.com/rust-lang/rust/pull/95346/
309311
[95372]: https://github.com/rust-lang/rust/pull/95372/
310312
[95380]: https://github.com/rust-lang/rust/pull/95380/
311313
[95431]: https://github.com/rust-lang/rust/pull/95431/

compiler/rustc_codegen_llvm/src/abi.rs

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc_target::abi::call::ArgAbi;
1919
pub use rustc_target::abi::call::*;
2020
use rustc_target::abi::{self, HasDataLayout, Int};
2121
pub use rustc_target::spec::abi::Abi;
22+
use rustc_target::spec::SanitizerSet;
2223

2324
use libc::c_uint;
2425
use smallvec::SmallVec;
@@ -90,6 +91,13 @@ fn get_attrs<'ll>(this: &ArgAttributes, cx: &CodegenCx<'ll, '_>) -> SmallVec<[&'
9091
if regular.contains(ArgAttribute::NoAliasMutRef) && should_use_mutable_noalias(cx) {
9192
attrs.push(llvm::AttributeKind::NoAlias.create_attr(cx.llcx));
9293
}
94+
} else if cx.tcx.sess.opts.unstable_opts.sanitizer.contains(SanitizerSet::MEMORY) {
95+
// If we're not optimising, *but* memory sanitizer is on, emit noundef, since it affects
96+
// memory sanitizer's behavior.
97+
98+
if regular.contains(ArgAttribute::NoUndef) {
99+
attrs.push(llvm::AttributeKind::NoUndef.create_attr(cx.llcx));
100+
}
93101
}
94102

95103
attrs

compiler/rustc_hir/src/lang_items.rs

-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ language_item_table! {
238238
Future, sym::future_trait, future_trait, Target::Trait, GenericRequirement::Exact(0);
239239
GeneratorState, sym::generator_state, gen_state, Target::Enum, GenericRequirement::None;
240240
Generator, sym::generator, gen_trait, Target::Trait, GenericRequirement::Minimum(1);
241-
GeneratorReturn, sym::generator_return, generator_return, Target::AssocTy, GenericRequirement::None;
242241
Unpin, sym::unpin, unpin_trait, Target::Trait, GenericRequirement::None;
243242
Pin, sym::pin, pin_type, Target::Struct, GenericRequirement::None;
244243

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,12 @@ extern "C" LLVMPassRef LLVMRustCreateMemorySanitizerPass(int TrackOrigins, bool
134134
const bool CompileKernel = false;
135135

136136
return wrap(createMemorySanitizerLegacyPassPass(
137-
MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel}));
137+
#if LLVM_VERSION_GE(14, 0)
138+
MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel, /*EagerChecks=*/true}
139+
#else
140+
MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel}
141+
#endif
142+
));
138143
#else
139144
report_fatal_error("Legacy PM not supported with LLVM 15");
140145
#endif
@@ -930,10 +935,18 @@ LLVMRustOptimizeWithNewPassManager(
930935

931936
if (SanitizerOptions) {
932937
if (SanitizerOptions->SanitizeMemory) {
938+
#if LLVM_VERSION_GE(14, 0)
939+
MemorySanitizerOptions Options(
940+
SanitizerOptions->SanitizeMemoryTrackOrigins,
941+
SanitizerOptions->SanitizeMemoryRecover,
942+
/*CompileKernel=*/false,
943+
/*EagerChecks=*/true);
944+
#else
933945
MemorySanitizerOptions Options(
934946
SanitizerOptions->SanitizeMemoryTrackOrigins,
935947
SanitizerOptions->SanitizeMemoryRecover,
936948
/*CompileKernel=*/false);
949+
#endif
937950
OptimizerLastEPCallbacks.push_back(
938951
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
939952
#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,14 @@ pub trait PrettyPrinter<'tcx>:
922922
// Skip printing `<[generator@] as Generator<_>>::Return` from async blocks,
923923
// unless we can find out what generator return type it comes from.
924924
let term = if let Some(ty) = term.skip_binder().ty()
925-
&& let ty::Projection(ty::ProjectionTy { item_def_id, substs }) = ty.kind()
926-
&& Some(*item_def_id) == tcx.lang_items().generator_return()
925+
&& let ty::Projection(proj) = ty.kind()
926+
&& let assoc = tcx.associated_item(proj.item_def_id)
927+
&& assoc.trait_container(tcx) == tcx.lang_items().gen_trait()
928+
&& assoc.name == rustc_span::sym::Return
927929
{
928930
if let ty::Generator(_, substs, _) = substs.type_at(0).kind() {
929931
let return_ty = substs.as_generator().return_ty();
930-
if !return_ty.is_ty_infer() {
932+
if !return_ty.is_ty_var() {
931933
return_ty.into()
932934
} else {
933935
continue;

compiler/rustc_span/src/symbol.rs

-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ symbols! {
763763
gen_future,
764764
gen_kill,
765765
generator,
766-
generator_return,
767766
generator_state,
768767
generators,
769768
generic_arg_infer,

compiler/rustc_typeck/src/check/intrinsicck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
333333
let mut err = lint.build(msg);
334334
err.span_label(expr.span, "for this argument");
335335
err.help(&format!(
336-
"use the `{suggested_modifier}` modifier to have the register formatted as `{suggested_result}`",
336+
"use `{{{idx}:{suggested_modifier}}}` to have the register formatted as `{suggested_result}`",
337337
));
338338
err.help(&format!(
339-
"or use the `{default_modifier}` modifier to keep the default formatting of `{default_result}`",
339+
"or use `{{{idx}:{default_modifier}}}` to keep the default formatting of `{default_result}`",
340340
));
341341
err.emit();
342342
},

library/core/src/ops/generator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub trait Generator<R = ()> {
8383
/// `return` statement or implicitly as the last expression of a generator
8484
/// literal. For example futures would use this as `Result<T, E>` as it
8585
/// represents a completed future.
86-
#[lang = "generator_return"]
86+
#[cfg_attr(bootstrap, lang = "generator_return")]
8787
type Return;
8888

8989
/// Resumes the execution of this generator.

src/doc/rustc/src/platform-support.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ target | std | host | notes
213213
[`aarch64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
214214
`aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD
215215
`aarch64-unknown-hermit` | ✓ | | ARM64 HermitCore
216-
`aarch64-unknown-uefi` | * | | ARM64 UEFI
216+
[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | * | | ARM64 UEFI
217217
`aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI)
218218
`aarch64-unknown-netbsd` | ✓ | ✓ |
219219
[`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD
@@ -250,7 +250,7 @@ target | std | host | notes
250250
`i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku
251251
`i686-unknown-netbsd` | ✓ | ✓ | NetBSD/i386 with SSE2
252252
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD
253-
`i686-unknown-uefi` | * | | 32-bit UEFI
253+
[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | * | | 32-bit UEFI
254254
`i686-uwp-windows-gnu` | ? | |
255255
`i686-uwp-windows-msvc` | ? | |
256256
`i686-wrs-vxworks` | ? | |
@@ -307,7 +307,7 @@ target | std | host | notes
307307
`x86_64-unknown-l4re-uclibc` | ? | |
308308
`x86_64-unknown-none-linuxkernel` | * | | Linux kernel modules
309309
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
310-
`x86_64-unknown-uefi` | * | | 64-bit UEFI
310+
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | * | | 64-bit UEFI
311311
`x86_64-uwp-windows-gnu` | ✓ | |
312312
`x86_64-uwp-windows-msvc` | ✓ | |
313313
`x86_64-wrs-vxworks` | ? | |

src/librustdoc/html/static/css/rustdoc.css

+36
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,42 @@ pre.rust .question-mark {
11601160
font-weight: bold;
11611161
}
11621162

1163+
pre.compile_fail,
1164+
pre.should_panic {
1165+
border-left: 2px solid var(--codeblock-error-color);
1166+
}
1167+
1168+
pre.ignore {
1169+
border-left: 2px solid var(--codeblock-ignore-color);
1170+
}
1171+
1172+
pre.compile_fail:hover, .information:hover + .example-wrap pre.compile_fail,
1173+
pre.should_panic:hover, .information:hover + .example-wrap pre.should_panic {
1174+
border-left: 2px solid var(--codeblock-error-hover-color);
1175+
}
1176+
1177+
pre.ignore:hover, .information:hover + .example-wrap pre.ignore {
1178+
border-left: 2px solid var(--codeblock-ignore-hover-color);
1179+
}
1180+
1181+
.tooltip.compile_fail,
1182+
.tooltip.should_panic {
1183+
color: var(--codeblock-error-color);
1184+
}
1185+
1186+
.tooltip.ignore {
1187+
color: var(--codeblock-ignore-color);
1188+
}
1189+
1190+
.information > .compile_fail:hover,
1191+
.information > .should_panic:hover {
1192+
color: var(--codeblock-error-hover-color);
1193+
}
1194+
1195+
.information > .ignore:hover {
1196+
color: var(--codeblock-ignore-hover-color);
1197+
}
1198+
11631199
a.test-arrow {
11641200
display: inline-block;
11651201
visibility: hidden;

src/librustdoc/html/static/css/themes/ayu.css

+4-48
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Original by Dempfi (https://github.com/dempfi/ayu)
2323
--copy-path-button-color: #fff;
2424
--copy-path-img-filter: invert(70%);
2525
--copy-path-img-hover-filter: invert(100%);
26+
--codeblock-error-hover-color: rgb(255, 0, 0);
27+
--codeblock-error-color: rgba(255, 0, 0, .5);
28+
--codeblock-ignore-hover-color: rgb(255, 142, 0);
29+
--codeblock-ignore-color: rgba(255, 142, 0, .6);
2630
}
2731

2832
.slider {
@@ -244,54 +248,6 @@ a.test-arrow:hover {
244248
border-right: 3px solid rgba(255, 180, 76, 0.85);
245249
}
246250

247-
pre.compile_fail {
248-
border-left: 2px solid rgba(255,0,0,.4);
249-
}
250-
251-
pre.compile_fail:hover, .information:hover + pre.compile_fail {
252-
border-left: 2px solid #f00;
253-
}
254-
255-
pre.should_panic {
256-
border-left: 2px solid rgba(255,0,0,.4);
257-
}
258-
259-
pre.should_panic:hover, .information:hover + pre.should_panic {
260-
border-left: 2px solid #f00;
261-
}
262-
263-
pre.ignore {
264-
border-left: 2px solid rgba(255,142,0,.6);
265-
}
266-
267-
pre.ignore:hover, .information:hover + pre.ignore {
268-
border-left: 2px solid #ff9200;
269-
}
270-
271-
.tooltip.compile_fail {
272-
color: rgba(255,0,0,.5);
273-
}
274-
275-
.information > .compile_fail:hover {
276-
color: #f00;
277-
}
278-
279-
.tooltip.should_panic {
280-
color: rgba(255,0,0,.5);
281-
}
282-
283-
.information > .should_panic:hover {
284-
color: #f00;
285-
}
286-
287-
.tooltip.ignore {
288-
color: rgba(255,142,0,.6);
289-
}
290-
291-
.information > .ignore:hover {
292-
color: #ff9200;
293-
}
294-
295251
.search-failed a {
296252
color: #39AFD7;
297253
}

src/librustdoc/html/static/css/themes/dark.css

+4-48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
--copy-path-button-color: #999;
1919
--copy-path-img-filter: invert(50%);
2020
--copy-path-img-hover-filter: invert(65%);
21+
--codeblock-error-hover-color: rgb(255, 0, 0);
22+
--codeblock-error-color: rgba(255, 0, 0, .5);
23+
--codeblock-ignore-hover-color: rgb(255, 142, 0);
24+
--codeblock-ignore-color: rgba(255, 142, 0, .6);
2125
}
2226

2327
.slider {
@@ -194,54 +198,6 @@ a.test-arrow:hover{
194198
border-right: 3px solid #bb7410;
195199
}
196200

197-
pre.compile_fail {
198-
border-left: 2px solid rgba(255,0,0,.8);
199-
}
200-
201-
pre.compile_fail:hover, .information:hover + pre.compile_fail {
202-
border-left: 2px solid #f00;
203-
}
204-
205-
pre.should_panic {
206-
border-left: 2px solid rgba(255,0,0,.8);
207-
}
208-
209-
pre.should_panic:hover, .information:hover + pre.should_panic {
210-
border-left: 2px solid #f00;
211-
}
212-
213-
pre.ignore {
214-
border-left: 2px solid rgba(255,142,0,.6);
215-
}
216-
217-
pre.ignore:hover, .information:hover + pre.ignore {
218-
border-left: 2px solid #ff9200;
219-
}
220-
221-
.tooltip.compile_fail {
222-
color: rgba(255,0,0,.8);
223-
}
224-
225-
.information > .compile_fail:hover {
226-
color: #f00;
227-
}
228-
229-
.tooltip.should_panic {
230-
color: rgba(255,0,0,.8);
231-
}
232-
233-
.information > .should_panic:hover {
234-
color: #f00;
235-
}
236-
237-
.tooltip.ignore {
238-
color: rgba(255,142,0,.6);
239-
}
240-
241-
.information > .ignore:hover {
242-
color: #ff9200;
243-
}
244-
245201
.search-failed a {
246202
color: #0089ff;
247203
}

src/librustdoc/html/static/css/themes/light.css

+4-48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
--copy-path-button-color: #999;
1919
--copy-path-img-filter: invert(50%);
2020
--copy-path-img-hover-filter: invert(35%);
21+
--codeblock-error-hover-color: rgb(255, 0, 0);
22+
--codeblock-error-color: rgba(255, 0, 0, .5);
23+
--codeblock-ignore-hover-color: rgb(255, 142, 0);
24+
--codeblock-ignore-color: rgba(255, 142, 0, .6);
2125
}
2226

2327
.slider {
@@ -180,54 +184,6 @@ a.test-arrow:hover{
180184
border-right: 3px solid #AD7C37;
181185
}
182186

183-
pre.compile_fail {
184-
border-left: 2px solid rgba(255,0,0,.5);
185-
}
186-
187-
pre.compile_fail:hover, .information:hover + pre.compile_fail {
188-
border-left: 2px solid #f00;
189-
}
190-
191-
pre.should_panic {
192-
border-left: 2px solid rgba(255,0,0,.5);
193-
}
194-
195-
pre.should_panic:hover, .information:hover + pre.should_panic {
196-
border-left: 2px solid #f00;
197-
}
198-
199-
pre.ignore {
200-
border-left: 2px solid rgba(255,142,0,.6);
201-
}
202-
203-
pre.ignore:hover, .information:hover + pre.ignore {
204-
border-left: 2px solid #ff9200;
205-
}
206-
207-
.tooltip.compile_fail {
208-
color: rgba(255,0,0,.5);
209-
}
210-
211-
.information > .compile_fail:hover {
212-
color: #f00;
213-
}
214-
215-
.tooltip.should_panic {
216-
color: rgba(255,0,0,.5);
217-
}
218-
219-
.information > .should_panic:hover {
220-
color: #f00;
221-
}
222-
223-
.tooltip.ignore {
224-
color: rgba(255,142,0,.6);
225-
}
226-
227-
.information > .ignore:hover {
228-
color: #ff9200;
229-
}
230-
231187
.search-failed a {
232188
color: #3873AD;
233189
}

0 commit comments

Comments
 (0)