Uh oh!
There was an error while loading. Please reload this page.
Revise lang_item demo to something unrelated to Box impl - #22499
Conversation
rust-highfive
commented
Feb 18, 2015
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
pnkfelix
commented
Feb 18, 2015
eddyb
commented
Feb 18, 2015
The diff looks best in split view mode. |
pnkfelix
commented
Feb 18, 2015
(note that I'm no longer trying to land #22181 for alpha2, so this can wait until after the release.) |
pnkfelix
commented
Feb 20, 2015
odd, why doesn't homu list @steveklabnik as being assigned to this PR ? |
pnkfelix
commented
Feb 22, 2015
@steveklabnik note that if you have more aggressive plans for this part of the documentation, and do not wish to review this change, I can take the alternative approach of simply removing the |
steveklabnik
commented
Feb 23, 2015
@pnkfelix no, this looks good. I do have other plans for these docs, but I don't mind updating in the meantime. thanks! |
steveklabnik
commented
Feb 23, 2015
…loc-and-free, r=steveklabnik Revise `lang_item` demo to something unrelated to `Box` impl Precursor for landing overloaded-`box`, since that will decouple the `box` syntax from the exchange heap (and should eliminate the use of the two aforementioned lang items). Instead, the new demonstration program shows a definition of the `panic_bounds_check` lang item. (We do not have that many procedural lang-items to choose from, which is a good sign for our efforts to decouple the compiler from the runtime!) ---- Precursor for overloaded-`box` and placement-`in`; see Issue rust-lang#22181.
Manishearth
commented
Feb 23, 2015
Needs Manishearth@a283a40 to pass doctests. I'm also getting this failure with the change in the rollup: I can't repro it on nightly, so I might take this PR out of the rollup since I'm bad at debugging llvm. Sorry :( |
pnkfelix
commented
Feb 24, 2015
@bors: r- (This is probably going to need changes along the lines that @Manishearth outlined above.) |
steveklabnik
commented
Mar 2, 2015
So, what's up with this PR? |
pnkfelix
commented
Mar 2, 2015
@steveklabnik I haven't had time to investigate it too much; the last time I looked at it, I think I had thought there might be a different lang item I could override that would not require so much surrounding infrastructure (since that was indeed one of the nice things about this example as originally composed: how short it is)! |
Manishearth
commented
Mar 3, 2015
Aside: Having a macro that brings in lang items would be interesting and might make this easier for people trying it out. Eg |
pnkfelix
commented
Mar 3, 2015
@Manishearth better still would probably be to just make |
Manishearth
commented
Mar 3, 2015
I'm not very fond of implicit "hidden behavior" with lang items myself. If someone is using lang items, they're probably writing something low level. Also, which would we pick? Eg for Rust generally tries to be explicit over implicit, I'd prefer to continue that philosophy to lang items if we have to add any sort of auto-lang-item feature. |
pnkfelix
commented
Mar 3, 2015
@Manishearth I guess I was mostly thinking of the various trait lang items (e.g. I agree that for procedural lang items, it make sense to require them. |
Manishearth
commented
Mar 3, 2015
Agreed on that. |
2b7f7f2 to
3b22ed8Comparepnkfelix
commented
Mar 3, 2015
I've rewritten the program again, so I think it needs another review. |
There was a problem hiding this comment.
Nit: Might need to be "array indexing (a[i])"?
There was a problem hiding this comment.
Yeah, this would make it consistent with evertying else
There was a problem hiding this comment.
We already talk about this all the time, so you can just say 'string slices' or &str, rather than both. I guess it doesn't hurt though.
steveklabnik
commented
Mar 3, 2015
@pnkfelix I like this example, it's a good one. One or two very minor nits, and then r=me |
…ed to Box. Precursor for landing overloaded-`box`, since that will decouple the `box` syntax from the exchange heap (and in fact will eliminate the use of the two aforementioned lang items). Instead, the new demonstration program shows a definition of the `str_eq` lang item. (We do not have that many procedural lang-items to choose from, which is a good sign for our efforts to decouple the compiler from the runtime!) (This previously used a demo of `panic_bounds_check`, but a `str_eq` demonstration is both easier to code and arguably a more interesting aspect of the language to discuss.)
3b22ed8 to
e5fab33Comparepnkfelix
commented
Mar 4, 2015
pnkfelix
commented
Mar 5, 2015
@bors r- (I think the arithmetic overflow work has introduced a dependence of |
Manishearth
commented
Mar 5, 2015
I believe you can just run -----Original Message----- @bors r- |
eddyb
commented
Mar 5, 2015
@Manishearth There should be a target for doc tests, even at stage1, but it might be one per-crate or something unmanageable. |
pnkfelix
commented
Mar 6, 2015
(closing pull request; I'm going to fold this commit in with #22086 because I actually put that through a full |
pnkfelix
commented
Jun 8, 2015
Argh, something has changed in the last three months that broke the new demo. :( In particular, when I try to compile it (playpen), I get: (Its possible that fixing this is just a matter of defining and importing the appropriate comparison traits. But if that is the case, it is ... depressing...) |
Manishearth
commented
Jun 8, 2015
Perhaps we're missing the PartialOrd &c impls? |
Precursor for landing overloaded-box, since that will decouple the box syntax from the exchange heap (and should eliminate the use of the `malloc` and `free` lang items). (This is a simplified approach to PR rust-lang#22499; note that I have once again changes which lang item to use for the illustration.)
Update generated lints
Revise
lang_itemdemo to something unrelated toBoximplPrecursor for landing overloaded-
box, since that will decouple theboxsyntax from the exchange heap (and should eliminate the use of the two aforementioned lang items).Instead, the new demonstration program shows a definition of the
panic_bounds_checklang item.(We do not have that many procedural lang-items to choose from, which is a good sign for our efforts to decouple the compiler from the runtime!)
Precursor for overloaded-
boxand placement-in; see Issue #22181.