Skip to content

ignored regions constraints when normalizing user-provided types #101350

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
aliemjay opened this issue Sep 2, 2022 · 7 comments · Fixed by #101947
Closed

ignored regions constraints when normalizing user-provided types #101350

aliemjay opened this issue Sep 2, 2022 · 7 comments · Fixed by #101947
Assignees
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@aliemjay
Copy link
Member

aliemjay commented Sep 2, 2022

This compiles after full NLL (>= 1.63) but it shouldn't:

trait Trait {
    type Ty;
}

impl Trait for &'static () {
    type Ty = ();
}

fn extend<'a>() {
    None::<<&'a () as Trait>::Ty>;
}

HIR typeck unconditionally normalizes user-provided types modulo regions, so it's not NLL's fault this time :)

@rustbot label regression-from-stable-to-stable T-compiler T-types C-bug

@rustbot rustbot added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. C-bug Category: This is a bug. labels Sep 2, 2022
@apiraino
Copy link
Contributor

apiraino commented Sep 6, 2022

bisection results seems to point to #95565 (quite big pack of changes) cc @jackh726

searched nightlies: from nightly-2022-05-01 to nightly-2022-09-05
regressed nightly: nightly-2022-06-08
searched commits: from 50b0025 to 5435ed6
regressed commit: bb55bd4

bisected with cargo-bisect-rustc v0.6.0

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

cargo bisect-rustc ./script.sh --start 2022-05-01 --preserve 

@jackh726
Copy link
Member

Going to nominate this for types team. This seems pretty rough, as it's a pretty simple repro. It would be nice to have someone look at this. Not sure if its implied bounds related or something else.

@jackh726 jackh726 added the I-types-nominated Nominated for discussion during a types team meeting. label Sep 15, 2022
@lcnr
Copy link
Contributor

lcnr commented Sep 15, 2022

@rustbot claim

issue with user type annotations, going to take a look and try to fix this

@apiraino
Copy link
Contributor

apiraino commented Oct 5, 2022

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 5, 2022
@jackh726
Copy link
Member

jackh726 commented Oct 7, 2022

This is moving, unnominating.

@jackh726 jackh726 added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed I-types-nominated Nominated for discussion during a types team meeting. labels Oct 7, 2022
@aliemjay
Copy link
Member Author

aliemjay commented Oct 9, 2022

I'll have time after 2 days to finish the fix. @rustbot claim

@rustbot rustbot assigned aliemjay and unassigned lcnr Oct 9, 2022
@lcnr
Copy link
Contributor

lcnr commented Oct 21, 2022

fixing this should also close #54940.

Manishearth added a commit to Manishearth/rust that referenced this issue Nov 14, 2022
…imulacrum

Add a few known-bug tests

The labels of these tests should be changed from `S-bug-has-mcve` to `S-bug-has-test` once this is merged.

cc:
rust-lang#101518
rust-lang#99492
rust-lang#90950
rust-lang#89196
rust-lang#104034
rust-lang#101350
rust-lang#103705
rust-lang#103899

I couldn't reproduce the failures in rust-lang#101962 and rust-lang#100772 (so either these have started passing, or I didn't repro properly), so leaving those out for now.

rust-lang#102065 was a bit more complicated, since it uses `rustc_private` and I didn't want to mess with that.
@jackh726 jackh726 added S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. and removed S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Nov 14, 2022
@bors bors closed this as completed in af58fc8 Jan 9, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

5 participants