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

regression 1.49: trait bound no longer inferred for associated type #79904

Closed
rylev opened this issue Dec 10, 2020 · 15 comments
Closed

regression 1.49: trait bound no longer inferred for associated type #79904

rylev opened this issue Dec 10, 2020 · 15 comments
Assignees
Labels
A-traits Area: Trait system regression-from-stable-to-beta Performance or correctness regression from stable to beta. relnotes Marks issues that should be documented in the release notes of the next release. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@rylev
Copy link
Member

rylev commented Dec 10, 2020

Log: https://crater-reports.s3.amazonaws.com/beta-1.49-1/beta-2020-11-26/gh/marcianx.openmesh-rs-core/log.txt

[INFO] [stdout] error[E0277]: the trait bound `H: handle::ItemHandle` is not satisfied
[INFO] [stdout]    --> src/property/property.rs:119:14
[INFO] [stdout]     |
[INFO] [stdout] 119 |         self.clone_as_trait()
[INFO] [stdout]     |              ^^^^^^^^^^^^^^ the trait `handle::ItemHandle` is not implemented for `H`
[INFO] [stdout]     |
[INFO] [stdout] help: consider restricting type parameter `H`
[INFO] [stdout]     |
[INFO] [stdout] 116 | impl<H: handle::ItemHandle> Clone for Box<dyn ResizeableProperty<Handle=H>>
[INFO] [stdout]     |       ^^^^^^^^^^^^^^^^^^^^

ResizeablePropertyHandle::Handle is constrained to implement handle::ItemHandle.

Other logs:
https://crater-reports.s3.amazonaws.com/beta-1.49-1/beta-2020-11-26/gh/Polkadex-Substrate.polkadex-engine/log.txt
https://crater-reports.s3.amazonaws.com/beta-1.49-1/beta-2020-11-26/reg/actix-amqp-0.1.4/log.txt
https://crater-reports.s3.amazonaws.com/beta-1.49-1/beta-2020-11-26/reg/ntex-amqp-0.1.20/log.txt

@rustbot modify labels: +regression-from-stable-to-beta

@rustbot rustbot added regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 10, 2020
@Mark-Simulacrum Mark-Simulacrum added this to the 1.49.0 milestone Dec 10, 2020
@Mark-Simulacrum
Copy link
Member

cc @nikomatsakis, @matthewjasper -- might this be related to #78893? It looks sort of "inverse" of that one I guess

@rylev
Copy link
Member Author

rylev commented Dec 10, 2020

The actix-amqp and ntex-amqp logs also show another error (E0271). Perhaps these errors are related, but it's not easy to tell.

@dillona
Copy link
Contributor

dillona commented Dec 11, 2020

searched nightlies: from nightly-2020-09-24 to nightly-2020-12-11
regressed nightly: nightly-2020-10-07
searched commits: from a1dfd24 to 98edd1f
regressed commit: 08e2d46

bisected with cargo-bisect-rustc v0.6.0

Host triple: aarch64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc

@Mark-Simulacrum
Copy link
Member

Probably a duplicate of #79905

@matthewjasper
Copy link
Contributor

#77638 maybe?

@camelid camelid added A-traits Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 11, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 16, 2020

#77638 was marked as wontfix: #77638 (comment). If this is the same issue, does it make sense to close it too?

@rylev
Copy link
Member Author

rylev commented Dec 17, 2020

I'm surprised #77638 was marked as wontfix. This is a breaking change that seems to effect several real crates. While I admit I was surprised that this used to work (i.e., the current behavior makes more sense to me), I think we should confirm that how it's currently implemented in beta is how it's supposed to work.

@rylev
Copy link
Member Author

rylev commented Dec 17, 2020

After discussion in Zulip, we decided to nominate this for discussion:

@rustbot label I-nominate

@apiraino
Copy link
Contributor

@rustbot label I-nominate

(let me try)

@Mark-Simulacrum
Copy link
Member

@matthewjasper can you say whether you expect this to be fixable and backportable in time for the release on the 31st? It looks like a standard regression of inference to me, so maybe not too bad, but would be good to fix if possible. Maybe it is fixed by #80132? I could see inference failing as a result of the change there to my naive glance :)

@matthewjasper
Copy link
Contributor

Looking at this more closely, this is fallout from fixing #27675.

@Mark-Simulacrum Mark-Simulacrum added relnotes Marks issues that should be documented in the release notes of the next release. and removed I-nominated I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 18, 2020
@Mark-Simulacrum
Copy link
Member

Okay, sounds like won't fix and that we should note the fix for #27675 as a compatibility note. Assigning to @XAMPPRocky to do so (and close this issue once you have done so).

@XAMPPRocky
Copy link
Member

Now in relnotes.

@ibaryshnikov
Copy link

Can we have a summary of what happened? Or maybe a mention in the rust blog? After following through linked issues and pull requests I found a few mentions of security holes, but it's hard for me to reason about it. Some explanations from those who are more familiar with the topic would be much appreciated.
And what should I do with the code which compiled on stable rust 1.48.0 but stopped to compile on stable rust 1.49.0? Should I wait for a fix or rewrite it?

@matthewjasper
Copy link
Contributor

bors bot added a commit to godot-rust/gdnative that referenced this issue Feb 3, 2021
686: Fix bounds in RefKindSpec trait r=toasteater a=toasteater

A [rustc regression](rust-lang/rust#79904) in the latest stable version as of writing (1.49.0) caused this to sneak past CI. This should let the library compile again. A test using rustc 1.46.0 is added, but this is not a commitment of minimum compiler version.

Co-authored-by: toasteater <48371905+toasteater@users.noreply.github.com>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Feb 14, 2021
Pkgsrc changes:
 * Adjust patches, convert tabs to spaces so that tests pass.
 * Remove patches which are no longer needed (upstream changed)
 * Minor adjustments for SunOS, e.g. disable stack probes.
 * Adjust cargo checksum patching accordingly.
 * Remove commented-out use of PATCHELF on NetBSD, which doesn't work anyway...

Upstream changes:

Version 1.49.0 (2020-12-31)
============================

Language
-----------------------

- [Unions can now implement `Drop`, and you can now have a field in a union
  with `ManuallyDrop<T>`.][77547]
- [You can now cast uninhabited enums to integers.][76199]
- [You can now bind by reference and by move in patterns.][76119] This
  allows you to selectively borrow individual components of a type. E.g.
  ```rust
  #[derive(Debug)]
  struct Person {
      name: String,
      age: u8,
  }

  let person = Person {
      name: String::from("Alice"),
      age: 20,
  };

  // `name` is moved out of person, but `age` is referenced.
  let Person { name, ref age } = person;
  println!("{} {}", name, age);
  ```

Compiler
-----------------------

- [Added tier 1\* support for `aarch64-unknown-linux-gnu`.][78228]
- [Added tier 2 support for `aarch64-apple-darwin`.][75991]
- [Added tier 2 support for `aarch64-pc-windows-msvc`.][75914]
- [Added tier 3 support for `mipsel-unknown-none`.][78676]
- [Raised the minimum supported LLVM version to LLVM 9.][78848]
- [Output from threads spawned in tests is now captured.][78227]
- [Change os and vendor values to "none" and "unknown" for some targets][78951]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
-----------------------

- [`RangeInclusive` now checks for exhaustion when calling `contains`
  and indexing.][78109]
- [`ToString::to_string` now no longer shrinks the internal buffer
  in the default implementation.][77997]
- [`ops::{Index, IndexMut}` are now implemented for fixed sized
  arrays of any length.][74989]

Stabilized APIs
---------------

- [`slice::select_nth_unstable`]
- [`slice::select_nth_unstable_by`]
- [`slice::select_nth_unstable_by_key`]

The following previously stable methods are now `const`.

- [`Poll::is_ready`]
- [`Poll::is_pending`]

Cargo
-----------------------
- [Building a crate with `cargo-package` should now be independently
  reproducible.][cargo/8864]
- [`cargo-tree` now marks proc-macro crates.][cargo/8765]
- [Added `CARGO_PRIMARY_PACKAGE` build-time environment
  variable.]  [cargo/8758] This variable will be set if the crate
  being built is one the user selected to build, either with `-p`
  or through defaults.
- [You can now use glob patterns when specifying packages &
  targets.][cargo/8752]


Compatibility Notes
-------------------
- [Demoted `i686-unknown-freebsd` from host tier 2 to target tier
  2 support.][78746]
- [Macros that end with a semi-colon are now treated as statements
  even if they expand to nothing.][78376]
- [Rustc will now check for the validity of some built-in attributes
  on enum variants.][77015] Previously such invalid or unused
  attributes could be ignored.
- Leading whitespace is stripped more uniformly in documentation
  comments, which may change behavior. You read [this post about
  the changes][rustdoc-ws-post] for more details.
- [Trait bounds are no longer inferred for associated types.][79904]

Internal Only
-------------
These changes provide no direct user facing benefits, but represent
significant improvements to the internals and overall performance
of rustc and related tools.

- [rustc's internal crates are now compiled using the `initial-exec` Thread
  Local Storage model.][78201]
- [Calculate visibilities once in resolve.][78077]
- [Added `system` to the `llvm-libunwind` bootstrap config option.][77703]
- [Added `--color` for configuring terminal color support to bootstrap.][79004]


[75991]: rust-lang/rust#75991
[78951]: rust-lang/rust#78951
[78848]: rust-lang/rust#78848
[78746]: rust-lang/rust#78746
[78376]: rust-lang/rust#78376
[78228]: rust-lang/rust#78228
[78227]: rust-lang/rust#78227
[78201]: rust-lang/rust#78201
[78109]: rust-lang/rust#78109
[78077]: rust-lang/rust#78077
[77997]: rust-lang/rust#77997
[77703]: rust-lang/rust#77703
[77547]: rust-lang/rust#77547
[77015]: rust-lang/rust#77015
[76199]: rust-lang/rust#76199
[76119]: rust-lang/rust#76119
[75914]: rust-lang/rust#75914
[74989]: rust-lang/rust#74989
[79004]: rust-lang/rust#79004
[78676]: rust-lang/rust#78676
[79904]: rust-lang/rust#79904
[cargo/8864]: rust-lang/cargo#8864
[cargo/8765]: rust-lang/cargo#8765
[cargo/8758]: rust-lang/cargo#8758
[cargo/8752]: rust-lang/cargo#8752
[`slice::select_nth_unstable`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable
[`slice::select_nth_unstable_by`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by
[`slice::select_nth_unstable_by_key`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by_key
[`hint::spin_loop`]: https://doc.rust-lang.org/stable/std/hint/fn.spin_loop.html
[`Poll::is_ready`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_ready
[`Poll::is_pending`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_pending
[rustdoc-ws-post]: https://blog.guillaume-gomez.fr/articles/2020-11-11+New+doc+comment+handling+in+rustdoc
KarimHamidou added a commit to KarimHamidou/godot-rust that referenced this issue Feb 6, 2023
686: Fix bounds in RefKindSpec trait r=toasteater a=toasteater

A [rustc regression](rust-lang/rust#79904) in the latest stable version as of writing (1.49.0) caused this to sneak past CI. This should let the library compile again. A test using rustc 1.46.0 is added, but this is not a commitment of minimum compiler version.

Co-authored-by: toasteater <48371905+toasteater@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system regression-from-stable-to-beta Performance or correctness regression from stable to beta. relnotes Marks issues that should be documented in the release notes of the next release. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants