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" - some static bounds incorrectly compiled in 1.63..=1.67 #112283

Closed
QuineDot opened this issue Jun 4, 2023 · 3 comments
Closed

"Regression" - some static bounds incorrectly compiled in 1.63..=1.67 #112283

QuineDot opened this issue Jun 4, 2023 · 3 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. P-low Low priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another.

Comments

@QuineDot
Copy link

QuineDot commented Jun 4, 2023

Heads-up

The example below should not compile and currently does not compile, so this is going to be low priority.

However, the example compiled for 1.63 -- 1.67 inclusive (it doesn't compile in 1.62 or in 1.68 to current).

I didn't see anything that looked relevant in the release notes, and I figure there should at least be a test somewhere, so it doesn't start compiling again.

So this issue is primarily about making sure a test exists.

Code

I tried this code:

pub trait Trait {}

pub trait Assoc<'x> {
    type A: ?Sized;
}

impl<'x> Assoc<'x> for str { type A = &'x dyn Trait; }

pub fn assoc<T: 'static>() {}
pub fn assoc_helper<'a: 'a>() {
    assoc::< <str as Assoc<'a>>::A >();
}

I expected to see this happen: Inexplicably compile like it did during some exploration months ago. (Search for "this all works" for more examples with probably irrelevant variations if you're curious.)

Instead, this happened: Failed to compile, which makes more sense.

Version it worked on

It most recently worked on: Rust 1.67, and also 1.63, 1.64, 1.65, and 1.66.

Version with regression

1.68 to present.

@QuineDot QuineDot added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Jun 4, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 4, 2023
@Jules-Bertholet
Copy link
Contributor

Jules-Bertholet commented Jun 5, 2023

@rustbot label E-needs-test regression-from-stable-to-stable -regression-untriaged

@rustbot rustbot added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-untriaged Untriaged performance or correctness regression. labels Jun 5, 2023
@compiler-errors compiler-errors added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 5, 2023
@compiler-errors
Copy link
Member

Oh right, forgot to click enter--

searched nightlies: from nightly-2023-01-01 to nightly-2023-06-01
regressed nightly: nightly-2023-01-10
searched commit range: cc47b06...3020239
regressed commit: af58fc8

bisected with cargo-bisect-rustc v0.6.6

Host triple: aarch64-apple-darwin
Reproduce with:

cargo bisect-rustc 2023-01-01 --end 2023-06-01 --regress error

@QuineDot
Copy link
Author

The tests from PR #101947 look sufficient to me, so I'm going to close this.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. P-low Low priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another.
Projects
None yet
Development

No branches or pull requests

4 participants