-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: get_unchecked resolves to unstable feature use #76479
Comments
Bisect result: #73565 searched nightlies: from nightly-2020-04-01 to nightly-2020-09-07 bisected with cargo-bisect-rustc v0.5.2Host triple: x86_64-unknown-linux-musl cargo bisect-rustc --start 2020-04-01 --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --verbose |
Thanks @lzutao! Looks like "get_unchecked is now an unstable, hidden method on Iterator" is the cause here, because it means downstream Iterator extensions cannot implement such a method (right?). This didn't cause too much breakage and it feels rare for such a method to be defined as an extension trait rather than inherently, so I'm personally fine with closing this as expected breakage. It would be good to get an MCVE to get some idea of whether I'm correct here that inherent methods would still work on downstream iterators, and if so then I'm personally fine with closing this. |
MCVE: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d334cb2f4f0a985ddf674012a928abd3 // #![feature(trusted_random_access)]
pub struct Foo {
x: usize,
y: usize
}
impl Foo {
fn get_unchecked(&self, x: usize, y: usize) -> (usize, usize) {
unimplemented!()
}
}
impl Iterator for Foo {
type Item = (usize, usize);
fn next(&mut self) -> Option<(usize, usize)> {
Some(self.get_unchecked(self.x, self.y))
}
} |
Marking this as P-critical based on the wg-prioritization discussion |
Implemented this but @matthewjasper already has a solution too, so leaving it up to them and adjusting the assignee properly. |
Reopened to track backport of #77201 |
Closing this one as #77201 was already backported. |
Unclear if this is a genuine regression or something else is going on, but seems like at least plausibly some change to resolution is involved.
The text was updated successfully, but these errors were encountered: