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

Combined Lifetime Bounds Cause Compiler to Crash Unexpectedly #69783

Closed
dpchamps opened this issue Mar 6, 2020 · 4 comments
Closed

Combined Lifetime Bounds Cause Compiler to Crash Unexpectedly #69783

dpchamps opened this issue Mar 6, 2020 · 4 comments

Comments

@dpchamps
Copy link

dpchamps commented Mar 6, 2020

Problem

A Certain combination of lifetime bounds cause compiler to exit with a non-zero status.

Appears to be reproducible only on Linux. Compiles as expected on MacOs with similar versions of rustup and cargo.

Steps

pub trait SomeTrait {}

struct SomeGeneric<T>{
    field : T
}

pub type SomeType<T: 'static + SomeTrait + ?Sized> = SomeGeneric<T>;
  1. Attempt to compile above code via cargo build

Notes

Removing any one of the above bounds results in a successful compilation, e.g:

type compiles correctly
pub type SomeType<T: 'static + SomeTrait > = SomeGeneric; ✔️
pub type SomeType<T: 'static + ?Sized> = SomeGeneric; ✔️
pub type SomeType<T: SomeTrait + ?Sized> = SomeGeneric; ✔️
pub type SomeType<T: 'static + SomeTrait + ?Sized> = SomeGeneric;

cargo 1.41.0 (626f0f40e 2019-12-03)
rustup 1.21.1 (7832b2ebe 2019-12-20)
toolchain stable-x86_64-unknown-linux-gnu
#  lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic
@alexcrichton alexcrichton transferred this issue from rust-lang/cargo Mar 6, 2020
@alexcrichton
Copy link
Member

Thanks for the report! I've transferred this issue to rust-lang/rust since I don't think this is an issue with Cargo itself.

@jonas-schievink
Copy link
Contributor

Fixed on beta/nightly

@dpchamps
Copy link
Author

dpchamps commented Mar 6, 2020

Thanks all!

@ehuss
Copy link
Contributor

ehuss commented Mar 6, 2020

Fixed PR is #67880.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants