Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a raw "address of" operator #64588

Merged
merged 8 commits into from Dec 20, 2019
Merged

Conversation

@matthewjasper
Copy link
Contributor

matthewjasper commented Sep 18, 2019

  • Parse and feature gate &raw [const | mut] expr (feature gate name is raw_address_of)
  • Add mir::Rvalue::AddressOf
  • Use the new Rvalue for:
    • the new syntax
    • reference to pointer casts
    • drop shims for slices and arrays
  • Stop using mir::Rvalue::Cast with a reference as the operand
  • Correctly evaluate mir::Rvalue::{Ref, AddressOf} in constant propagation

cc @Centril @RalfJung @oli-obk @eddyb
cc #64490

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Sep 18, 2019

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@matthewjasper matthewjasper force-pushed the matthewjasper:mir-address-of branch from c6f4a9e to 1f210d6 Sep 18, 2019
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Sep 18, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-09-18T20:58:58.2206881Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-18T20:58:58.2384917Z ##[command]git config gc.auto 0
2019-09-18T20:58:58.2465784Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-18T20:58:58.2543303Z ##[command]git config --get-all http.proxy
2019-09-18T20:58:58.2683861Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64588/merge:refs/remotes/pull/64588/merge
---
2019-09-18T21:59:31.8557487Z .................................................................................................... 1500/9030
2019-09-18T21:59:37.6321557Z .................................................................................................... 1600/9030
2019-09-18T21:59:49.5001865Z ...................................................................i...............i................ 1700/9030
2019-09-18T21:59:56.1663037Z .................................................................................................... 1800/9030
2019-09-18T22:00:10.6050991Z ..........................................................iiiii..................................... 1900/9030
2019-09-18T22:00:21.7350141Z .................................................................................................... 2100/9030
2019-09-18T22:00:24.1806094Z .................................................................................................... 2200/9030
2019-09-18T22:00:27.3755876Z .................................................................................................... 2300/9030
2019-09-18T22:00:35.4036201Z .................................................................................................... 2400/9030
---
2019-09-18T22:03:38.2704331Z ..............................................i...............i..................................... 4700/9030
2019-09-18T22:03:49.0331077Z .................................................................................................... 4800/9030
2019-09-18T22:03:57.3522527Z .................................................................................................... 4900/9030
2019-09-18T22:04:06.8582592Z .................................................................................................... 5000/9030
2019-09-18T22:04:15.3679384Z ..............................ii.ii................................................................. 5100/9030
2019-09-18T22:04:25.7632906Z .................................................................................................... 5300/9030
2019-09-18T22:04:37.2534459Z ..............................................................................................i..... 5400/9030
2019-09-18T22:04:46.0264933Z .................................................................................................... 5500/9030
2019-09-18T22:04:51.1719657Z .................................................................................................... 5600/9030
2019-09-18T22:04:51.1719657Z .................................................................................................... 5600/9030
2019-09-18T22:05:02.4027651Z .........................................................................................ii...i..ii. 5700/9030
2019-09-18T22:05:29.6016174Z .................................................................................................... 5900/9030
2019-09-18T22:05:40.4288818Z .................................................................................................... 6000/9030
2019-09-18T22:05:40.4288818Z .................................................................................................... 6000/9030
2019-09-18T22:05:49.2800637Z ...........................................................................................i..ii.... 6100/9030
2019-09-18T22:06:19.0967741Z .................................................................................................... 6300/9030
2019-09-18T22:06:23.8216645Z ...................................................i................................................ 6400/9030
2019-09-18T22:06:26.2129941Z .................................................................................................... 6500/9030
2019-09-18T22:06:28.8756334Z .......................i............................................................................ 6600/9030
---
2019-09-18T22:10:44.9045767Z diff of stderr:
2019-09-18T22:10:44.9045982Z 
2019-09-18T22:10:44.9046470Z 8    |                                                                help: use parentheses to call this function: `std::mem::transmute(...)`
2019-09-18T22:10:44.9046927Z 9    |
2019-09-18T22:10:44.9047537Z 10    = note: expected type `unsafe extern "rust-intrinsic" fn(isize) -> usize`
2019-09-18T22:10:44.9048113Z -               found type `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}`
2019-09-18T22:10:44.9048651Z +               found type `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}`
2019-09-18T22:10:44.9048942Z 12 
2019-09-18T22:10:44.9049485Z - error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
2019-09-18T22:10:44.9051053Z + error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
2019-09-18T22:10:44.9051636Z 14   --> $DIR/reify-intrinsic.rs:11:13
2019-09-18T22:10:44.9051927Z 15    |
2019-09-18T22:10:44.9052479Z 16 LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
2019-09-18T22:10:44.9052967Z 
2019-09-18T22:10:44.9053225Z The actual stderr differed from the expected stderr.
2019-09-18T22:10:44.9053921Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic/reify-intrinsic.stderr
2019-09-18T22:10:44.9053921Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic/reify-intrinsic.stderr
2019-09-18T22:10:44.9054408Z To update references, rerun the tests and pass the `--bless` flag
2019-09-18T22:10:44.9054909Z To only update this specific test, also pass `--test-args reify-intrinsic.rs`
2019-09-18T22:10:44.9055516Z error: 1 errors occurred comparing output.
2019-09-18T22:10:44.9055736Z status: exit code: 1
2019-09-18T22:10:44.9055736Z status: exit code: 1
2019-09-18T22:10:44.9056551Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/reify-intrinsic.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic/auxiliary" "-A" "unused"
2019-09-18T22:10:44.9057270Z ------------------------------------------
2019-09-18T22:10:44.9057519Z 
2019-09-18T22:10:44.9057944Z ------------------------------------------
2019-09-18T22:10:44.9058190Z stderr:
2019-09-18T22:10:44.9058190Z stderr:
2019-09-18T22:10:44.9058578Z ------------------------------------------
2019-09-18T22:10:44.9058856Z error[E0308]: cannot coerce intrinsics to function pointers
2019-09-18T22:10:44.9059268Z   --> /checkout/src/test/ui/reify-intrinsic.rs:6:64
2019-09-18T22:10:44.9059542Z    |
2019-09-18T22:10:44.9060403Z LL |     let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
2019-09-18T22:10:44.9062669Z    |                                                                |
2019-09-18T22:10:44.9062856Z    |                                                                cannot coerce intrinsics to function pointers
2019-09-18T22:10:44.9063031Z    |                                                                help: use parentheses to call this function: `std::mem::transmute(...)`
2019-09-18T22:10:44.9063459Z    |
2019-09-18T22:10:44.9063459Z    |
2019-09-18T22:10:44.9064111Z    = note: expected type `unsafe extern "rust-intrinsic" fn(isize) -> usize`
2019-09-18T22:10:44.9064537Z               found type `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}`
2019-09-18T22:10:44.9064695Z 
2019-09-18T22:10:44.9065102Z error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
2019-09-18T22:10:44.9065670Z    |
2019-09-18T22:10:44.9065670Z    |
2019-09-18T22:10:44.9066162Z LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
2019-09-18T22:10:44.9066532Z 
2019-09-18T22:10:44.9066665Z error: aborting due to 2 previous errors
2019-09-18T22:10:44.9066814Z 
2019-09-18T22:10:44.9066951Z Some errors have detailed explanations: E0308, E0606.
---
2019-09-18T22:10:44.9092676Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
2019-09-18T22:10:44.9093021Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-09-18T22:10:44.9111310Z 
2019-09-18T22:10:44.9111615Z 
2019-09-18T22:10:44.9116596Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-09-18T22:10:44.9117563Z 
2019-09-18T22:10:44.9117870Z 
2019-09-18T22:10:44.9121218Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-18T22:10:44.9122204Z Build completed unsuccessfully in 1:04:41
2019-09-18T22:10:44.9122204Z Build completed unsuccessfully in 1:04:41
2019-09-18T22:10:44.9177694Z == clock drift check ==
2019-09-18T22:10:44.9200908Z   local time: Wed Sep 18 22:10:44 UTC 2019
2019-09-18T22:10:45.0738430Z   network time: Wed, 18 Sep 2019 22:10:45 GMT
2019-09-18T22:10:45.0739498Z == end clock drift check ==
2019-09-18T22:10:46.0054231Z ##[error]Bash exited with code '1'.
2019-09-18T22:10:46.0127749Z ##[section]Starting: Checkout
2019-09-18T22:10:46.0129596Z ==============================================================================
2019-09-18T22:10:46.0129809Z Task         : Get sources
2019-09-18T22:10:46.0129851Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
src/librustc/mir/visit.rs Outdated Show resolved Hide resolved
_ => None,
};

if let Some((ctx, place)) = borrow_ctx {

This comment has been minimized.

Copy link
@Centril

Centril Sep 18, 2019

Member

cc @ecstatic-morse @oli-obk re. the qualification code.

This comment has been minimized.

Copy link
@oli-obk

oli-obk Oct 10, 2019

Contributor

Yea I think none of it should be changed and we should just treat raw borrows as unpromotable (because any potentially promotable things had to error out before)

src/librustc_mir/hair/mod.rs Show resolved Hide resolved
src/librustc_mir/borrow_check/mod.rs Show resolved Hide resolved
src/librustc_codegen_ssa/mir/rvalue.rs Show resolved Hide resolved
@Centril

This comment was marked as outdated.

Copy link
Member

Centril commented Sep 18, 2019

r? @RalfJung (Take your time.)

@rust-highfive rust-highfive assigned RalfJung and unassigned cramertj Sep 18, 2019
@Centril

This comment has been minimized.

Copy link
Member

Centril commented Sep 18, 2019

Thanks for the PR. I've made an initial review above ^--- (but Ralf should also review this).

Some more remarks on the PR description:

  • Use the new Rvalue for:

    • reference to pointer casts

This is not part of the RFC and should remain UB.

  • drop shims for slices and arrays

Can you elaborate on this please? Is this a spec change or just internal refactoring?

  • Stop using mir::Rvalue::Cast with a reference as the operand

Seems like the same as &x as *const _ using Rvalue::AddrOf (i.e. not part of the RFC).


Can you please also extend the unused_parens lint to handle &raw [const|mut] $place_expr?

@ecstatic-morse

This comment has been minimized.

Copy link
Contributor

ecstatic-morse commented Sep 19, 2019

@matthewjasper You need to handle Rvalue::AddressOf(_, _) here and here as well. This is the part of the code that forbids taking &mut references in const bodies. We need to forbid anything that allows mutation through indirection, since that can cause an Option<NeedsDropType> to go from None to Some.

@matthewjasper

This comment has been minimized.

Copy link
Contributor Author

matthewjasper commented Sep 19, 2019

This is not part of the RFC and should remain UB.

What should be UB? &x as *const _ still is and x as *const _ could never cause UB.

Can you elaborate on this please? Is this a spec change or just internal refactoring?

It's a refactoring. If the precise stacked borrows effects of slice/array drop shims is defined, then maybe it's a change, but not a very big one since the parameter is a mutable reference, and the calls to drop the elements create mutable references.

Can you please also extend the unused_parens lint to handle &raw [const|mut] $place_expr?

This can be a follow up. The (lack of) behavior here is consistent with & AFAICT.

@Centril

This comment has been minimized.

Copy link
Member

Centril commented Sep 19, 2019

What should be UB? &x as *const _ still is and x as *const _ could never cause UB.

Oh I see; seems I misread. Can you add a mir-opt test to that effect?

This can be a follow up. The (lack of) behavior here is consistent with & AFAICT.

Sure, can you add a ticket to the tracking issue when this PR is merged?

@matthewjasper

This comment was marked as outdated.

Copy link
Contributor Author

matthewjasper commented Sep 19, 2019

CI failure is fixed by #64623

@Centril

This comment was marked as resolved.

Copy link
Member

Centril commented Sep 19, 2019

Btw, if you use raw_address_of as the gate, please also change the label. :)

@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Sep 21, 2019

☔️ The latest upstream changes (presumably #64658) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon

This comment was marked as outdated.

Copy link
Member

JohnCSimon commented Sep 28, 2019

Ping from triage:
@matthewjasper Can you please address the merge conflicts?
Thank you!

@ecstatic-morse

This comment has been minimized.

Copy link
Contributor

ecstatic-morse commented Sep 29, 2019

@matthewjasper @RalfJung Some tests need to be added to ensure that &raw mut is forbidden in const contexts. Also, there's now two validation passes (one uses dataflow to support #49146) that are checked against one another for compatibility. Once &raw mut references are handled, I'm happy to port the changes to the new validator in librustc_mir/transform/check_consts/validation.rs.

@matthewjasper

This comment was marked as outdated.

Copy link
Contributor Author

matthewjasper commented Sep 30, 2019

Making as blocked until #64623 and #64910 #65043 is merged

Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
tmandry added a commit to tmandry/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
tmandry added a commit to tmandry/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
@matthewjasper matthewjasper force-pushed the matthewjasper:mir-address-of branch from f9f85b1 to a749116 Dec 18, 2019
@matthewjasper

This comment has been minimized.

Copy link
Contributor Author

matthewjasper commented Dec 19, 2019

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 19, 2019

📌 Commit a749116 has been approved by oli-obk

@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Dec 19, 2019

⌛️ Testing commit a749116 with merge b583c5b...

bors added a commit that referenced this pull request Dec 19, 2019
Add a raw "address of" operator

* Parse and feature gate `&raw [const | mut] expr` (feature gate name is `raw_address_of`)
* Add `mir::Rvalue::AddressOf`
* Use the new `Rvalue` for:
    * the new syntax
    * reference to pointer casts
    * drop shims for slices and arrays
* Stop using `mir::Rvalue::Cast` with a reference as the operand
* Correctly evaluate `mir::Rvalue::{Ref, AddressOf}` in constant propagation

cc @Centril @RalfJung @oli-obk @eddyb
cc #64490
@Centril

This comment was marked as outdated.

Copy link
Member

Centril commented Dec 19, 2019

Infra problems... #67426 (comment), @bors retry

Centril added a commit to Centril/rust that referenced this pull request Dec 20, 2019
…-obk

Add a raw "address of" operator

* Parse and feature gate `&raw [const | mut] expr` (feature gate name is `raw_address_of`)
* Add `mir::Rvalue::AddressOf`
* Use the new `Rvalue` for:
    * the new syntax
    * reference to pointer casts
    * drop shims for slices and arrays
* Stop using `mir::Rvalue::Cast` with a reference as the operand
* Correctly evaluate `mir::Rvalue::{Ref, AddressOf}` in constant propagation

cc @Centril @RalfJung @oli-obk @eddyb
cc rust-lang#64490
bors added a commit that referenced this pull request Dec 20, 2019
Rollup of 6 pull requests

Successful merges:

 - #64588 (Add a raw "address of" operator)
 - #67031 (Update tokio crates to latest versions)
 - #67334 (Teach `compiletest` to ignore platform triples)
 - #67354 (Fix pointing at arg when cause is outside of call)
 - #67363 (Fix handling of wasm import modules and names)
 - #67410 (Reenable static linking of libstdc++ on windows-gnu)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Dec 20, 2019
…-obk

Add a raw "address of" operator

* Parse and feature gate `&raw [const | mut] expr` (feature gate name is `raw_address_of`)
* Add `mir::Rvalue::AddressOf`
* Use the new `Rvalue` for:
    * the new syntax
    * reference to pointer casts
    * drop shims for slices and arrays
* Stop using `mir::Rvalue::Cast` with a reference as the operand
* Correctly evaluate `mir::Rvalue::{Ref, AddressOf}` in constant propagation

cc @Centril @RalfJung @oli-obk @eddyb
cc rust-lang#64490
bors added a commit that referenced this pull request Dec 20, 2019
Rollup of 5 pull requests

Successful merges:

 - #64588 (Add a raw "address of" operator)
 - #67031 (Update tokio crates to latest versions)
 - #67131 (Merge `TraitItem` & `ImplItem into `AssocItem`)
 - #67354 (Fix pointing at arg when cause is outside of call)
 - #67363 (Fix handling of wasm import modules and names)

Failed merges:

r? @ghost
@bors

This comment was marked as spam.

Copy link
Contributor

bors commented Dec 20, 2019

☔️ The latest upstream changes (presumably #67455) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors merged commit a749116 into rust-lang:master Dec 20, 2019
4 of 5 checks passed
4 of 5 checks passed
homu Testing commit a74911662e8de2c024ea188e4dcac6a494c74455 with merge b583c5b82a464c87c403807cdacd173daf65d5e3...
Details
pr Build #20191218.44 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@matthewjasper matthewjasper deleted the matthewjasper:mir-address-of branch Dec 20, 2019
@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Dec 21, 2019

This is awesome, thanks so much. :)

// Retag-as-raw after escaping to a raw pointer.
StatementKind::Assign(box (ref place, Rvalue::AddressOf(..))) => {
(RetagKind::Raw, place.clone())
}
Comment on lines +139 to 142

This comment has been minimized.

Copy link
@RalfJung

RalfJung Dec 21, 2019

Member

So this is doing that for all &raw now, right? Certainly a reasonable start, though it doesn't seem to be entirely equivalent to the previous operation which also made sure that the "input" is a reference.

This comment has been minimized.

Copy link
@matthewjasper

matthewjasper Dec 21, 2019

Author Contributor

There wasn't any way to write &raw const *x where x is a raw pointer before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.