Skip to content

Combined Lifetime Bounds Cause Compiler to Crash Unexpectedly #69783

@dpchamps

Description

@dpchamps

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

Activity

alexcrichton

alexcrichton commented on Mar 6, 2020

@alexcrichton
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

jonas-schievink commented on Mar 6, 2020

@jonas-schievink
Contributor

Fixed on beta/nightly

dpchamps

dpchamps commented on Mar 6, 2020

@dpchamps
Author

Thanks all!

ehuss

ehuss commented on Mar 6, 2020

@ehuss
Contributor

Fixed PR is #67880.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ehuss@alexcrichton@jonas-schievink@dpchamps

        Issue actions

          Combined Lifetime Bounds Cause Compiler to Crash Unexpectedly · Issue #69783 · rust-lang/rust