Skip to content

1.99 beta crater regression: type annotations needed #162109

Description

@cyrgani

log: https://crater-reports.s3.amazonaws.com/beta-1.99-5/1.99.0-beta.1/reg/lazy_transducer-0.2.1/log.txt

partial reduction:

use std::marker::PhantomData;
use std::mem::transmute;

fn main() {
    let bytes: Vec<u8> = vec![1u8, 0, 2, 0, 3, 0, 4, 0];
    let lt: LazyTransducer<_, &u16> =
        LazyTransducer::new(&bytes, |input| unsafe { transmute::<_, &u16>(&input[0]) });
}

struct LazyTransducer<'a, Input, Output>
where
    Input: 'a + Copy,
    Output: 'a,
{
    contents: Input,
    transducer: fn(Input) -> Output,
    _marker: PhantomData<&'a Output>,
}

impl<'a, Input, Output> LazyTransducer<'a, Input, Output>
where
    Input: 'a + Copy,
    Output: 'a,
{
    fn new(contents: Input, transducer: fn(Input) -> Output) -> Self {
        LazyTransducer {
            contents,
            transducer,
            _marker: PhantomData::default(),
        }
    }
}

possibly a duplicate of #161913?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-typesRelevant to the types team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions