Skip to content

Commit

Permalink
Auto merge of rust-lang#94350 - matthiaskrgr:rollup-eesfiyr, r=matthi…
Browse files Browse the repository at this point in the history
…askrgr

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
  • Loading branch information
bors committed Feb 25, 2022
2 parents ece55d4 + cff3472 commit 03c8ffa
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 148 deletions.
19 changes: 18 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Version 1.59.0 (2022-02-24)
Language
--------

- [Stabilize default arguments for const generics][90207]
- [Stabilize default arguments for const parameters and remove the ordering restriction for type and const parameters][90207]
- [Stabilize destructuring assignment][90521]
- [Relax private in public lint on generic bounds and where clauses of trait impls][90586]
- [Stabilize asm! and global_asm! for x86, x86_64, ARM, Aarch64, and RISC-V][91728]
Expand All @@ -18,6 +18,21 @@ Compiler
- [Warn when a `#[test]`-like built-in attribute macro is present multiple times.][91172]
- [Add support for riscv64gc-unknown-freebsd][91284]
- [Stabilize `-Z emit-future-incompat` as `--json future-incompat`][91535]
- [Soft disable incremental compilation][94124]

This release disables incremental compilation, unless the user has explicitly
opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
This is due to a known and relatively frequently occurring bug in incremental
compilation, which causes builds to issue internal compiler errors. This
particular bug is already fixed on nightly, but that fix has not yet rolled out
to stable and is deemed too risky for a direct stable backport.

As always, we encourage users to test with nightly and report bugs so that we
can track failures and fix issues earlier.

See [94124] for more details.

[94124]: https://github.com/rust-lang/rust/issues/94124

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

Internal Changes
----------------
Expand Down Expand Up @@ -127,6 +143,7 @@ and related tools.
[91984]: https://github.com/rust-lang/rust/pull/91984/
[92020]: https://github.com/rust-lang/rust/pull/92020/
[92034]: https://github.com/rust-lang/rust/pull/92034/
[92137]: https://github.com/rust-lang/rust/pull/92137/
[92483]: https://github.com/rust-lang/rust/pull/92483/
[cargo/10088]: https://github.com/rust-lang/cargo/pull/10088/
[cargo/10133]: https://github.com/rust-lang/cargo/pull/10133/
Expand Down
23 changes: 23 additions & 0 deletions compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ pub fn expand_test_or_bench(
"ignore",
cx.expr_bool(sp, should_ignore(&cx.sess, &item)),
),
// ignore_message: Some("...") | None
field(
"ignore_message",
if let Some(msg) = should_ignore_message(cx, &item) {
cx.expr_some(sp, cx.expr_str(sp, msg))
} else {
cx.expr_none(sp)
},
),
// compile_fail: true | false
field("compile_fail", cx.expr_bool(sp, false)),
// no_run: true | false
Expand Down Expand Up @@ -364,6 +373,20 @@ fn should_ignore(sess: &Session, i: &ast::Item) -> bool {
sess.contains_name(&i.attrs, sym::ignore)
}

fn should_ignore_message(cx: &ExtCtxt<'_>, i: &ast::Item) -> Option<Symbol> {
match cx.sess.find_by_name(&i.attrs, sym::ignore) {
Some(attr) => {
match attr.meta_item_list() {
// Handle #[ignore(bar = "foo")]
Some(_) => None,
// Handle #[ignore] and #[ignore = "message"]
None => attr.value_str(),
}
}
None => None,
}
}

fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
match cx.sess.find_by_name(&i.attrs, sym::should_panic) {
Some(attr) => {
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_expand/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ impl<'a> ExtCtxt<'a> {
self.expr_call_global(sp, some, vec![expr])
}

pub fn expr_none(&self, sp: Span) -> P<ast::Expr> {
let none = self.std_path(&[sym::option, sym::Option, sym::None]);
self.expr_path(self.path_global(sp, none))
}
pub fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
self.expr(sp, ast::ExprKind::Tup(exprs))
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
})
.collect::<Result<Vec<_>, _>>();

let Ok(where_predicates) = where_predicates else { return };
let Ok(where_predicates) = where_predicates else { return };

// now get all predicates in the same types as the where bounds, so we can chain them
let predicates_from_where =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,25 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
fn borrow(
&mut self,
place_with_id: &expr_use_visitor::PlaceWithHirId<'tcx>,
_diag_expr_id: HirId,
diag_expr_id: HirId,
_bk: rustc_middle::ty::BorrowKind,
) {
debug!("borrow {:?}; diag_expr_id={:?}", place_with_id, diag_expr_id);
self.places
.borrowed
.insert(TrackedValue::from_place_with_projections_allowed(place_with_id));
}

fn mutate(
&mut self,
_assignee_place: &expr_use_visitor::PlaceWithHirId<'tcx>,
_diag_expr_id: HirId,
assignee_place: &expr_use_visitor::PlaceWithHirId<'tcx>,
diag_expr_id: HirId,
) {
debug!("mutate {:?}; diag_expr_id={:?}", assignee_place, diag_expr_id);
// Count mutations as a borrow.
self.places
.borrowed
.insert(TrackedValue::from_place_with_projections_allowed(assignee_place));
}

fn fake_read(
Expand Down
Loading

0 comments on commit 03c8ffa

Please sign in to comment.