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

Remove duplicate E0396 tests #52527

Merged
merged 1 commit into from
Jul 21, 2018
Merged

Remove duplicate E0396 tests #52527

merged 1 commit into from
Jul 21, 2018

Conversation

ljedrz
Copy link
Contributor

@ljedrz ljedrz commented Jul 19, 2018

Resolves FIXME #13973 (erroneously marked as #13972). A test for E0396 already exists in test/ui/const-deref-ptr.rs.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 19, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (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.
[00:44:58] running 3046 tests
[00:45:07] ....................................................................................................
[00:45:17] ...............................................i....................................................
[00:45:28] ....................................................................................................
[00:45:38] ..........................................................................F.........................
[00:46:01] ....................................................................................................
[00:46:09] ....................................................................................................
[00:46:18] ....................................................................................................
[00:46:31] ....................................................................................................
---
me:end:18c95f22:start=1531992199961900793,finish=1531992199968947826,duration=7047033
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0136afef
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0b2e6ce7
travis_time:start:0b2e6ce7
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory

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)

@ljedrz
Copy link
Contributor Author

ljedrz commented Jul 19, 2018

It appears that the original test case might need to be adjusted.

[00:50:32] error[E0396]: raw pointers cannot be dereferenced in statics
[00:50:32]   --> /checkout/src/test/run-pass/const-block.rs:42:57
[00:50:32]    |
[00:50:32] 42 | static BLOCK_UNSAFE_SAFE_PTR: &'static isize = unsafe { &*(0xdeadbeef as *const isize) };
[00:50:32]    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer in constant
[00:50:32] 
[00:50:32] error[E0396]: raw pointers cannot be dereferenced in statics
[00:50:32]   --> /checkout/src/test/run-pass/const-block.rs:45:5
[00:50:32]    |
[00:50:32] 45 |     &*X
[00:50:32]    |     ^^^ dereference of raw pointer in constant
[00:50:32] 
[00:50:32] error: aborting due to 2 previous errors
[00:50:32] 
[00:50:32] For more information about this error, try `rustc --explain E0396`.

@nikomatsakis
Copy link
Contributor

r? @oli-obk

// const X: *const isize = 0xdeadbeef as *const isize;
// &*X
// };
static BLOCK_UNSAFE_SAFE_PTR: &'static isize = unsafe { &*(0xdeadbeef as *const isize) };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O_o this compiles?! This should not compile

@oli-obk
Copy link
Contributor

oli-obk commented Jul 19, 2018

Oh I should have read the rest of the PR... yea these should already have test cases in src/tests/ui/const-eval. Feel free to move them next to something that produces the same error or just remove them outright if they're essentially duplicates.

@ljedrz ljedrz changed the title Restore BLOCK_UNSAFE_SAFE_PTR tests Remove duplicate E0396 tests Jul 20, 2018
@ljedrz
Copy link
Contributor Author

ljedrz commented Jul 20, 2018

@oli-obk indeed, there already is a test for this; I updated the commit and the PR message.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 20, 2018

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 20, 2018

📌 Commit 576cfc5 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 20, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Jul 20, 2018
Remove duplicate E0396 tests

Resolves FIXME rust-lang#13973 (erroneously marked as rust-lang#13972). A test for E0396 already exists in `test/ui/const-deref-ptr.rs`.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Jul 20, 2018
Remove duplicate E0396 tests

Resolves FIXME rust-lang#13973 (erroneously marked as rust-lang#13972). A test for E0396 already exists in `test/ui/const-deref-ptr.rs`.
kennytm added a commit to kennytm/rust that referenced this pull request Jul 20, 2018
Remove duplicate E0396 tests

Resolves FIXME rust-lang#13973 (erroneously marked as rust-lang#13972). A test for E0396 already exists in `test/ui/const-deref-ptr.rs`.
bors added a commit that referenced this pull request Jul 20, 2018
Rollup of 7 pull requests

Successful merges:

 - #52502 (fix unsafety: don't call ptr_rotate for ZST)
 - #52505 (rustc: Remove a workaround in ThinLTO fixed upstream)
 - #52526 (Enable run-pass/sepcomp-lib-lto.rs on Android)
 - #52527 (Remove duplicate E0396 tests)
 - #52539 (rustc: Fix two custom attributes with custom derive)
 - #52540 (Fix docker/run.sh script when run locally)
 - #52573 (Cleanups)

Failed merges:

r? @ghost
@bors bors merged commit 576cfc5 into rust-lang:master Jul 21, 2018
@ljedrz ljedrz deleted the cleanup_13973 branch July 21, 2018 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants