Skip to content

Commit 03c8ffa

Browse files
committed
Auto merge of rust-lang#94350 - matthiaskrgr:rollup-eesfiyr, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#92714 (Provide ignore message in the result of test) - rust-lang#93273 (Always check cg_llvm with ./x.py check) - rust-lang#94068 (Consider mutations as borrows in generator drop tracking) - rust-lang#94184 (BTree: simplify test code) - rust-lang#94297 (update const_generics_defaults release notes) - rust-lang#94341 (Remove a duplicate space) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ece55d4 + cff3472 commit 03c8ffa

File tree

18 files changed

+354
-148
lines changed

18 files changed

+354
-148
lines changed

RELEASES.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Version 1.59.0 (2022-02-24)
44
Language
55
--------
66

7-
- [Stabilize default arguments for const generics][90207]
7+
- [Stabilize default arguments for const parameters and remove the ordering restriction for type and const parameters][90207]
88
- [Stabilize destructuring assignment][90521]
99
- [Relax private in public lint on generic bounds and where clauses of trait impls][90586]
1010
- [Stabilize asm! and global_asm! for x86, x86_64, ARM, Aarch64, and RISC-V][91728]
@@ -18,6 +18,21 @@ Compiler
1818
- [Warn when a `#[test]`-like built-in attribute macro is present multiple times.][91172]
1919
- [Add support for riscv64gc-unknown-freebsd][91284]
2020
- [Stabilize `-Z emit-future-incompat` as `--json future-incompat`][91535]
21+
- [Soft disable incremental compilation][94124]
22+
23+
This release disables incremental compilation, unless the user has explicitly
24+
opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
25+
This is due to a known and relatively frequently occurring bug in incremental
26+
compilation, which causes builds to issue internal compiler errors. This
27+
particular bug is already fixed on nightly, but that fix has not yet rolled out
28+
to stable and is deemed too risky for a direct stable backport.
29+
30+
As always, we encourage users to test with nightly and report bugs so that we
31+
can track failures and fix issues earlier.
32+
33+
See [94124] for more details.
34+
35+
[94124]: https://github.com/rust-lang/rust/issues/94124
2136

2237
Libraries
2338
---------
@@ -86,6 +101,7 @@ Compatibility Notes
86101
- [Weaken guarantee around advancing underlying iterators in zip][83791]
87102
- [Make split_inclusive() on an empty slice yield an empty output][89825]
88103
- [Update std::env::temp_dir to use GetTempPath2 on Windows when available.][89999]
104+
- [unreachable! was updated to match other formatting macro behavior on Rust 2021][92137]
89105

90106
Internal Changes
91107
----------------
@@ -127,6 +143,7 @@ and related tools.
127143
[91984]: https://github.com/rust-lang/rust/pull/91984/
128144
[92020]: https://github.com/rust-lang/rust/pull/92020/
129145
[92034]: https://github.com/rust-lang/rust/pull/92034/
146+
[92137]: https://github.com/rust-lang/rust/pull/92137/
130147
[92483]: https://github.com/rust-lang/rust/pull/92483/
131148
[cargo/10088]: https://github.com/rust-lang/cargo/pull/10088/
132149
[cargo/10133]: https://github.com/rust-lang/cargo/pull/10133/

compiler/rustc_builtin_macros/src/test.rs

+23
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ pub fn expand_test_or_bench(
262262
"ignore",
263263
cx.expr_bool(sp, should_ignore(&cx.sess, &item)),
264264
),
265+
// ignore_message: Some("...") | None
266+
field(
267+
"ignore_message",
268+
if let Some(msg) = should_ignore_message(cx, &item) {
269+
cx.expr_some(sp, cx.expr_str(sp, msg))
270+
} else {
271+
cx.expr_none(sp)
272+
},
273+
),
265274
// compile_fail: true | false
266275
field("compile_fail", cx.expr_bool(sp, false)),
267276
// no_run: true | false
@@ -364,6 +373,20 @@ fn should_ignore(sess: &Session, i: &ast::Item) -> bool {
364373
sess.contains_name(&i.attrs, sym::ignore)
365374
}
366375

376+
fn should_ignore_message(cx: &ExtCtxt<'_>, i: &ast::Item) -> Option<Symbol> {
377+
match cx.sess.find_by_name(&i.attrs, sym::ignore) {
378+
Some(attr) => {
379+
match attr.meta_item_list() {
380+
// Handle #[ignore(bar = "foo")]
381+
Some(_) => None,
382+
// Handle #[ignore] and #[ignore = "message"]
383+
None => attr.value_str(),
384+
}
385+
}
386+
None => None,
387+
}
388+
}
389+
367390
fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
368391
match cx.sess.find_by_name(&i.attrs, sym::should_panic) {
369392
Some(attr) => {

compiler/rustc_expand/src/build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ impl<'a> ExtCtxt<'a> {
329329
self.expr_call_global(sp, some, vec![expr])
330330
}
331331

332+
pub fn expr_none(&self, sp: Span) -> P<ast::Expr> {
333+
let none = self.std_path(&[sym::option, sym::Option, sym::None]);
334+
self.expr_path(self.path_global(sp, none))
335+
}
332336
pub fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
333337
self.expr(sp, ast::ExprKind::Tup(exprs))
334338
}

compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
633633
})
634634
.collect::<Result<Vec<_>, _>>();
635635

636-
let Ok(where_predicates) = where_predicates else { return };
636+
let Ok(where_predicates) = where_predicates else { return };
637637

638638
// now get all predicates in the same types as the where bounds, so we can chain them
639639
let predicates_from_where =

compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,25 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
9393
fn borrow(
9494
&mut self,
9595
place_with_id: &expr_use_visitor::PlaceWithHirId<'tcx>,
96-
_diag_expr_id: HirId,
96+
diag_expr_id: HirId,
9797
_bk: rustc_middle::ty::BorrowKind,
9898
) {
99+
debug!("borrow {:?}; diag_expr_id={:?}", place_with_id, diag_expr_id);
99100
self.places
100101
.borrowed
101102
.insert(TrackedValue::from_place_with_projections_allowed(place_with_id));
102103
}
103104

104105
fn mutate(
105106
&mut self,
106-
_assignee_place: &expr_use_visitor::PlaceWithHirId<'tcx>,
107-
_diag_expr_id: HirId,
107+
assignee_place: &expr_use_visitor::PlaceWithHirId<'tcx>,
108+
diag_expr_id: HirId,
108109
) {
110+
debug!("mutate {:?}; diag_expr_id={:?}", assignee_place, diag_expr_id);
111+
// Count mutations as a borrow.
112+
self.places
113+
.borrowed
114+
.insert(TrackedValue::from_place_with_projections_allowed(assignee_place));
109115
}
110116

111117
fn fake_read(

0 commit comments

Comments
 (0)