René's URL Explorer Experiment


Title: `ArrayView` should be covariant over lifetime · Issue #1332 · rust-ndarray/ndarray · GitHub

Open Graph Title: `ArrayView` should be covariant over lifetime · Issue #1332 · rust-ndarray/ndarray

X Title: `ArrayView` should be covariant over lifetime · Issue #1332 · rust-ndarray/ndarray

Description: Take a look at the following example: fn reference_covariant<'a>(x: &'static f64) -> &'a f64 { x } fn arrayview_covariant<'a>(x: ArrayView1<'static, f64>) -> ArrayView1<'a, f64> { x } The first compiles fine, the second one does not comp...

Open Graph Description: Take a look at the following example: fn reference_covariant<'a>(x: &'static f64) -> &'a f64 { x } fn arrayview_covariant<'a>(x: ArrayView1<'static, f64>) -> ArrayView1<'a, f64> { x } The first com...

X Description: Take a look at the following example: fn reference_covariant<'a>(x: &'static f64) -> &'a f64 { x } fn arrayview_covariant<'a>(x: ArrayView1<'static, f6...

Opengraph URL: https://github.com/rust-ndarray/ndarray/issues/1332

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ArrayView` should be covariant over lifetime","articleBody":"Take a look at the following example:\r\n```rust\r\nfn reference_covariant\u003c'a>(x: &'static f64) -> &'a f64 {\r\n    x\r\n}\r\n\r\nfn arrayview_covariant\u003c'a>(x: ArrayView1\u003c'static, f64>) -> ArrayView1\u003c'a, f64> {\r\n    x\r\n}\r\n```\r\n\r\nThe first compiles fine, the second one does not compile and give the following error message:\r\n```\r\nfn arrayview_covariant\u003c'a>(x: ArrayView1\u003c'static, f64>) -> ArrayView1\u003c'a, f64> {\r\n                       -- lifetime `'a` defined here\r\n   x\r\n   ^ returning this value requires that `'a` must outlive `'static`\r\n\r\nnote: requirement occurs because of the type `ArrayBase\u003cViewRepr\u003c&f64>, Dim\u003c[usize; 1]>>`, which makes the generic argument `ViewRepr\u003c&f64>` invariant\r\nnote: the struct `ArrayBase\u003cS, D>` is invariant over the parameter `S`\r\n```\r\n\r\nThe problem is caused by the usage of `S::Elem` inside the definition of `ArrayBase`.\r\n\r\nI stumbled across this problem, since I used `ArrayView` deep inside a data structure which should be covariant.\r\nAs a user of ndarray I would assume that `ArrayView`s behave the same as Rust references, but I see fixing this bug is hard without interface changes.\r\nIs there an easy work-around for such problems? I currently do not know of any...","author":{"url":"https://github.com/patengel","@type":"Person","name":"patengel"},"datePublished":"2023-10-05T14:09:49Z","url":"https://github.com/rust-ndarray/ndarray/issues/1332"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:afbd6bff-100b-e983-a69d-b4be4e5b1139
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9618:2AABF1:252A0AC:340E09D:6AFD453D
html-safe-nonce18e6d4384b0146f896ac1312736cbe8441b254d6bbf0f48c550bf26651d1b917
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjE4OjJBQUJGMToyNTJBMEFDOjM0MEUwOUQ6NkFGRDQ1M0QiLCJ2aXNpdG9yX2lkIjoiNjQ0NDAzMzI3NjE3MTMzOTA3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac53b2f47c6a04a1128474199a00f3131a4feabaff63dd6c8402edc195a47c274d
hovercard-subject-tagissue:1928394153
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rust-ndarray/ndarray/1332/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7640aae97e55b72d31cc037ac271d48b2b813d6c319e10e9ab7798b6360787b2/rust-ndarray/ndarray/issues/1332
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7640aae97e55b72d31cc037ac271d48b2b813d6c319e10e9ab7798b6360787b2/rust-ndarray/ndarray/issues/1332
og:image:altTake a look at the following example: fn reference_covariant<'a>(x: &'static f64) -> &'a f64 { x } fn arrayview_covariant<'a>(x: ArrayView1<'static, f64>) -> ArrayView1<'a, f64> { x } The first com...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepatengel
hostnamegithub.com
expected-hostnamegithub.com
Nonebdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474
turbo-cache-controlno-preview
go-importgithub.com/rust-ndarray/ndarray git https://github.com/rust-ndarray/ndarray.git
octolytics-dimension-user_id44419403
octolytics-dimension-user_loginrust-ndarray
octolytics-dimension-repository_id22598813
octolytics-dimension-repository_nworust-ndarray/ndarray
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id22598813
octolytics-dimension-repository_network_root_nworust-ndarray/ndarray
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release556dd37bb0aceffb25724e151b5d858b3265b40b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/rust-ndarray/ndarray/issues/1332#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Frust-ndarray%2Fndarray%2Fissues%2F1332
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Frust-ndarray%2Fndarray%2Fissues%2F1332
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=rust-ndarray%2Fndarray
Reloadhttps://github.com/rust-ndarray/ndarray/issues/1332
Reloadhttps://github.com/rust-ndarray/ndarray/issues/1332
Reloadhttps://github.com/rust-ndarray/ndarray/issues/1332
rust-ndarrayhttps://github.com/rust-ndarray
ndarrayhttps://github.com/rust-ndarray/ndarray
Codehttps://github.com/rust-ndarray/ndarray
Issues175 (175)https://github.com/rust-ndarray/ndarray/issues
Pull requests41 (41)https://github.com/rust-ndarray/ndarray/pulls
Discussionshttps://github.com/rust-ndarray/ndarray/discussions
Actionshttps://github.com/rust-ndarray/ndarray/actions
Projectshttps://github.com/rust-ndarray/ndarray/projects
Wikihttps://github.com/rust-ndarray/ndarray/wiki
Security and qualityhttps://github.com/rust-ndarray/ndarray/security
Insightshttps://github.com/rust-ndarray/ndarray/insights
https://github.com/rust-ndarray/ndarray
New issuehttps://github.com/login?return_to=https://github.com/rust-ndarray/ndarray/issues/1332
New issuehttps://github.com/login?return_to=https://github.com/rust-ndarray/ndarray/issues/1332
#1480https://github.com/rust-ndarray/ndarray/pull/1480
ArrayView should be covariant over lifetimehttps://github.com/rust-ndarray/ndarray/issues/1332#top
#1480https://github.com/rust-ndarray/ndarray/pull/1480
enhancementhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22enhancement%22
help wantedhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/patengel
patengelhttps://github.com/patengel
on Oct 5, 2023https://github.com/rust-ndarray/ndarray/issues/1332#issue-1928394153
nilgoyettehttps://github.com/nilgoyette
enhancementhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22enhancement%22
questionhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22question%22
on Oct 5, 2023https://github.com/rust-ndarray/ndarray/issues/1332#event-10564614449
https://github.com/bluss
blusshttps://github.com/bluss
on Oct 6, 2023https://github.com/rust-ndarray/ndarray/issues/1332#issuecomment-1750806838
https://docs.rs/ndarray/latest/ndarray/type.ArrayView.html#method.reborrowhttps://docs.rs/ndarray/latest/ndarray/type.ArrayView.html#method.reborrow
https://github.com/patengel
patengelhttps://github.com/patengel
on Oct 9, 2023https://github.com/rust-ndarray/ndarray/issues/1332#issuecomment-1752346551
https://github.com/0xbe7a
0xbe7ahttps://github.com/0xbe7a
on Jan 17, 2024https://github.com/rust-ndarray/ndarray/issues/1332#issuecomment-1896509733
#1341https://github.com/rust-ndarray/ndarray/issues/1341
blusshttps://github.com/bluss
help wantedhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
questionhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22question%22
on Mar 9, 2024https://github.com/rust-ndarray/ndarray/issues/1332#event-12062737541
https://github.com/bluss
blusshttps://github.com/bluss
on Mar 9, 2024https://github.com/rust-ndarray/ndarray/issues/1332#issuecomment-1986798578
#879https://github.com/rust-ndarray/ndarray/issues/879
https://github.com/akern40
akern40https://github.com/akern40
on Feb 9, 2025https://github.com/rust-ndarray/ndarray/issues/1332#issuecomment-2646078962
rust-lang/rust#115799https://github.com/rust-lang/rust/issues/115799
rust-lang/rust#57440https://github.com/rust-lang/rust/issues/57440
#1440https://github.com/rust-ndarray/ndarray/pull/1440
https://github.com/patengel
patengelhttps://github.com/patengel
on Feb 10, 2025https://github.com/rust-ndarray/ndarray/issues/1332#issuecomment-2647095163
akern40https://github.com/akern40
completedhttps://github.com/rust-ndarray/ndarray/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#1480https://github.com/rust-ndarray/ndarray/pull/1480
on Mar 1, 2025https://github.com/rust-ndarray/ndarray/issues/1332#event-16519337379
Sign up for freehttps://github.com/signup?return_to=https://github.com/rust-ndarray/ndarray/issues/1332
Sign in to commenthttps://github.com/login?return_to=https://github.com/rust-ndarray/ndarray/issues/1332
enhancementhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22enhancement%22
help wantedhttps://github.com/rust-ndarray/ndarray/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.