René's URL Explorer Experiment


Title: Lifetime troubles · Issue #1341 · rust-ndarray/ndarray · GitHub

Open Graph Title: Lifetime troubles · Issue #1341 · rust-ndarray/ndarray

X Title: Lifetime troubles · Issue #1341 · rust-ndarray/ndarray

Description: Hi! I've been stuck on an issue for a while and can't figure out what's causing it. Not sure if there's an issue in ndarray, Rust or if I'm just missing something. Playground I'm trying to create a struct containing a list of arrays, whe...

Open Graph Description: Hi! I've been stuck on an issue for a while and can't figure out what's causing it. Not sure if there's an issue in ndarray, Rust or if I'm just missing something. Playground I'm trying to create a...

X Description: Hi! I've been stuck on an issue for a while and can't figure out what's causing it. Not sure if there's an issue in ndarray, Rust or if I'm just missing something. Playground I&...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lifetime troubles","articleBody":"Hi! I've been stuck on an issue for a while and can't figure out what's causing it. Not sure if there's an issue in ndarray, Rust or if I'm just missing something.\r\n\r\n[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d18ceea0daf456711b5354e9fe294b96)\r\n\r\nI'm trying to create a struct containing a list of arrays, where the array elements are string slices:\r\n\r\n```rust\r\nstruct ListOfArrays\u003c'a, D: ndarray::Dimension> {\r\n    data: &'a [ndarray::Array\u003c&'a str, D>],\r\n}\r\n\r\nfn does_not_work() {\r\n    let arrays = [ndarray::array![\"\"]];\r\n    let list = ListOfArrays { data: &arrays };\r\n}\r\n// Error: `arrays` does not live long enough\r\n// borrowed value does not live long enough. \r\n// `arrays` dropped here while still borrowed\r\n```\r\n\r\nThing is, this same thing is totally doable with other Rust structs, for example if we replace ndarray with Vec:\r\n\r\n```rust\r\nstruct ListOfArraysVec\u003c'a> {\r\n    data: &'a [Vec\u003c&'a str>],\r\n}\r\n\r\nfn works() {\r\n    let arrays = [vec![\"\"]];\r\n    let list = ListOfArrays { data: &arrays };\r\n}\r\n// Compiles!\r\n```\r\n\r\nI don't understand why this happens with ndarray, and I haven't been successful in recreating the issue with any struct other than ndarray, so that is why I'm posting here. Any guidance would be much appreciated!","author":{"url":"https://github.com/ViktorWb","@type":"Person","name":"ViktorWb"},"datePublished":"2023-12-12T23:12:27Z","url":"https://github.com/rust-ndarray/ndarray/issues/1341"}

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:31f0ed79-fc74-0178-06d3-5d75783a35f2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC47C:7D71:1A9AA1:247569:6AFD5F36
html-safe-nonce28a639bf063900a7fe70629c686a7846a61e6e428004c6028ff04c252eaf3dba
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDdDOjdENzE6MUE5QUExOjI0NzU2OTo2QUZENUYzNiIsInZpc2l0b3JfaWQiOiIyNjM3ODM2MTY2MTQ5MDA1MTEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd104b1579d70abb864a522076f5bf9eb4dcf5cfb939b9d22ecfcdbe02a850dd7
hovercard-subject-tagissue:2038686453
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/1341/issue_layout
twitter:imagehttps://opengraph.githubassets.com/74e7ebf9cb8d0c2d0459dcb4f72c7d3ef7c1553206f22d5f8a35ff96a2d080f1/rust-ndarray/ndarray/issues/1341
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/74e7ebf9cb8d0c2d0459dcb4f72c7d3ef7c1553206f22d5f8a35ff96a2d080f1/rust-ndarray/ndarray/issues/1341
og:image:altHi! I've been stuck on an issue for a while and can't figure out what's causing it. Not sure if there's an issue in ndarray, Rust or if I'm just missing something. Playground I'm trying to create a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameViktorWb
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
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
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/rust-ndarray/ndarray/issues/1341#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Frust-ndarray%2Fndarray%2Fissues%2F1341
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%2F1341
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/1341
Reloadhttps://github.com/rust-ndarray/ndarray/issues/1341
Reloadhttps://github.com/rust-ndarray/ndarray/issues/1341
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/1341
New issuehttps://github.com/login?return_to=https://github.com/rust-ndarray/ndarray/issues/1341
Lifetime troubleshttps://github.com/rust-ndarray/ndarray/issues/1341#top
https://github.com/ViktorWb
ViktorWbhttps://github.com/ViktorWb
on Dec 12, 2023https://github.com/rust-ndarray/ndarray/issues/1341#issue-2038686453
Playgroundhttps://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d18ceea0daf456711b5354e9fe294b96
https://github.com/cavenditti-quaternion
cavenditti-quaternionhttps://github.com/cavenditti-quaternion
on Dec 13, 2023https://github.com/rust-ndarray/ndarray/issues/1341#issuecomment-1854422270
here in data_repr.rshttps://github.com/rust-ndarray/ndarray/blob/fa57078a3fee50b8eb57a4a0cbf41f407863e2cb/src/data_repr.rs#L157
https://github.com/adamreichold
adamreicholdhttps://github.com/adamreichold
on Dec 13, 2023https://github.com/rust-ndarray/ndarray/issues/1341#issuecomment-1854443504
https://doc.rust-lang.org/nomicon/dropck.htmlhttps://doc.rust-lang.org/nomicon/dropck.html
rust-lang/rust#34761https://github.com/rust-lang/rust/issues/34761
https://doc.rust-lang.org/stable/src/alloc/vec/mod.rs.html#395https://doc.rust-lang.org/stable/src/alloc/vec/mod.rs.html#395
https://github.com/ViktorWb
ViktorWbhttps://github.com/ViktorWb
on Dec 13, 2023https://github.com/rust-ndarray/ndarray/issues/1341#issuecomment-1854470662
ViktorWbhttps://github.com/ViktorWb
completedhttps://github.com/rust-ndarray/ndarray/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 13, 2023https://github.com/rust-ndarray/ndarray/issues/1341#event-11239224266
Sign up for freehttps://github.com/signup?return_to=https://github.com/rust-ndarray/ndarray/issues/1341
Sign in to commenthttps://github.com/login?return_to=https://github.com/rust-ndarray/ndarray/issues/1341
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.