{"action":"created","issue":{"url":"https://api.github.com/repos/Robbepop/cionc/issues/7","repository_url":"https://api.github.com/repos/Robbepop/cionc","labels_url":"https://api.github.com/repos/Robbepop/cionc/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Robbepop/cionc/issues/7/comments","events_url":"https://api.github.com/repos/Robbepop/cionc/issues/7/events","html_url":"https://github.com/Robbepop/cionc/issues/7","id":136824958,"number":7,"title":"StringTable: iterator invalidation is impossible","user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-26T21:55:34Z","updated_at":"2016-02-27T00:26:56Z","closed_at":null,"body":">     /* I use Box<String> because of possible iterator invalidation\r\n>       in case the Vec is growing in size and reallocating memory. */\r\n\r\nRust prevents iterator invalidation at compile-time, so this should never happen. Also, I'm not sure how a Box would solve it.\r\n\r\nThis indirection shouldn't be needed at all. I could send a patch, but was curious to hear more about why you wrote this comment :smile: "},"comment":{"url":"https://api.github.com/repos/Robbepop/cionc/issues/comments/189537550","html_url":"https://github.com/Robbepop/cionc/issues/7#issuecomment-189537550","issue_url":"https://api.github.com/repos/Robbepop/cionc/issues/7","id":189537550,"user":{"login":"Robbepop","id":8193155,"avatar_url":"https://avatars.githubusercontent.com/u/8193155?v=3","gravatar_id":"","url":"https://api.github.com/users/Robbepop","html_url":"https://github.com/Robbepop","followers_url":"https://api.github.com/users/Robbepop/followers","following_url":"https://api.github.com/users/Robbepop/following{/other_user}","gists_url":"https://api.github.com/users/Robbepop/gists{/gist_id}","starred_url":"https://api.github.com/users/Robbepop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Robbepop/subscriptions","organizations_url":"https://api.github.com/users/Robbepop/orgs","repos_url":"https://api.github.com/users/Robbepop/repos","events_url":"https://api.github.com/users/Robbepop/events{/privacy}","received_events_url":"https://api.github.com/users/Robbepop/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T00:26:56Z","updated_at":"2016-02-27T00:26:56Z","body":"That's turning into a problem for me as far as I can imagine.\r\nAt least it makes it hard to insert new entries to my StringCache once the first String is inserted into it and stored as a reference.\r\nThe problem is that the Lexer outputs Tokens that can themselves store a &str which is just a reference to a String stored in the StringCache that owns those Strings.\r\nI planned that it is possible to add new Strings to the StringCache with the `get_or_insert(s: String) -> &str` method, however, once the Tokens store the returned reference the StringCache couldn't add any new Strings to it which is bad ... :/"}}