Skip to content

When a vec/str bounds check fails, include the bad index and the length of the str/vec in the fail message. - #3629

Closed
Dretch wants to merge 1 commit into
rust-lang:incomingfrom
Dretch:boundscheckmessage
Closed

Dretch wants to merge 1 commit into
rust-lang:incomingfrom
Dretch:boundscheckmessage

Conversation

@Dretch

@Dretch Dretch commented Sep 29, 2012

Copy link
Copy Markdown
Contributor

It is useful to have this information when debugging (the existing error message does not include it).

I guess it probably slightly increases the size of the bounds-check error handling code though.

@brson

brson commented Sep 30, 2012

Copy link
Copy Markdown
Contributor

Thanks! Merged.

@brson brson closed this Sep 30, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this pull request May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Jun 9, 2024
solarish platform: add support for available-parallelism.
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
3629: Alternative aproach to plugin auto update r=matklad a=matklad

This is very much WIP (as in, I haven't run this once), but I like the result so far.

cc @Veetaha 

The primary focus here on simplification:

* local simplification of data structures and control-flow: using union of strings instead of an enum, using unwrapped GitHub API responses
* global simplification of control flow: all logic is now in `main.ts`, implemented as linear functions without abstractions. This is stateful side-effective code, so arguments from [Carmack](http://number-none.com/blow/john_carmack_on_inlined_code.html) very much apply. We need all user interractions, all mutations, and all network requests to happen in a single file. 
* as a side-effect of condensing everything to functions, we can get rid of various enums. The enums were basically a reified control flow:

```
enum E { A, B }

fn foo() -> E {
    if cond { E::A } else { E::B }
}

fn bar(e: E) {
    match e {
        E::A => do_a(),
        E::B => do_b(),
    }
}

==>>

fn all() {
    if cond { do_a() } else { do_b() }
}
```

* simplification of model: we don't need to reinstall on settings update, we can just ask the user to reload, we don't need to handle nightly=>stable fallback, we can ask the user to reinstall extension, (todo) we don't need to parse out the date from the version, we can use build id for nightly and for stable we can write the info directly into package.json.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants