Description
The check_in_alloc
function currently takes a InboundsCheck
for error reporting purposes. That's suboptimal for two reasons: (a) passing InboundsCheck::Live/MaybeDead
sounds like it would affect the check that is performed, but it does not; and (b) the error still doesn't actually say what we tried to do with this pointer (access memory, in-bounds arithmetic, pointer equality test, ...).
The InboundsCheck
argument should be replaced by something else, and that something else should also be put into the PointerOutOfBounds
variant of EvalErrorKind
. That could either be an &'static str
or a more informative enum. I'd probably start with the string, since it seems unlikely we will want to use this for anything but displaying errors to the user, and it seems okay to not be able to use format!
.
Cc @oli-obk
Activity
FrankSD commentedon Dec 30, 2018
Can i please take this up?I am a first timer contributor
FrankSD commentedon Dec 30, 2018
I just forked and cloned rust-lang project on my local but my local branch folder rust/src/librustc/mir/interpret/ is missing pointer.rs and allocation.rs files.The pointer.rs file does contain the check_in_alloc function.It seems i am missing something basic here....my understanding all the code in the current master are uptodate.I clone the current master branch
RalfJung commentedon Dec 30, 2018
@FrankSD sure, you can give it a try. Let's see if we can start by getting Rust to compile on your system :)
What does
git log
say is the latest commit?Also, did you maybe accidentally look into
src/librustc_mir/interpret
? Mind the_
vs/
.If you are on Linux/macOS, you can always do
find -name pointer.rs
:FrankSD commentedon Jan 1, 2019
git log last commit:
And find -name pointer.rs doesnt return anything
rank@frank-desktop ~/new-rust/rust $ find -name pointer.rs
RalfJung commentedon Jan 1, 2019
Your compiler is 4 months outdated. Try getting the latest version, it will have the files you are missing.
Maybe what happened is that you forked rustc 4 months ago, and then you cloned your fork. Forks don't get updated when the main rsutc repo moves along. You should always clone the main rustc repo, and only push to your fork for creating PRs.
FrankSD commentedon Jan 1, 2019
Thank you@RalfJung....that make sense
FrankSD commentedon Jan 2, 2019
It compiles fine and all the files i can see now....but it fails when trying to install. I have resolved most of the issues but trying to install bootstrap,did fails with :-
"
FrankSD commentedon Jan 3, 2019
I have resolved the build issue.I am starting to check the Issue
RalfJung commentedon Jan 3, 2019
Notice also that there is no reason to install your locally built Rust (I never did that, didn't even know it is possible). Why did you even want to do that?
FrankSD commentedon Jan 3, 2019
I was following the official Rust Contribution guide where it mention do
x.py build && x.py install .
RalfJung commentedon Jan 3, 2019
Could you send me the URL to that? At https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md it doesn't say anything about
x.py install
.FrankSD commentedon Jan 3, 2019
Sorry i think this was from the Readme.md https://github.com/rust-lang/rust/blob/master/README.md
28 remaining items