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

Make const parameters enforce no variance constraints #60058

Merged
merged 4 commits into from Apr 18, 2019

Conversation

Projects
None yet
5 participants
@varkor
Copy link
Member

commented Apr 17, 2019

Fixes #60047. Also includes some minor const refactoring for convenience.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 17, 2019

r? @cramertj

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

@cramertj

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

📌 Commit 318a10e has been approved by cramertj

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

⌛️ Testing commit 318a10e with merge 9622c48...

bors added a commit that referenced this pull request Apr 18, 2019

Auto merge of #60058 - varkor:const-generics-ty-refactor, r=cramertj
Make const parameters enforce no variance constraints

Fixes #60047. Also includes some minor const refactoring for convenience.
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2019

The job arm-android 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.
[01:44:45] test vec::test_split_at_mut ... ok
[01:44:45] test vec::test_splice_unbounded ... ok
[01:44:45] test vec::test_split_off ... ok
[01:44:45] test vec::test_swap_remove_empty ... ok
[01:44:45] died due to signal 11
[01:44:45] 
[01:44:45] 
[01:44:45] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "arm-linux-androideabi" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--"
[01:44:45] expected success, got: exit code: 3
---
travis_time:end:12916ca0:start=1555556759258130925,finish=1555556759270541288,duration=12410363
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1a7b6a66
$ 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:008de5f4
travis_time:start:008de5f4
$ 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:17ed89e4
$ 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)

@varkor

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2019

@bors retry

(Failure looks spurious.)

bors added a commit that referenced this pull request Apr 18, 2019

Auto merge of #60058 - varkor:const-generics-ty-refactor, r=cramertj
Make const parameters enforce no variance constraints

Fixes #60047. Also includes some minor const refactoring for convenience.
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

⌛️ Testing commit 318a10e with merge e577e49...

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: cramertj
Pushing e577e49 to master...

@bors bors added the merged-by-bors label Apr 18, 2019

@bors bors merged commit 318a10e into rust-lang:master Apr 18, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2019

📣 Toolstate changed by #60058!

Tested on commit e577e49.
Direct link to PR: #60058

🎉 rls on windows: test-fail → test-pass (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Apr 18, 2019

📣 Toolstate changed by rust-lang/rust#60058!
Tested on commit rust-lang/rust@e577e49.
Direct link to PR: <rust-lang/rust#60058>

🎉 rls on windows: test-fail → test-pass (cc @Xanewok, @rust-lang/infra).

@varkor varkor deleted the varkor:const-generics-ty-refactor branch Apr 18, 2019

// Const parameters are always invariant.
for (idx, param) in generics.params.iter().enumerate() {
if let ty::GenericParamDefKind::Const = param.kind {
variances[idx] = ty::Invariant;

This comment has been minimized.

Copy link
@Zoxc

Zoxc Apr 25, 2019

Contributor

Shouldn't this be variances[generics.parent_count + idx] = ty::Invariant? Since count also include parent generics while params do not.

This comment has been minimized.

Copy link
@Zoxc

Zoxc Apr 25, 2019

Contributor

Not sure if you'd also want to change the variance of parent generics here. Maybe this code should be elsewhere?

This comment has been minimized.

Copy link
@Zoxc

This comment has been minimized.

Copy link
@varkor

varkor Apr 25, 2019

Author Member

Ah, you're absolutely right. Thanks for spotting that!

@varkor varkor referenced this pull request May 2, 2019

Open

Tracking issue for const generics (RFC 2000) #44580

1 of 13 tasks complete
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.