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

Crate cloud-storage does not compile on nightly-2023-07-27 #114579

Closed
df-oss opened this issue Aug 7, 2023 · 3 comments · Fixed by #114602
Closed

Crate cloud-storage does not compile on nightly-2023-07-27 #114579

df-oss opened this issue Aug 7, 2023 · 3 comments · Fixed by #114602
Assignees
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@df-oss
Copy link

df-oss commented Aug 7, 2023

Got compilation error when bumping rust for external crate cloud-storage for version indicated below. (https://github.com/ThouCheese/cloud-storage-rs)

Code

I tried this code:

⋊> ~/g/d/cloud-storage-rs on master ◦ rustup default nightly-2023-07-26-x86_64-unknown-linux-gnu                                                                                                                                                                          13:51:22
info: using existing install for 'nightly-2023-07-26-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-2023-07-26-x86_64-unknown-linux-gnu'

  nightly-2023-07-26-x86_64-unknown-linux-gnu unchanged - rustc 1.73.0-nightly (864bdf784 2023-07-25)

⋊> ~/g/d/cloud-storage-rs on master ◦ rustc --version                                                                                                                                                                                                                     13:51:23
rustc 1.73.0-nightly (864bdf784 2023-07-25)
⋊> ~/g/d/cloud-storage-rs on master ◦ cargo clippy                                                                                                                                                                                                                        13:51:28
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
⋊> ~/g/d/cloud-storage-rs on master ◦ rustup default nightly-2023-07-27-x86_64-unknown-linux-gnu                                                                                                                                                                          13:51:34
info: using existing install for 'nightly-2023-07-27-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-2023-07-27-x86_64-unknown-linux-gnu'

  nightly-2023-07-27-x86_64-unknown-linux-gnu unchanged - rustc 1.73.0-nightly (0d95f9132 2023-07-26)

⋊> ~/g/d/cloud-storage-rs on master ◦ cargo clippy                                                                                                                                                                                                                        13:54:54
   Compiling libc v0.2.147
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.66
   Compiling unicode-ident v1.0.11
    Checking once_cell v1.18.0
   Compiling vcpkg v0.2.15
   Compiling pkg-config v0.3.27
    Checking cfg-if v1.0.0
    Checking pin-project-lite v0.2.11
   Compiling futures-core v0.3.28
    Checking bytes v1.4.0
    Checking itoa v1.0.9
   Compiling serde v1.0.183
   Compiling tokio v1.29.1
   Compiling num-traits v0.2.16
   Compiling serde_derive v1.0.183
   Compiling futures-task v0.3.28
   Compiling indexmap v1.9.3
   Compiling quote v1.0.32
    Checking mio v0.8.8
    Checking socket2 v0.4.9
   Compiling cc v1.0.82
   Compiling syn v2.0.28
   Compiling slab v0.4.8
    Checking tracing-core v0.1.31
   Compiling futures-util v0.3.28
   Compiling openssl v0.10.56
    Checking foreign-types-shared v0.1.1
    Checking fnv v1.0.7
    Checking http v0.2.9
    Checking foreign-types v0.3.2
   Compiling num-integer v0.1.45
    Checking tracing v0.1.37
    Checking futures-sink v0.3.28
   Compiling futures-channel v0.3.28
    Checking hashbrown v0.12.3
   Compiling native-tls v0.2.11
    Checking bitflags v1.3.2
    Checking tinyvec_macros v0.1.1
   Compiling httparse v1.8.0
    Checking pin-utils v0.1.0
    Checking tinyvec v1.6.0
   Compiling num-bigint v0.2.6
    Checking percent-encoding v2.3.0
   Compiling serde_json v1.0.104
    Checking openssl-probe v0.1.5
    Checking try-lock v0.2.4
    Checking ryu v1.0.15
    Checking log v0.4.19
    Checking regex-syntax v0.7.4
    Checking unicode-normalization v0.1.22
    Checking want v0.3.1
   Compiling openssl-sys v0.9.91
   Compiling ring v0.16.20
    Checking form_urlencoded v1.2.0
    Checking http-body v0.4.5
    Checking time v0.1.45
    Checking unicode-bidi v0.3.13
    Checking iana-time-zone v0.1.57
    Checking tower-service v0.3.2
    Checking httpdate v1.0.2
    Checking regex-automata v0.3.6
    Checking chrono v0.4.26
    Checking idna v0.4.0
    Checking base64 v0.13.1
    Checking untrusted v0.7.1
   Compiling async-trait v0.1.72
    Checking spin v0.5.2
    Checking url v2.4.0
    Checking serde_urlencoded v0.7.1
    Checking encoding_rs v0.8.32
    Checking base64 v0.21.2
    Checking base64 v0.12.3
    Checking mime v0.3.17
    Checking ipnet v2.8.0
    Checking lazy_static v1.4.0
    Checking simple_asn1 v0.4.1
    Checking dotenv v0.15.0
    Checking regex v1.9.3
    Checking hex v0.4.3
    Checking pem v0.8.3
    Checking jsonwebtoken v7.2.0
   Compiling tokio-macros v2.1.0
   Compiling openssl-macros v0.1.1
    Checking tokio-util v0.7.8
    Checking tokio-native-tls v0.3.1
    Checking h2 v0.3.20
    Checking hyper v0.14.27
    Checking hyper-tls v0.5.0
    Checking reqwest v0.11.18
    Checking cloud-storage v0.11.1 (/home/mikael/gitrepos/dev/cloud-storage-rs)
error: concrete type differs from previous defining opaque type use
   --> src/client/object.rs:325:24
    |
325 |     ) -> crate::Result<impl Stream<Item = crate::Result<u8>> + Unpin> {
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        expected `resources::object::SizedByteStream<futures_util::stream::TryFlatten<futures_util::stream::Map<impl futures_util::Stream<Item = std::result::Result<bytes::Bytes, reqwest::Error>>, [closure@src/client/object.rs:344:18: 344:25]>>>`, got `resources::object::SizedByteStream<futures_util::stream::TryFlatten<futures_util::stream::Map<impl futures_util::Stream<Item = std::result::Result<bytes::Bytes, reqwest::Error>>, [closure@src/client/object.rs:344:18: 344:25]>>>`
    |                        this expression supplies two conflicting concrete types for the same opaque type

error: could not compile `cloud-storage` (lib) due to previous error

I expected to see this happen: Should compile on nightly 2023-07-27 toolchain.

Instead, this happened: Did not compile on nightly 2023-07-27 toolchain.

Version it worked on

It most recently worked on: Compiles on nightly 2023-07-26 toolchain.

Version with regression

rustc --version --verbose:

rustc 1.73.0-nightly (0d95f9132 2023-07-26)
binary: rustc
commit-hash: 0d95f9132909ae7c5f2456748d0ffd1c3ba4a8e8
commit-date: 2023-07-26
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Backtrace

Backtrace

<backtrace>

@df-oss df-oss added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Aug 7, 2023
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 7, 2023
@Noratrieb Noratrieb added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. T-types Relevant to the types team, which will review and decide on the PR/issue. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 7, 2023
@oli-obk oli-obk self-assigned this Aug 7, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Aug 7, 2023

May get fixed by #114574

@compiler-errors
Copy link
Member

This is certainly the same issue as #114597, which has a test.

bors added a commit to rust-lang-ci/rust that referenced this issue Aug 8, 2023
…s, r=oli-obk

Map RPIT duplicated lifetimes back to fn captured lifetimes

Use the [`lifetime_mapping`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.OpaqueTy.html#structfield.lifetime_mapping) to map an RPIT's captured lifetimes back to the early- or late-bound lifetimes from its parent function. We may be going thru several layers of mapping, since opaques can be nested, so we introduce `TyCtxt::map_rpit_lifetime_to_fn_lifetime` to loop through several opaques worth of mapping, and handle turning it into a `ty::Region` as well.

We can then use this instead of the identity substs for RPITs in `check_opaque_meets_bounds` to address rust-lang#114285.

We can then also use `map_rpit_lifetime_to_fn_lifetime` to properly install bidirectional-outlives predicates for both RPITs and RPITITs. This addresses rust-lang#114601.

I based this on rust-lang#114574, but I don't actually know how much of that PR we still need, so some code may be redundant now... 🤷

---

Fixes rust-lang#114597
Fixes rust-lang#114579
Fixes rust-lang#114285

Also fixes rust-lang#114601, since it turns out we had other bugs with RPITITs and their duplicated lifetime params 😅.

Supersedes rust-lang#114574

r? `@oli-obk`
@apiraino
Copy link
Contributor

apiraino commented Aug 8, 2023

I'll tentatively close this as duplicate of #114597 (but please reopen if preferable to keep it open)

@rustbot label -I-prioritize -E-needs-bisection

@rustbot rustbot removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Aug 8, 2023
@apiraino apiraino closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants