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

resolve: Avoid emitting an unhelpful cascading resolution error #35145

Merged
merged 4 commits into from
Aug 2, 2016

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Jul 31, 2016

Fixes #35142.

@arielb1
Copy link
Contributor

arielb1 commented Jul 31, 2016

r+ with a match instead of an if-then-else.

@@ -1810,6 +1810,8 @@ impl<'a> Resolver<'a> {
if let Def::Trait(_) = path_res.base_def {
debug!("(resolving trait) found trait def: {:?}", path_res);
Ok(path_res)
} else if path_res.base_def == Def::Err {
Copy link
Contributor

@arielb1 arielb1 Jul 31, 2016

Choose a reason for hiding this comment

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

nit: use a match, or at least if-let-chain.

@eddyb
Copy link
Member

eddyb commented Jul 31, 2016

r? @arielb1

@rust-highfive rust-highfive assigned arielb1 and unassigned eddyb Jul 31, 2016
@arielb1
Copy link
Contributor

arielb1 commented Jul 31, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2016

📌 Commit 93fd214 has been approved by arielb1

@arielb1
Copy link
Contributor

arielb1 commented Jul 31, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2016

📌 Commit d6b10be has been approved by arielb1

@bors
Copy link
Contributor

bors commented Aug 1, 2016

⌛ Testing commit d6b10be with merge 6316c0c...

@bors
Copy link
Contributor

bors commented Aug 1, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@arielb1
Copy link
Contributor

arielb1 commented Aug 1, 2016

actual failure

command: PATH="C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\stage2\bin;C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\stage2-tools\i686-pc-windows-gnu\release\deps;C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\stage2-rustc\i686-pc-windows-gnu\release\deps;C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\stage2-test\i686-pc-windows-gnu\release\deps;C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\stage2-std\i686-pc-windows-gnu\release\deps;C:\mingw-w64\i686-4.9.1-win32-dwarf-rt_v3-rev1\mingw32\bin;C:\Python27;C:\msys64\mingw32\bin;C:\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\msys64\usr\bin;C:\python27;C:\python27\scripts;C:\program files (x86)\inno setup 5;C:\program files (x86)\CMake\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\CMake\bin" C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\stage2\bin\rustc.exe C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\src/test\ui\codemap_tests\two_files.rs -L C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\test\ui --target=i686-pc-windows-gnu -L C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\test\ui\codemap_tests\two_files.stage2-i686-pc-windows-gnu.ui.libaux -C prefer-dynamic -o C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\test\ui\codemap_tests\two_files.stage2-i686-pc-windows-gnu.exe -Crpath -O -Lnative=C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\obj\build\i686-pc-windows-gnu\rust-test-helpers
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0404]: `Bar` is not a trait
  --> C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\src/test\ui\codemap_tests\two_files.rs:16:6
   |
16 | impl Bar for Baz { }
   |      ^^^
   |
   = note: type aliases cannot be used for traits

error: cannot continue compilation due to previous error


------------------------------------------

thread '[ui] ui\codemap_tests\two_files.rs' panicked at 'explicit panic', C:\bot\slave\auto-win-gnu-32-opt-rustbuild\build\src\tools\compiletest\src\runtest.rs:2353
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    [ui] ui\codemap_tests\two_files.rs

test result: FAILED. 10 passed; 1 failed; 1 ignored; 0 measured

@jseyfried
Copy link
Contributor Author

@bors r=arielb1

@bors
Copy link
Contributor

bors commented Aug 1, 2016

📌 Commit 6656a30 has been approved by arielb1

@bors
Copy link
Contributor

bors commented Aug 2, 2016

⌛ Testing commit 6656a30 with merge 32e462e...

bors added a commit that referenced this pull request Aug 2, 2016
resolve: Avoid emitting an unhelpful cascading resolution error

Fixes #35142.
@bors bors merged commit 6656a30 into rust-lang:master Aug 2, 2016
@jseyfried jseyfried deleted the avoid_extra_resolve_error branch October 16, 2016 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants