Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #90944

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
26ca71f
normalize argument b in equate_normalized_inputs_output
b-naber Nov 9, 2021
7a4aa65
add tests
b-naber Nov 9, 2021
da7dd4f
Print full char literal on error if any are non-printing
5225225 Nov 13, 2021
65e02be
Suggest removing the non-printing characters
5225225 Nov 13, 2021
6a34355
Remove debug output from test stderr
5225225 Nov 13, 2021
e197392
Inline printable function
5225225 Nov 13, 2021
d58d52a
Fix handling of substitutions and binders when deciding whether to su…
JakobDegen Nov 11, 2021
eebf676
fix getting the discriminant of a zero-variant enum
RalfJung Nov 14, 2021
9ec8862
expand comment
RalfJung Nov 15, 2021
d562f48
suggest `&str.chars()` on attempt to `&str.iter()`
TaKO8Ki Nov 11, 2021
c1c2013
rustc_mir_build: reorder bindings
krasimirgg Nov 15, 2021
9c7f4f4
Use a different server for checking clock drift
Mark-Simulacrum Nov 15, 2021
894c0e4
Add a regression test for #80772
JohnTitor Nov 16, 2021
c9fcbda
check where clause before suggesting unsized
tlyu Jun 18, 2021
1a50725
refactor is_param_bound
tlyu Jun 19, 2021
37cf942
Rollup merge of #86455 - tlyu:check-where-before-suggesting-unsized, …
JohnTitor Nov 16, 2021
1bf823a
Rollup merge of #90801 - b-naber:missing_normalization_equate_inputs_…
JohnTitor Nov 16, 2021
5f7d30f
Rollup merge of #90803 - TaKO8Ki:suggest-chars-on-attempt-to-iter, r=…
JohnTitor Nov 16, 2021
b860a30
Rollup merge of #90819 - JakobDegen:issue-90804, r=petrochenkov
JohnTitor Nov 16, 2021
0c78c40
Rollup merge of #90861 - 5225225:nonprinting-char, r=davidtwco
JohnTitor Nov 16, 2021
3215c44
Rollup merge of #90910 - RalfJung:const-discriminant-empty-enum, r=pe…
JohnTitor Nov 16, 2021
1d48832
Rollup merge of #90925 - krasimirgg:rustc_mir_build_fix, r=petrochenkov
JohnTitor Nov 16, 2021
fcf5bf8
Rollup merge of #90928 - Mark-Simulacrum:fix-date-logging, r=pietroal…
JohnTitor Nov 16, 2021
9e7bbfd
Rollup merge of #90936 - JohnTitor:issue-80772, r=Mark-Simulacrum
JohnTitor Nov 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustc_mir_build: reorder bindings
No functional changes intended.

I'm playing around with building compiler components using nightly rust
(2021-11-02) in a non-standard way. I encountered the following error while
trying to build rustc_mir_build:

```
error[E0597]: `wildcard` does not live long enough
    --> rust/src/nightly/compiler/rustc_mir_build/src/build/matches/mod.rs:1767:82
     |
1767 |         let mut otherwise_candidate = Candidate::new(expr_place_builder.clone(), &wildcard, false);
     |                                                                                  ^^^^^^^^^ borrowed value does not live long enough
...
1799 |     }
     |     -
     |     |
     |     `wildcard` dropped here while still borrowed
     |     borrow might be used here, when `guard_candidate` is dropped and runs the destructor for type `Candidate<'_, '_>`
     |
     = note: values in a scope are dropped in the opposite order they are defined
```

I believe this flags an issue that may become an error in the future.
Swapping the order of `wildcard` and `guard_candidate` resolves it.
  • Loading branch information
krasimirgg committed Nov 15, 2021
commit c1c20138a9c895fe285c864b432472438ff978fd
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1762,8 +1762,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
) -> BlockAnd<()> {
let expr_span = expr.span;
let expr_place_builder = unpack!(block = self.lower_scrutinee(block, expr, expr_span));
let mut guard_candidate = Candidate::new(expr_place_builder.clone(), &pat, false);
let wildcard = Pat::wildcard_from_ty(pat.ty);
let mut guard_candidate = Candidate::new(expr_place_builder.clone(), &pat, false);
let mut otherwise_candidate = Candidate::new(expr_place_builder.clone(), &wildcard, false);
let fake_borrow_temps = self.lower_match_tree(
block,
Expand Down