Skip to main content
Homepage
Explore
Search or go to…
/
Register
Sign in
Explore
Primary navigation
Project
S
seer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Nils Fitinghoff
seer
Commits
16ac4266
Commit
16ac4266
authored
Aug 19, 2017
by
David Renshaw
Browse files
Options
Downloads
Patches
Plain Diff
pull in fix for miri issue 304
parent
97bfd9b9
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/eval_context.rs
+4
-0
4 additions, 0 deletions
src/eval_context.rs
tests/run-pass/closure-field-ty.rs
+10
-0
10 additions, 0 deletions
tests/run-pass/closure-field-ty.rs
with
14 additions
and
0 deletions
src/eval_context.rs
+
4
−
0
View file @
16ac4266
...
...
@@ -836,6 +836,10 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
ty
::
TyRef
(
_
,
ref
tam
)
|
ty
::
TyRawPtr
(
ref
tam
)
=>
self
.get_fat_field
(
tam
.ty
,
field_index
),
ty
::
TyClosure
(
def_id
,
ref
closure_substs
)
=>
Ok
(
closure_substs
.upvar_tys
(
def_id
,
self
.tcx
)
.nth
(
field_index
)
.unwrap
()),
_
=>
Err
(
EvalError
::
Unimplemented
(
format!
(
"can't handle type: {:?}, {:?}"
,
ty
,
ty
.sty
))),
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
tests/run-pass/closure-field-ty.rs
0 → 100644
+
10
−
0
View file @
16ac4266
// miri issue #304
fn
main
()
{
let
mut
y
=
0
;
{
let
mut
box_maybe_closure
=
Box
::
new
(
None
);
*
box_maybe_closure
=
Some
(||
{
y
+=
1
;
});
(
box_maybe_closure
.unwrap
())();
}
assert_eq!
(
y
,
1
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment