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 7 pull requests #86221

Closed
wants to merge 17 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

BoxyUwU and others added 15 commits May 29, 2021 03:54
also add tests for these 2 kinds of errors for size and alignment,
as the existing size check wasn't apparently tested
…tics, r=oli-obk

Fix some diagnostic issues with const_generics_defaults feature gate

This PR makes a few changes:
- print out const param defaults in "lifetime ordering" errors rather than discarding them
- update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message
- fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
Detect incorrect vtable alignment during const eval

This PR fixes rust-lang#86132 by detecting invalid alignment values for trait objects in the interpreter, and emitting an error about this conversion failure, to avoid the ICE.

I've noticed that the error emitted at https://github.com/rust-lang/rust/blob/a50d72158e08e02cfc051b863017bdbd2c45b637/compiler/rustc_mir/src/interpret/traits.rs#L163-L166 doesn't seem to be present in the const-ub tests, so I've tried adding a test that triggers both of these cases: one for the invalid size, and another for the invalid alignment that rust-lang#86132 tracks (I have found different magic values triggering different `Align::from_bytes` errors than the "power of 2" one, if need be).

However, when doing that, I *cannot* for the life of me figure out the correct incantation to make these 2 errors trigger with the "it is undefined behavior to use this value" message rather than the "any use of this value will cause an error" lint.

I've tried Oli's suggestions of different values, tuples and arrays, using the transparent wrapper trick from the other tests and I was only able to trigger the regular const-ub errors about the size of the vtable, or that the drop pointer was invalid. Maybe these "type validation failed" errors happen before this part of the interpreter is reached and there just needs some magic incorrect values to bypass them, I don't know.

Since this fixes an ICE, and if the constants are indeed used, these 2 tests will turn into a hard error, I thought I'd open the PR anyways. And if ``@RalfJung`` you know of a way I could manage that (if you think that these tests are worth checking that the `throw_ub_format!` does indeed create const-ub errors as we expect) I'd be grateful.

For that reason, r? ``@RalfJung`` and cc ``@oli-obk.``
Make `relate_type_and_mut` public

rust-lang#85343 improved diagnostics around `Relate` impls but made `relate_type_and_mut` private, which was accessible as `relate` previously. This makes it public so that we can use it on rust-semverver.

r? ``@Aaron1011``
…i-obk

Run full const-generics test for issue-72293

Closes rust-lang#72293
r? ``@oli-obk``
Update cargo

10 commits in aa8b09297bb3156b849e73db48af4cd050492fe6..81537ee3f7bd97ff7821b6c86c148764d40d26cd
2021-06-09 00:28:53 +0000 to 2021-06-11 00:00:14 +0000
- Change how the fix_deny_warnings_but_not_others test works (rust-lang/cargo#9571)
- Add mising documentation regarding `cargo doc` (rust-lang/cargo#9565)
- Implement warning for ignored trailing arguments (rust-lang/cargo#9561)
- Make clippy happy (rust-lang/cargo#9569)
- Fix rustc/rustdoc config values to be config-relative. (rust-lang/cargo#9566)
- Update rustfix. (rust-lang/cargo#9567)
- Warn if an "all" target is specified, but we don't match anything (rust-lang/cargo#9549)
- add default_run to SerializedPackage (rust-lang/cargo#9550)
- respect user choice of lib/bin over heuristics (rust-lang/cargo#9522)
- Add a mean to mutably access the members of a workspace (rust-lang/cargo#9547)
@rustbot rustbot added the rollup A PR which is a rollup label Jun 11, 2021
@JohnTitor
Copy link
Member Author

@bors r+ p=7 rollup=never

@bors
Copy link
Contributor

bors commented Jun 11, 2021

📌 Commit f501456 has been approved by JohnTitor

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 11, 2021
@bors
Copy link
Contributor

bors commented Jun 11, 2021

⌛ Testing commit f501456 with merge 5f4f4afe4b04b048d36d7f77ead5afb6e6445a25...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
test init::bin_already_exists_implicit_namenosrc ... ok
test init::bin_already_exists_implicit_nosrc ... ok
test init::bin_already_exists_implicit_namesrc ... ok
test init::both_lib_and_bin ... ok
test init::cant_create_library_when_both_binlib_present ... ok
test init::cargo_lock_gitignored_if_lib2 ... ok
test init::confused_by_multiple_lib_files ... ok
test init::cargo_lock_not_gitignored_if_bin2 ... ok
test init::cargo_lock_not_gitignored_if_bin1 ... ok
test init::cargo_lock_not_gitignored_if_bin1 ... ok
test init::creates_binary_when_both_binlib_present ... ok
test init::creates_binary_when_instructed_and_has_lib_file_no_warning ... ok
test init::creates_library_when_instructed_and_has_bin_file ... ok
test glob_targets::test_example ... ok
test init::formats_source ... ok
test init::git_autodetect ... ok
test init::gitignore_added_newline_in_existing ... ok
---
test test::test_workspaces_cwd ... ok

failures:

---- metadata::package_default_run stdout ----
running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo metadata`
thread 'metadata::package_default_run' panicked at '
Expected: execs
    but: JSON mismatch
{
{
  "metadata": null,
  "packages": [
      "authors": [
      "authors": [
        "wycats@example.com"
      ],
      "categories": [],
      "default_run": "a",
      "dependencies": [],
      "description": null,
      "documentation": null,
      "edition": "2018",
      "features": {},
      "homepage": null,
      "id": "foo 0.1.0 (path+file:[..])",
      "keywords": [],
      "license": null,
      "license_file": null,
      "links": null,
      "manifest_path": "[..]Cargo.toml",
      "metadata": null,
      "name": "foo",
      "publish": null,
      "readme": null,
      "repository": null,
      "source": null,
      "targets": [
        {
          "crate_types": [
            "lib"
          ],
          "doc": true,
          "doctest": true,
          "edition": "2018",
          "kind": [
            "lib"
          ],
          "name": "foo",
          "src_path": "[..]src/lib.rs",
          "test": true
        {
        {
          "crate_types": [
            "bin"
          ],
          "doc": true,
          "doctest": false,
          "edition": "2018",
          "kind": [
            "bin"
          ],
          "name": "a",
          "src_path": "[..]src/bin/a.rs",
          "test": true
        {
        {
          "crate_types": [
            "bin"
          ],
          "doc": true,
          "doctest": false,
          "edition": "2018",
          "kind": [
            "bin"
          ],
          "name": "b",
          "src_path": "[..]src/bin/b.rs",
          "test": true
      ],
      "version": "0.1.0"
    }
  ],
  ],
  "resolve": {
    "nodes": [
      {
        "dependencies": [],
        "deps": [],
        "features": [],
        "id": "foo 0.1.0 (path+file:[..])"
    ],
    ],
    "root": "foo 0.1.0 (path+file:[..])"
  },
  "target_directory": "[..]",
  "version": 1,
  "workspace_members": [
    "foo 0.1.0 (path+file:[..])"
  ],
  "workspace_root": "[..]"
Was:
{
{
  "metadata": null,
  "packages": [
      "authors": [
      "authors": [
        "wycats@example.com"
      ],
      "categories": [],
      "default_run": "a",
      "dependencies": [],
      "description": null,
      "documentation": null,
      "edition": "2018",
      "features": {},
      "homepage": null,
      "id": "foo 0.1.0 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo)",
      "keywords": [],
      "license": null,
      "license_file": null,
      "links": null,
      "manifest_path": "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo/Cargo.toml",
      "metadata": null,
      "name": "foo",
      "publish": null,
      "readme": null,
      "repository": null,
      "source": null,
      "targets": [
        {
          "crate_types": [
            "lib"
          ],
          "doc": true,
          "doctest": true,
          "edition": "2018",
          "kind": [
            "lib"
          ],
          "name": "foo",
          "src_path": "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo/src/lib.rs",
          "test": true
        {
        {
          "crate_types": [
            "bin"
          ],
          "doc": true,
          "doctest": false,
          "edition": "2018",
          "kind": [
            "bin"
          ],
          "name": "b",
          "src_path": "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo/src/bin/b.rs",
          "test": true
        {
        {
          "crate_types": [
            "bin"
          ],
          "doc": true,
          "doctest": false,
          "edition": "2018",
          "kind": [
            "bin"
          ],
          "name": "a",
          "src_path": "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo/src/bin/a.rs",
          "test": true
      ],
      "version": "0.1.0"
    }
  ],
  ],
  "resolve": {
    "nodes": [
      {
        "dependencies": [],
        "deps": [],
        "features": [],
        "id": "foo 0.1.0 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo)"
    ],
    ],
    "root": "foo 0.1.0 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo)"
  },
  "target_directory": "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo/target",
  "version": 1,
  "workspace_members": [
    "foo 0.1.0 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo)"
  ],
  "workspace_root": "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/tmp/cit/t1315/foo"
Expected part:
"a"
Actual part:
"b"
---


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --stage 2 src/tools/cargo src/tools/cargotest
Build completed unsuccessfully in 0:17:58
make: *** [check-aux] Error 1
Makefile:44: recipe for target 'check-aux' failed

@bors
Copy link
Contributor

bors commented Jun 11, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 11, 2021
@JohnTitor JohnTitor mentioned this pull request Jun 11, 2021
@JohnTitor JohnTitor closed this Jun 11, 2021
@JohnTitor JohnTitor deleted the rollup-vay4ced branch June 11, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants