rust icon indicating copy to clipboard operation
rust copied to clipboard

most `borrowck` diagnostic migration

Open AndyJado opened this issue 1 year ago • 10 comments

Covered the simple cases for the whole crate, looking for merge. Then I can focus on the nested ones, rebase is becoming rather slow.

@rustbot label +S-waiting-on-author -S-waiting-on-review

AndyJado avatar Sep 11 '22 12:09 AndyJado

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

rust-highfive avatar Sep 11 '22 12:09 rust-highfive

r? @davidtwco

AndyJado avatar Sep 11 '22 12:09 AndyJado

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

rustbot avatar Sep 11 '22 13:09 rustbot

I'd also like it if you could squash some of your commits because these aren't particularly meaningful to anyone reading them later to understand the changes you've made and why.

davidtwco avatar Sep 12 '22 15:09 davidtwco

:umbrella: The latest upstream changes (presumably #101086) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Sep 13 '22 21:09 bors

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/compiler/rustc_borrowck/src/borrowck_errors.rs at line 6:
 use crate::session_diagnostics::{
 use crate::session_diagnostics::{
     AssignBorrowErr, BorrowAcrossDestructor, BorrowAcrossGeneratorYield, ClosureConstructLabel,
-    InteriorDropMoveErr, MoveBorrowedErr, PathShortLive, TwoClosuresUniquelyBorrowErr, UseMutBorrowErr,
+    InteriorDropMoveErr, MoveBorrowedErr, PathShortLive, TwoClosuresUniquelyBorrowErr,
+    UseMutBorrowErr,
 
 
 impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/compiler/rustc_borrowck/src/lib.rs" "/checkout/compiler/rustc_borrowck/src/borrowck_errors.rs" "/checkout/compiler/rustc_borrowck/src/facts.rs" "/checkout/compiler/rustc_borrowck/src/location.rs" "/checkout/compiler/rustc_borrowck/src/dataflow.rs" "/checkout/compiler/rustc_borrowck/src/prefixes.rs" "/checkout/compiler/rustc_smir/src/very_unstable.rs" "/checkout/compiler/rustc_borrowck/src/region_infer/opaque_types.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.

rust-log-analyzer avatar Sep 19 '22 14:09 rust-log-analyzer

Please run x.py fmt

estebank avatar Sep 19 '22 15:09 estebank

:umbrella: The latest upstream changes (presumably #102265) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Sep 25 '22 16:09 bors

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Check compiletest suite=ui-fulldeps mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 71 tests
Some tests failed in compiletest suite=ui-fulldeps mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
F....F.................i...............................................

---- [ui] src/test/ui-fulldeps/dropck-tarena-unsound-drop.rs stdout ----
diff of stderr:


7    | -
8    | |
9    | `arena` dropped here while still borrowed
-    | borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `TypedArena`
+    | borrow might be used here, when `arena` is dropped and runs the destructor for type `TypedArena`
12 error: aborting due to previous error
13 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/dropck-tarena-unsound-drop/dropck-tarena-unsound-drop.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args dropck-tarena-unsound-drop.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/dropck-tarena-unsound-drop.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/dropck-tarena-unsound-drop" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/dropck-tarena-unsound-drop/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0597]: `arena` does not live long enough
   |
   |
LL |     f(&arena);
   |       ^^^^^^ borrowed value does not live long enough
LL | } //~^ ERROR `arena` does not live long enough
   | |
   | |
   | `arena` dropped here while still borrowed
   | borrow might be used here, when `arena` is dropped and runs the destructor for type `TypedArena`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui-fulldeps/dropck-tarena-cycle-checked.rs stdout ----
diff of stderr:

7    | -
8    | |
9    | `arena` dropped here while still borrowed
-    | borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `TypedArena`
+    | borrow might be used here, when `arena` is dropped and runs the destructor for type `TypedArena`
12 error: aborting due to previous error
13 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/dropck-tarena-cycle-checked/dropck-tarena-cycle-checked.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args dropck-tarena-cycle-checked.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/dropck-tarena-cycle-checked.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/dropck-tarena-cycle-checked" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/dropck-tarena-cycle-checked/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0597]: `arena` does not live long enough
   |
   |
LL |     f(&arena);
   |       ^^^^^^ borrowed value does not live long enough
LL | } //~^ ERROR `arena` does not live long enough
   | |
   | |
   | `arena` dropped here while still borrowed
   | borrow might be used here, when `arena` is dropped and runs the destructor for type `TypedArena`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
------------------------------------------

rust-log-analyzer avatar Sep 26 '22 12:09 rust-log-analyzer

:umbrella: The latest upstream changes (presumably #102700) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Oct 14 '22 01:10 bors

Hi, I've seen you changed some diagnostic structs in your PR. After #103345, the way we refer to fluent messages changed. They are now in a flat namespace with the same identifier as in the fluent file. For example, parser::cool_thing is now parser_cool_thing and parser::suggestion just suggestion. You should rebase to the latest master and change your fluent message references as described above. Thanks!

Nilstrieb avatar Oct 23 '22 11:10 Nilstrieb

I am closing this PR since it relies too much on string base dispatch and out-dated discussion.

I'll try to keep following PR clear and small like this one

AndyJado avatar Nov 04 '22 05:11 AndyJado