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

Expand upper bounds on RangeBounds impls #64327

Closed

Conversation

kungfukennyg
Copy link
Contributor

Per issue #64027 adds ?Sized to all RangeBounds<&T> impls.

@rust-highfive
Copy link
Collaborator

r? @kennytm

(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 Sep 10, 2019
@Centril Centril added needs-fcp This change is insta-stable, so needs a completed FCP to proceed. relnotes Marks issues that should be documented in the release notes of the next release. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 10, 2019
@Centril Centril added this to the 1.39 milestone Sep 10, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-09-10T00:06:25.8695195Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-10T00:06:25.8877776Z ##[command]git config gc.auto 0
2019-09-10T00:06:25.8963093Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-10T00:06:25.9025795Z ##[command]git config --get-all http.proxy
2019-09-10T00:06:25.9164435Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64327/merge:refs/remotes/pull/64327/merge
---
2019-09-10T01:05:51.1979446Z .................................................................................................... 1500/9006
2019-09-10T01:05:56.9165929Z .................................................................................................... 1600/9006
2019-09-10T01:06:09.4353600Z .......................................................i...............i............................ 1700/9006
2019-09-10T01:06:17.2369465Z .................................................................................................... 1800/9006
2019-09-10T01:06:32.2108732Z ..............................................iiiii................................................. 1900/9006
2019-09-10T01:06:43.2973116Z .................................................................................................... 2100/9006
2019-09-10T01:06:45.7769466Z .................................................................................................... 2200/9006
2019-09-10T01:06:49.5322117Z .................................................................................................... 2300/9006
2019-09-10T01:06:57.4371588Z .................................................................................................... 2400/9006
---
2019-09-10T01:10:03.7431020Z .................................i...............i.................................................. 4700/9006
2019-09-10T01:10:16.3724972Z .................................................................................................... 4800/9006
2019-09-10T01:10:24.0235025Z .................................................................................................... 4900/9006
2019-09-10T01:10:35.7842345Z .................................................................................................... 5000/9006
2019-09-10T01:10:42.4718656Z ................ii.ii............................................................................... 5100/9006
2019-09-10T01:10:53.9832862Z .................................................................................................... 5300/9006
2019-09-10T01:11:05.0835017Z ................................................................................i................... 5400/9006
2019-09-10T01:11:13.4617533Z .................................................................................................... 5500/9006
2019-09-10T01:11:20.0944031Z .................................................................................................... 5600/9006
2019-09-10T01:11:20.0944031Z .................................................................................................... 5600/9006
2019-09-10T01:11:31.6227148Z .........................................................................ii...i..ii...........i..... 5700/9006
2019-09-10T01:11:59.0263500Z .................................................................................................... 5900/9006
2019-09-10T01:12:09.5379601Z .................................................................................................... 6000/9006
2019-09-10T01:12:09.5379601Z .................................................................................................... 6000/9006
2019-09-10T01:12:15.7660404Z ...........................................................................i..ii.................... 6100/9006
2019-09-10T01:12:47.1061615Z .................................................................................................... 6300/9006
2019-09-10T01:12:49.2452696Z ..................................i................................................................. 6400/9006
2019-09-10T01:12:51.5014569Z .................................................................................................... 6500/9006
2019-09-10T01:12:54.1608238Z ......i............................................................................................. 6600/9006
---
2019-09-10T01:18:01.8018866Z  finished in 20.308
2019-09-10T01:18:02.3185083Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-10T01:18:02.3195905Z 
2019-09-10T01:18:02.3196044Z running 150 tests
2019-09-10T01:18:06.3195969Z i....iii......iii..iiii....i.............................i..i..................i....i.........ii.i.i 100/150
2019-09-10T01:18:07.8012422Z ..iiii..............i.........iii.i.......ii......
2019-09-10T01:18:07.8014160Z 
2019-09-10T01:18:07.8020360Z  finished in 5.978
2019-09-10T01:18:07.8241123Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-10T01:18:07.9966239Z 
---
2019-09-10T01:18:10.3231712Z  finished in 2.499
2019-09-10T01:18:10.3453881Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-10T01:18:10.5225423Z 
2019-09-10T01:18:10.5226938Z running 9 tests
2019-09-10T01:18:10.5228124Z iiiiiiiii
2019-09-10T01:18:10.5228839Z 
2019-09-10T01:18:10.5228988Z  finished in 0.177
2019-09-10T01:18:10.5453899Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-10T01:18:10.7351676Z 
---
2019-09-10T01:18:30.9957723Z  finished in 20.450
2019-09-10T01:18:31.0194900Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-10T01:18:31.1933912Z 
2019-09-10T01:18:31.1936308Z running 123 tests
2019-09-10T01:18:57.0483589Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-09-10T01:19:02.1002200Z i.i.i......iii.i.....ii
2019-09-10T01:19:02.1004457Z 
2019-09-10T01:19:02.1005227Z  finished in 31.081
2019-09-10T01:19:02.1016113Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-10T01:19:02.1016465Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-09-10T01:32:20.0703790Z ...........................................................
2019-09-10T01:32:20.0704438Z failures:
2019-09-10T01:32:20.0704650Z 
2019-09-10T01:32:20.0705767Z ---- collections/btree/map.rs - collections::btree::map::BTreeMap<K, V>::range_mut (line 841) stdout ----
2019-09-10T01:32:20.0706521Z error[E0283]: type annotations required: cannot resolve `_: std::cmp::Ord`
2019-09-10T01:32:20.0707955Z   --> collections/btree/map.rs:848:25
2019-09-10T01:32:20.0708249Z    |
2019-09-10T01:32:20.0708436Z 10 | for (_, balance) in map.range_mut("B".."Cheryl") {
2019-09-10T01:32:20.0708729Z 
2019-09-10T01:32:20.0708879Z error: aborting due to previous error
2019-09-10T01:32:20.0709031Z 
2019-09-10T01:32:20.0709810Z For more information about this error, try `rustc --explain E0283`.
---
2019-09-10T01:32:20.0711377Z 
2019-09-10T01:32:20.0781442Z error: test failed, to rerun pass '--doc'
2019-09-10T01:32:20.8340286Z 
2019-09-10T01:32:20.8368463Z 
2019-09-10T01:32:20.8369797Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "alloc" "--" "--quiet"
2019-09-10T01:32:20.8370649Z 
2019-09-10T01:32:20.8370736Z 
2019-09-10T01:32:20.8370997Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-10T01:32:20.8371081Z Build completed unsuccessfully in 1:18:52
2019-09-10T01:32:20.8371081Z Build completed unsuccessfully in 1:18:52
2019-09-10T01:32:20.8371132Z == clock drift check ==
2019-09-10T01:32:20.8371180Z   local time: Tue Sep 10 01:32:20 UTC 2019
2019-09-10T01:32:20.8371248Z   network time: Tue, 10 Sep 2019 01:32:20 GMT
2019-09-10T01:32:20.8371297Z == end clock drift check ==
2019-09-10T01:32:20.8440833Z ##[error]Bash exited with code '1'.
2019-09-10T01:32:20.8483963Z ##[section]Starting: Checkout
2019-09-10T01:32:20.8487295Z ==============================================================================
2019-09-10T01:32:20.8487377Z Task         : Get sources
2019-09-10T01:32:20.8487424Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@kennytm
Copy link
Member

kennytm commented Sep 10, 2019

This has broken type-inference of some existing tests.

2019-09-10T01:32:20.0705767Z ---- collections/btree/map.rs - collections::btree::map::BTreeMap<K, V>::range_mut (line 841) stdout ----
2019-09-10T01:32:20.0706521Z error[E0283]: type annotations required: cannot resolve `_: std::cmp::Ord`
2019-09-10T01:32:20.0707955Z   --> collections/btree/map.rs:848:25
2019-09-10T01:32:20.0708249Z    |
2019-09-10T01:32:20.0708436Z 10 | for (_, balance) in map.range_mut("B".."Cheryl") {

@kungfukennyg
Copy link
Contributor Author

kungfukennyg commented Sep 10, 2019

Yup I'm looking into it. Is there an easy way to run that test case?

Edit: Nevermind, I found what I need.

@kennytm
Copy link
Member

kennytm commented Sep 11, 2019

r? @Mark-Simulacrum

I think we need a crater run but the queue is super long for now 😕

@Mark-Simulacrum
Copy link
Member

Hm, yeah, inference breakage here is concerning.

@bors try to get a build for crater

@bors
Copy link
Contributor

bors commented Sep 11, 2019

⌛ Trying commit c1539ab with merge b19afc12c4f781e95f168f2fdea339c972f14ae2...

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2019
@bors
Copy link
Contributor

bors commented Sep 11, 2019

☀️ Try build successful - checks-azure
Build commit: b19afc12c4f781e95f168f2fdea339c972f14ae2

@Mark-Simulacrum
Copy link
Member

@craterbot run mode=check-only

@craterbot
Copy link
Collaborator

👌 Experiment pr-64327 created and queued.
🤖 Automatically detected try build b19afc12c4f781e95f168f2fdea339c972f14ae2
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@kungfukennyg
Copy link
Contributor Author

How long do crater runs typically take? I'm curious as to how much longer this PR may be in the queue. I see it's second to the top.

@Mark-Simulacrum
Copy link
Member

I think the current average for a check run is around 4 days, but I'm not sure.

@craterbot
Copy link
Collaborator

🚧 Experiment pr-64327 is now running on agent aws-1.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@Centril Centril modified the milestones: 1.39, 1.40 Sep 26, 2019
@craterbot
Copy link
Collaborator

🎉 Experiment pr-64327 is completed!
📊 7 regressed and 0 fixed (74234 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot removed the S-waiting-on-crater Status: Waiting on a crater run to be completed. label Sep 29, 2019
@craterbot craterbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 29, 2019
@jonas-schievink
Copy link
Contributor

cc #61584, an earlier attempt at this

@Centril
Copy link
Contributor

Centril commented Sep 29, 2019

Seems like acceptable breakage to me (a single crates.io regression which will probably be fixed soon...).

r? @dtolnay to assess this.

@@ -904,7 +904,7 @@ impl<T> RangeBounds<T> for RangeTo<&T> {
}

#[stable(feature = "collections_range", since = "1.28.0")]
impl<T> RangeBounds<T> for Range<&T> {
impl<T: ?Sized> RangeBounds<T> for Range<&T> {
fn start_bound(&self) -> Bound<&T> {
Included(self.start)
}
Copy link
Member

Choose a reason for hiding this comment

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

Was this change supposed to apply to the RangeBounds<T> impls for RangeInclusive<&T> and RangeToInclusive<&T> (below) as well?

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

I agree that the T: ?Sized impls are more correct and it would be great to have that, but I am not thrilled about introducing even more need for turbofish on range and range_mut.

Some questions to dig into what is going on here:

  1. Is there any defensible language change that might allow us to eliminate the ambiguity when using "from".."to" as a range into a BTreeMap<&str, _> or (separately) a BTreeMap<String, _>? Possibly some way to guide the inference of T when the other type parameters are known, or some way to say that any choice of T that satisfies the bounds is fine even if it's not known to be the unique possible choice.

  2. If range and range_mut didn't exist yet, is there a better less generic signature for them that wouldn't be ambiguous in common cases?

I don't know who these questions are directed to but I am hesitant to merge this change as currently implemented. The amount of breakage is small and would probably be justifiable for a change that made "from".."to" "just work" without turbofishes, but as it is, I don't think landing this is the right tradeoff.

The workaround is to use map.range::<str, _>((Bound::Included("from"), Bound::Excluded("to"))) which has the right performance characteristics, or map.range("from".to_owned().."to".to_owned()) which is more concise.

@Dylan-DPC-zz Dylan-DPC-zz 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 Oct 14, 2019
@JohnTitor
Copy link
Member

Ping from triage: @kennethbgoodin any updates on this?

@kungfukennyg
Copy link
Contributor Author

It sounds like the consensus is that this change isn't the best approach -- should I close this PR?

@Centril Centril modified the milestones: 1.40, 1.41 Nov 7, 2019
@dtolnay dtolnay closed this Nov 10, 2019
@Centril Centril removed this from the 1.41 milestone Nov 13, 2019
@Centril Centril removed the relnotes Marks issues that should be documented in the release notes of the next release. label Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.