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

Use SmallVec in ast::Path. #57623

Closed

Conversation

nnethercote
Copy link
Contributor

This is up to a 1% speedup on a few benchmark runs.

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(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 Jan 15, 2019
@nnethercote
Copy link
Contributor Author

I will do a timer run to double-check the perf improvements.

@bors try

@bors
Copy link
Contributor

bors commented Jan 15, 2019

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout Path-segments-SmallVec (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self Path-segments-SmallVec --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
warning: Cannot merge binary files: Cargo.lock (HEAD vs. heads/homu-tmp)
Auto-merging src/libsyntax/parse/parser.rs
Auto-merging src/librustc_resolve/lib.rs
Auto-merging src/librustc/hir/lowering.rs
Auto-merging Cargo.lock
CONFLICT (content): Merge conflict in Cargo.lock
Automatic merge failed; fix conflicts and then commit the result.

@nnethercote nnethercote force-pushed the Path-segments-SmallVec branch from d080fa9 to e94be7c Compare January 15, 2019 06:53
@nnethercote
Copy link
Contributor Author

@bors try

@bors
Copy link
Contributor

bors commented Jan 15, 2019

⌛ Trying commit e94be7cfaff8bb763244f00ad73f607f376264eb with merge 2140c14d63485c1e73d21c6df7656f52e4c605ba...

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.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.
travis_time:end:0084e7c0:start=1547535282726058183,finish=1547535283632201523,duration=906143340
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:53:04]    Compiling rustdoc v0.0.0 (/checkout/src/librustdoc)
[00:53:10] error[E0308]: mismatched types
[00:53:10]    --> src/librustdoc/passes/collect_intra_doc_links.rs:428:38
[00:53:10]     |
[00:53:10] 428 |     let path = ast::Path { segments: vec![segment], span: DUMMY_SP };
[00:53:10]     |                                      ^^^^^^^^^^^^^ expected struct `smallvec::SmallVec`, found struct `std::vec::Vec`
[00:53:10]     |
[00:53:10]     = note: expected type `smallvec::SmallVec<[syntax::ast::PathSegment; 1]>`
[00:53:10]                found type `std::vec::Vec<syntax::ast::PathSegment>`
[00:53:10] 
[00:53:10] error: aborting due to previous error
[00:53:10] 
[00:53:10] For more information about this error, try `rustc --explain E0308`.
---
[00:53:10] 
[00:53:10] 
[00:53:10] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:53:10] Build completed unsuccessfully in 0:49:22
[00:53:10] Makefile:18: recipe for target 'all' failed
[00:53:10] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0084590a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 15 07:48:05 UTC 2019
---
travis_time:end:00002600:start=1547538486366242390,finish=1547538486370921618,duration=4679228
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:027f6b74
$ 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 --batch -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:05f5a9a2
travis_time:start:05f5a9a2
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynami

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)

@bors
Copy link
Contributor

bors commented Jan 15, 2019

💔 Test failed - checks-travis

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2019
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-linux 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.
travis_fold:end:services

travis_fold:start:git.checkout
travis_time:start:09354054
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[01:08:36]    Compiling rustdoc v0.0.0 (/checkout/src/librustdoc)
[01:08:41] error[E0308]: mismatched types
[01:08:41]    --> src/librustdoc/passes/collect_intra_doc_links.rs:428:38
[01:08:41]     |
[01:08:41] 428 |     let path = ast::Path { segments: vec![segment], span: DUMMY_SP };
[01:08:41]     |                                      ^^^^^^^^^^^^^ expected struct `smallvec::SmallVec`, found struct `std::vec::Vec`
[01:08:41]     |
[01:08:41]     = note: expected type `smallvec::SmallVec<[syntax::ast::PathSegment; 1]>`
[01:08:41]                found type `std::vec::Vec<syntax::ast::PathSegment>`
[01:08:41] 
[01:08:41] error: aborting due to previous error
[01:08:41] 
[01:08:41] For more information about this error, try `rustc --explain E0308`.
---
travis_time:end:0204d9d0:start=1547540278496175761,finish=1547540278514191173,duration=18015412
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:046481e8
$ 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 --batch -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:0252efa6
travis_time:start:0252efa6
$ 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
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:02ddfc64
$ 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)

This is up to a 1% speedup on a few benchmark runs.
@nnethercote nnethercote force-pushed the Path-segments-SmallVec branch from e94be7c to 7e5b9c3 Compare January 16, 2019 05:53
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.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.
travis_time:end:2aa7c640:start=1547618085075328614,finish=1547618087207846588,duration=2132517974
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:10:59] 
[01:10:59] running 118 tests
[01:11:23] .iiiii...i.....i..i...i..i.i..i.ii..i.....i..i....i..........iiii..........i...ii...i.......ii.i.i.i 100/118
[01:11:27] ......iii.i.....ii
[01:11:27] 
[01:11:27]  finished in 27.834
[01:11:27] travis_fold:end:test_debuginfo

---
travis_time:start:test_run-pass-fulldeps
Check compiletest suite=run-pass-fulldeps mode=run-pass (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:12:06] 
[01:12:06] running 60 tests
[01:14:11] ..............................................F............test [run-pass] run-pass-fulldeps/myriad-closures.rs has been running for over 60 seconds
[01:16:24] failures:
[01:16:24] 
[01:16:24] ---- [run-pass] run-pass-fulldeps/pprust-expr-roundtrip.rs stdout ----
[01:16:24] 
[01:16:24] 
[01:16:24] error: test compilation failed although it shouldn't!
[01:16:24] status: exit code: 1
[01:16:24] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/pprust-expr-roundtrip/a" "-Crpath" "-O" "-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/run-pass-fulldeps/pprust-expr-roundtrip/auxiliary"
[01:16:24] ------------------------------------------
[01:16:24] 
[01:16:24] ------------------------------------------
[01:16:24] stderr:
[01:16:24] stderr:
[01:16:24] ------------------------------------------
[01:16:24] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"<::alloc::macros::vec macros>","byte_start":115,"byte_end":162,"line_start":3,"line_end":3,"column_start":1,"column_end":48,"is_primary":true,"text":[{"text":"< [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * )","highlight_start":1,"highlight_end":48}],"label":"expected struct `smallvec::SmallVec`, found struct `std::vec::Vec`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs","byte_start":2142,"byte_end":2151,"line_start":58,"line_end":58,"column_start":33,"column_end":42,"is_primary":false,"text":[{"text":"    let path = Path { segments: vec![seg], span: DUMMY_SP };","highlight_start":33,"highlight_end":42}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"vec!","def_site_span":{"file_name":"<::alloc::macros::vec macros>","byte_start":0,"byte_end":222,"line_start":1,"line_end":4,"column_start":1,"column_end":31,"is_primary":false,"text":[{"text":"( $ elem : expr ; $ n : expr ) => (","highlight_start":1,"highlight_end":36},{"text":"$ crate :: vec :: from_elem ( $ elem , $ n ) ) ; ( $ ( $ x : expr ) , * ) => (","highlight_start":1,"highlight_end":79},{"text":"< [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * )","highlight_start":1,"highlight_end":77},{"text":"=> ( vec ! [ $ ( $ x ) , * ] )","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"expected type `smallvec::SmallVec<[syntax::ast::PathSegment; 1]>`\n   found type `std::vec::Vec<syntax::ast::PathSegment>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs:58:33\n   |\nLL |     let path = Path { segments: vec![seg], span: DUMMY_SP };\n   |                                 ^^^^^^^^^ expected struct `smallvec::SmallVec`, found struct `std::vec::Vec`\n   |\n   = note: expected type `smallvec::SmallVec<[syntax::ast::PathSegment; 1]>`\n              found type `std::vec::Vec<syntax::ast::PathSegment>`\n   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n"}
[01:16:24] {"message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
[01:16:24] 
[01:16:24] ------------------------------------------
[01:16:24] 
---
[01:16:24] 
[01:16:24] 
[01:16:24] 
[01:16:24] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:495:22
[01:16:24] 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/run-pass-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--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 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -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"
[01:16:24] 
[01:16:24] 
[01:16:24] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:16:24] Build completed unsuccessfully in 0:16:44
[01:16:24] Build completed unsuccessfully in 0:16:44
[01:16:24] make: *** [check] Error 1
[01:16:24] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0141638c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Jan 16 07:11:22 UTC 2019

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)

@bors
Copy link
Contributor

bors commented Jan 16, 2019

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

@Dylan-DPC-zz
Copy link

ping from triage @nnethercote it is failling on travis

@Dylan-DPC-zz
Copy link

ping from triage @nnethercote Unfortunately we haven't heard from you on this in a while, so I'm closing the PR to keep things tidy. Don't worry though, if you'll have time again in the future please reopen this PR, we'll be happy to review it again! Thanks

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 4, 2019
@nnethercote nnethercote deleted the Path-segments-SmallVec branch February 7, 2019 06:03
@nnethercote
Copy link
Contributor Author

Yeah, this isn't going anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants