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

Fix compile panic on non existent type return #53460

Merged
merged 3 commits into from
Aug 24, 2018
Merged

Fix compile panic on non existent type return #53460

merged 3 commits into from
Aug 24, 2018

Conversation

JoshBrudnak
Copy link
Contributor

Reverted the change 28a76a9#diff-4ed25c00aceb84666fca639cf8101c7cL1069 which was panicking when returning a type that cannot be found in the current scope and added testing for the compile error.

For example:

fn addition() -> Wrapper<impl A> {}

Where Wrapper is undefined in the scope.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2018
@@ -25,41 +25,43 @@
//! crate as a kind of pass. This should eventually be factored away.

use astconv::{AstConv, Bounds};
use lint;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please separate the rustfmt changes into their own commit

@JoshBrudnak JoshBrudnak reopened this Aug 19, 2018
@@ -0,0 +1,22 @@
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
Copy link
Contributor

@estebank estebank Aug 19, 2018

Choose a reason for hiding this comment

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

Can you turn this into an ui test instead? We're slowly moving away from compile-fail. For an example as to why, the span bug generated is not visible in this test because it has a DUMMY_SP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

K, will do. Thanks. 👍

@bors
Copy link
Contributor

bors commented Aug 20, 2018

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

@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:13:46] For more information about this error, try `rustc --explain E0432`.
[00:13:46] error: Could not compile `rustc_typeck`.
[00:13:46] 
[00:13:46] Caused by:
[00:13:46]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_typeck librustc_typeck/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=a0e39128708a13f4 -C extra-filename=-a0e39128708a13f4 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-b8f9e6fb5ae336d7.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-b6c566856a1e65b9.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-3a367afe0d047d15.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-8b624a6d6082b2ff.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-89eed8215142aadd.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-2e835ba951928190.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-20eb47b9c402fee3.so --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-64bbe8e4870170a3.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-3b51f50aecba154c.so -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-6c2cab36846647d7/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-3c585aa15bfc4e69/out` (exit code: 1)
[00:16:13] error: build failed
[00:16:13] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:16:13] expected success, got: exit code: 101
[00:16:13] expected success, got: exit code: 101
[00:16:13] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1119:9
[00:16:13] travis_fold:end:stage0-rustc

[00:16:13] travis_time:end:stage0-rustc:start=1534735796117685034,finish=1534736432516690504,duration=636399005470


[00:16:13] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:16:13] Build completed unsuccessfully in 0:11:32
[00:16:13] Makefile:28: recipe for target 'all' failed
[00:16:13] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:024d9670
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
21076 ./.git/modules/src/tools/cargo/objects/pack
travis_time:end:12329a7b:start=1534736432877093044,finish=1534736433271275524,duration=394182480
travis_fold:end:after_failure.1
travis_fold:start:after_failure.2
travis_| 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
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:12a236ec
$ dmesg | grep -i kill

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)

@estebank
Copy link
Contributor

@JoshBrudnak please don't use merge, use rebase for clean patches instead. Also, the merge failed due to #52953:

[00:13:40] error[E0432]: unresolved import `syntax::codemap`
[00:13:40]   --> librustc_typeck/collect.rs:46:13
[00:13:40]    |
[00:13:40] 46 | use syntax::codemap::Spanned;
[00:13:40]    |             ^^^^^^^ Could not find `codemap` in `syntax`
[00:13:40] 
[00:13:46] error: aborting due to previous error

@JoshBrudnak
Copy link
Contributor Author

Rebased to fix the merge conflict.

@estebank
Copy link
Contributor

@bors r+ p=10 (will likely cause merge conflicts due to rustfmt)

@bors
Copy link
Contributor

bors commented Aug 24, 2018

📌 Commit 264d0a2 has been approved by estebank

@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 Aug 24, 2018
@bors
Copy link
Contributor

bors commented Aug 24, 2018

⌛ Testing commit 264d0a2 with merge d41f21f...

bors added a commit that referenced this pull request Aug 24, 2018
Fix compile panic on non existent type return

Reverted the change 28a76a9#diff-4ed25c00aceb84666fca639cf8101c7cL1069 which was panicking when returning a type that cannot be found in the current scope and added testing for the compile error.

For example:
```rust
fn addition() -> Wrapper<impl A> {}
```
Where Wrapper is undefined in the scope.
@bors
Copy link
Contributor

bors commented Aug 24, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing d41f21f to master...

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