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

[Crater run experiment] let-chain rescoping #125151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dingxiangfei2009
Copy link
Contributor

@dingxiangfei2009 dingxiangfei2009 commented May 15, 2024

Please do not merge this PR. This is only for crater run experimentation.

I would like to nominate a crater run for #107251 assuming that the feature gate is always on. Through this experiment, we hope to collect breakage in the wild. We would focus on both compilation errors and test errors that this edition change can lead to, if users are targeting Edition 2024 and writing code assuming the old semantics unknowingly.

I realise that some tests may not work well if an edition switch happens. I am fixing them in the main PR.

Tracking:

@rustbot
Copy link
Collaborator

rustbot commented May 15, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 15, 2024
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 29.3s done
#16 DONE 41.8s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
6
------------------------------------------
--- stderr -------------------------------
thread 'main' panicked at /checkout/tests/ui/drop/drop_order.rs:242:9:
assertion failed: self.0.into_inner().into_iter().enumerate().all(|(idx, item)|
        idx + 1 == item.try_into().unwrap())
------------------------------------------


---- [ui] tests/ui/feature-gates/feature-gate-if-let-rescope.rs stdout ----
---- [ui] tests/ui/feature-gates/feature-gate-if-let-rescope.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/feature-gates/feature-gate-if-let-rescope.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-if-let-rescope" "-A" "unused" "-A" "internal_features" "-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/feature-gates/feature-gate-if-let-rescope/auxiliary"
stderr: none


---- [ui] tests/ui/mir/mir_let_chains_drop_order.rs stdout ----

@saethlin saethlin added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 15, 2024
@Nadrieril
Copy link
Member

I'm on vacation for a week, I'll let someone else figure out the right crater incantation.

r? compiler

@rustbot rustbot assigned estebank and unassigned Nadrieril May 15, 2024
@est31
Copy link
Member

est31 commented May 16, 2024

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request May 16, 2024
…rater-runner, r=<try>

[Crater run experiment] let-chain rescoping

Please do not merge this PR. This is only for crater run experimentation.

I would like to nominate a crater run for rust-lang#107251 assuming that the feature gate is always on. Through this experiment, we hope to collect breakage in the wild. We would focus on both compilation errors and test errors that this edition change can lead to, if users are targeting Edition 2024 and writing code assuming the old semantics unknowingly.

I realise that some tests may not work well if an edition switch happens. I am fixing them in the main PR.
@bors
Copy link
Contributor

bors commented May 16, 2024

⌛ Trying commit 4509cf0 with merge b642703...

@bors
Copy link
Contributor

bors commented May 16, 2024

☀️ Try build successful - checks-actions
Build commit: b642703 (b642703cf9526da1e72c0b6755753b939a9c6b6d)

@dingxiangfei2009
Copy link
Contributor Author

I would like to run @craterbot build-and-test because some breakage due to this edition change will happen at runtime.

@estebank
Copy link
Contributor

@craterbot build-and-test

@craterbot
Copy link
Collaborator

🚨 Error: failed to parse the command

🆘 If you have any trouble with Crater please ping @rust-lang/infra!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@estebank
Copy link
Contributor

@craterbot run mode=build-and-test

@craterbot
Copy link
Collaborator

👌 Experiment pr-125151 created and queued.
🤖 Automatically detected try build b642703
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. labels May 21, 2024
@craterbot
Copy link
Collaborator

🚧 Experiment pr-125151 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-125151 is completed!
📊 192 regressed and 117 fixed (464331 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels May 26, 2024
@estebank
Copy link
Contributor

We'd need to improve the diagnostic if we make this change, but not terrible. There impact is larger than I'd be personally comfortable, but also small enough that it might be acceptable after fixing smodel. I would like to make this a lint behavior instead of a breaking change.

[INFO] [stderr]    Compiling smodel v1.0.13 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]    --> src/lib.rs:37:9
[INFO] [stdout]     |
[INFO] [stdout] 37  | /         smodel! {
[INFO] [stdout] 38  | |             mod smodel = crate;
[INFO] [stdout] 39  | |
[INFO] [stdout] 40  | |             type Arena = Arena;
[INFO] [stdout] ...   |
[INFO] [stdout] 121 | |             }
[INFO] [stdout] 122 | |         }
[INFO] [stdout]     | |         ^
[INFO] [stdout]     | |         |
[INFO] [stdout]     | |         temporary value is freed at the end of this statement
[INFO] [stdout]     | |_________creates a temporary value which is freed while still in use
[INFO] [stdout]     |           borrow later used here
[INFO] [stdout]     |
[INFO] [stdout]     = note: consider using a `let` binding to create a longer lived value
[INFO] [stdout]     = note: this error originates in the macro `smodel` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]    --> src/main.rs:343:31
[INFO] [stdout]     |
[INFO] [stdout] 343 |         if let Ok(ref home) = env::var("HOME") { home } else { "$HOME" } );
[INFO] [stdout]     |         ----------------------^^^^^^^^^^^^^^^^--------------------------
[INFO] [stdout]     |         |                     |                       |
[INFO] [stdout]     |         |                     |                       temporary value is freed at the end of this statement
[INFO] [stdout]     |         |                     creates a temporary value which is freed while still in use
[INFO] [stdout]     |         borrow later used here
[INFO] [stdout]     |
[INFO] [stdout]     = note: consider using a `let` binding to create a longer lived value
[INFO] [stderr]    Compiling psi-lang v0.3.0 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]    --> src/interpreter.rs:107:38
[INFO] [stdout]     |
[INFO] [stdout] 105 |                 self.env.raw_expr(
[INFO] [stdout]     |                          -------- borrow later used by call
[INFO] [stdout] 106 |                     &id[0],
[INFO] [stdout] 107 |                     if let Some(i) = items.keys().get(iteration as usize) {
[INFO] [stdout]     |                                      ^^^^^^^^^^^^ creates a temporary value which is freed while still in use
[INFO] [stdout] 108 |                         i
[INFO] [stdout] 109 |                     } else {
[INFO] [stdout]     |                     - temporary value is freed at the end of this statement
[INFO] [stdout]     |
[INFO] [stdout]     = note: consider using a `let` binding to create a longer lived value
[INFO] [stderr]    Compiling hdf5file v0.1.1 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]   --> examples/object.rs:35:40
[INFO] [stdout]    |
[INFO] [stdout] 33 | /                 println!(
[INFO] [stdout] 34 | |                     "{}",
[INFO] [stdout] 35 | |                     track_assert_some!(track!(object_path)?.to_str(), trackable::error::Failed)
[INFO] [stdout]    | |                     -------------------^^^^^^^^^^^^^^^^^^^^------------------------------------
[INFO] [stdout]    | |                     |                  |
[INFO] [stdout]    | |                     |                  creates a temporary value which is freed while still in use
[INFO] [stdout]    | |                     temporary value is freed at the end of this statement
[INFO] [stdout] 36 | |                 );
[INFO] [stdout]    | |_________________- borrow later used here
[INFO] [stdout]    |
[INFO] [stdout]    = note: consider using a `let` binding to create a longer lived value
[INFO] [stderr]    Compiling haddock v0.2.1 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]   --> src/commands/stop.rs:85:42
[INFO] [stdout]    |
[INFO] [stdout] 83 | ...                   .chain(
[INFO] [stdout]    |                        ----- borrow later used by call
[INFO] [stdout] 84 | ...                       if let Some(timeout) =
[INFO] [stdout] 85 | ...                           &args.timeout.map(|timeout| timeout.to_string())
[INFO] [stdout]    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
[INFO] [stdout] ...
[INFO] [stdout] 88 | ...                       } else {
[INFO] [stdout]    |                           - temporary value is freed at the end of this statement
[INFO] [stdout]    |
[INFO] [stdout]    = note: consider using a `let` binding to create a longer lived value
[INFO] [stderr]    Compiling ozes-parser v0.1.4 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]   --> src/parser/mod.rs:84:50
[INFO] [stdout]    |
[INFO] [stdout] 84 | ...   if let Some(ref value) = self.current_tok.value() { String::from_utf8_lossy(value) } else { String::from_utf8_lossy(b"any") }
[INFO] [stdout]    |       -------------------------^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------------------------------------------------
[INFO] [stdout]    |       |                        |                                                         |
[INFO] [stdout]    |       |                        |                                                         temporary value is freed at the end of this statement
[INFO] [stdout]    |       |                        creates a temporary value which is freed while still in use
[INFO] [stdout]    |       borrow later used here
[INFO] [stdout]    |
[INFO] [stdout]    = note: consider using a `let` binding to create a longer lived value
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]    --> src/main.rs:155:38
[INFO] [stdout]     |
[INFO] [stdout] 155 |           if let Some(project_dirs) = &ProjectDirs::from("", "HaNa", "project_manager") {
[INFO] [stdout]     |           -                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
[INFO] [stdout]     |  _________|
[INFO] [stdout]     | |
[INFO] [stdout] 156 | |             Ok(project_dirs.config_dir())
[INFO] [stdout] 157 | |         } else {
[INFO] [stdout]     | |         - temporary value is freed at the end of this statement
[INFO] [stdout] 158 | |             Err(anyhow!("failed finding the config directory"))
[INFO] [stdout] 159 | |         }?
[INFO] [stdout]     | |__________- borrow later used by call
[INFO] [stdout]     |
[INFO] [stdout] help: consider using a `let` binding to create a longer lived value
[INFO] [stdout]     |
[INFO] [stdout] 154 ~     let binding = ProjectDirs::from("", "HaNa", "project_manager");
[INFO] [stdout] 155 ~     let mut config_path: PathBuf =
[INFO] [stdout] 156 ~         if let Some(project_dirs) = &binding {
[INFO] [stdout]     |
[INFO] [stderr]    Compiling toipe v0.5.0 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]   --> src/config.rs:45:44
[INFO] [stdout]    |
[INFO] [stdout] 45 |               if let Some(possible_value) = &self.wordlist.to_possible_value() {
[INFO] [stdout]    |               -                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
[INFO] [stdout]    |  _____________|
[INFO] [stdout]    | |
[INFO] [stdout] 46 | |                 possible_value.get_name()
[INFO] [stdout] 47 | |             } else {
[INFO] [stdout]    | |             - temporary value is freed at the end of this statement
[INFO] [stdout] 48 | |                 "unknown"
[INFO] [stdout] 49 | |             }
[INFO] [stdout]    | |_____________- borrow later used here
[INFO] [stdout]    |
[INFO] [stdout]    = note: consider using a `let` binding to create a longer lived value

@est31
Copy link
Member

est31 commented May 28, 2024

FTR the first version of smodel on crates.io, 0.1.0 was released one month ago, April 29 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants