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

Self in where clauses may not be object safe #50966

Merged

Conversation

leoyvens
Copy link
Contributor

@leoyvens leoyvens commented May 22, 2018

Needs crater, virtually certain to cause regressions.

In #50781 it was discovered that our object safety rules are not sound because we allow Self in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.

This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.

Part of #50781.

r? @nikomatsakis

@leoyvens leoyvens added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label May 22, 2018
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 22, 2018
@nikomatsakis
Copy link
Contributor

@bors try -- going to want a "check-only" crater run

--> $DIR/issue-50781.rs:21:6
|
LL | impl Trait for dyn X {}
| ^^^^^ the trait `X` cannot be made into an object
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh, the span here is a bit odd, no? I feel like it should underline the dyn X.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Presumably independent from this PR though)

@bors
Copy link
Contributor

bors commented May 22, 2018

⌛ Trying commit 7621287 with merge 0af8d41...

bors added a commit that referenced this pull request May 22, 2018
…t-safe, r=<try>

`Self` in where clauses may not be object safe

Needs crater, virtually certain to cause regressions.

In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.

This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.

Fixes #50781.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented May 22, 2018

☀️ Test successful - status-travis
State: approved= try=True

@leoyvens
Copy link
Contributor Author

leoyvens commented May 22, 2018

bors likes it, so ping @pietroalbini for a crater run. Check-only should do it.

@kennytm kennytm added the S-waiting-on-crater Status: Waiting on a crater run to be completed. label May 22, 2018
@pietroalbini
Copy link
Member

Check-only crater run started. It should be done in ~3 days.

@pietroalbini
Copy link
Member

Hi @leodasvacas (crater requester), @nikomatsakis (PR reviewer)! Crater results are at: http://cargobomb-reports.s3.amazonaws.com/pr-50966/index.html. 'Blacklisted' crates (spurious failures etc) can be found here. If you see any spurious failures not on the list, please make a PR against that file.

(interested observers: Crater is a tool for testing the impact of changes on the crates.io ecosystem. You can find out more at the repo if you're curious)

@pietroalbini pietroalbini removed the S-waiting-on-crater Status: Waiting on a crater run to be completed. label May 28, 2018
@pietroalbini
Copy link
Member

pietroalbini commented May 28, 2018

Well, with 216 regressions we surely can't land an hard error.

Dependency tree for the 193 crates
log4rs
| rincon_test_helper
| maidsafe_utilities
| | routing
| | | safe_vault
| | crust
| | secure_serialisation
| zeit-rs
| rubrail
| | toucHNews
| | connectr
| log4rs-syslog
| test-data-generation
| httpbox
| log4rs-routing-appender
| log4rs-rolling-file
| exar-db
| micro-kit
| knx_examples_rs
plugin
| iron
| | mount
| | | staticfile
| | | | mdbook
| | | | | mdbook-linkcheck
| | | | | mdbook-epub
| | | | | termbook
| | | | | | termbook-cli
| | | | tantivy-cli
| | | | reload-rs
| | | | rusty_dashed
| | | | | rustneat
| | | | lproj2es
| | | | tin
| | | | http-server
| | | | haxonite
| | | | cargo-docserve
| | | | hammer
| | | | aurelius
| | | | aklat
| | | topd
| | | flow_between
| | | flo_http_ui
| | urlencoded
| | | vault-api
| | | | vault_client
| | | spaceapi-server
| | | params
| | | | rust-http-logger
| | | | searchspot
| | | | livy_manager
| | | | iron_valid
| | | | handlebars-template-handler
| | | swagger_client
| | | maze
| | | wemo
| | | reep-optionparser-urlencoded
| | | oxide-auth
| | | juniper_iron
| | | covet
| | | click_and_load
| | | iron-csrf
| | persistent
| | | bodyparser
| | | | rustiful
| | | | | rustiful-derive
| | | | rustless
| | | | reep-bodyparser-rustcdecodable
| | | | iron_json
| | | | alexa
| | | prometheus_reporter
| | | iron-login
| | router
| | | reep
| | | | reep-id-string
| | | crates-mirror
| | | git-sql
| | | cargo-cacher
| | | codeplatter
| | | iptoasn-webservice
| | oven
| | | fe_session
| | swagger
| | sysinfo-web
| | rererouter
| | multipart
| | | walmart_partner_api
| | | retdec
| | | serenity
| | | | telecord
| | | simple-http-server
| | | rustful
| | | multipart-nickel
| | oscpad
| | socket-io
| | engine-io
| | sensorlog
| | iron-cors
| | rusty_pipe
| | selective_middleware
| | session
| | iron-sessionstorage
| | logger
| | touchpage
| | iron-send-file
| | secure-session
| | iron-params
| | iron-pack
| | iron-middleware-mysql
| | clam
| | iron_rusqlite_middleware
| | limiter
| | iron_inspect
| | iron-middlefiddle
| | iron_reverse_proxy
| | iron_vhosts
| | iron-json-response
| | iron_compress
| | iron_requestid
| | chainmail
| | handlebars-iron
| | iron-test
| | flo_static_files
| | corsware
| | iron-error-router
| | https
| | iron-drain
| | iron-slog
| nickel
| | nickel_sqlite
| | nickel_cors
| | nickel-jwt-session
pencil
pen
magnet_core
| magnet_more
| | magnet_app
sapper
| sapper_logger
| | sapper_std
| sapper_query
| sapper_body
| sapper_session
sharp_pencil
chilli
flo_animation
| flo
| flo_anim_sqlite
light_pencil
ferrum-plugin
| ferrum
| | ferrum-router
rincon_connector
self_encryption
metrics
rincon_session
amqpr
pistoncore-winit_window
vulkano-win
| pf_tas
| lime-render
| | lime-ui
| | | lime
vulkano-shader-derive
| vulkano_text
vulkano-glfw
gluon_base
vulkano
anymap
| yaecs
eclectic

@leoyvens
Copy link
Contributor Author

From a superficial analysis, the root regressions seem to be: typemap and anymap which are responsible for 90% of the regressions and look unmaintained, eclectic which is a yanked crate with no reverse dependencies and vulkano.

Since typemap and anymap are unmaintained and pervasive in the ecosystem it's unlikely that we'll ever be able to use a hard error, but since the root regressions are few we could go for deny-by-default.

@leoyvens leoyvens force-pushed the self-in-where-clauses-is-not-object-safe branch from d32cb06 to d5ecf8f Compare May 30, 2018 12:15
@leoyvens
Copy link
Contributor Author

I made it a warn-by-default. The lint level (always crate level) and span (infringing method rather than use site) are not great, but it seems like too much work to make them better. Because in the case of vulkano users might get the error and have nothing they can do about it, I made this warn-by-default.

Ready for another review by @nikomatsakis.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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:42:38] .......................................................................i............................
[00:42:42] ....................................................................................................
[00:42:47] ....................................................................................................
[00:42:53] ....................................................................................................
[00:42:56] i.................iiiiiiiii...................................................
[00:42:56] 
[00:42:56] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:43:43] .......................................................................i............................
[00:43:47] ....................................................................................................
[00:43:51] ....................................................................................................
[00:43:57] ....................................................................................................
[00:44:00] i.................iiiiiiiii...................................................
[00:44:00] 
[00:44:00]  finished in 63.489
[00:44:00] travis_fold:end:test_ui_nll

---
[00:54:02] failures:
[00:54:02] 
[00:54:02] ---- [compile-fail] compile-fail/issue-43431.rs stdout ----
[00:54:02] 
[00:54:02] error: /checkout/src/test/compile-fail/issue-43431.rs:14: unexpected warning: '14:5: 14:54: the trait `CallSingle` cannot be made into an object [where_clauses_object_safety]'
[00:54:02] 
[00:54:02] error: /checkout/src/test/compile-fail/issue-43431.rs:14: unexpected warning: '14:5: 14:54: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!'
[00:54:02] 
[00:54:02] error: 2 unexpected errors found, 0 expected errors not found
[00:54:02] status: exit code: 101
[00:54:02] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-43431.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/compile-fail/issue-43431/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/compile-fail/issue-43431/auxiliary" "-A" "unused"
[00:54:02] unexpected errors (from JSON output): [
[00:54:02]     Error {
[00:54:02]         line_num: 14,
[00:54:02]         kind: Some(
[00:54:02]         ),
[00:54:02]         ),
[00:54:02]         msg: "14:5: 14:54: the trait `CallSingle` cannot be made into an object [where_clauses_object_safety]"
[00:54:02]     Error {
[00:54:02]         line_num: 14,
[00:54:02]         kind: Some(
[00:54:02]             Warning
[00:54:02]             Warning
[00:54:02]         ),
[00:54:02]         msg: "14:5: 14:54: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!"
[00:54:02] ]
[00:54:02] 
[00:54:02] thread '[compile-fail] compile-fail/issue-43431.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[00:54:02] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:54:02] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:54:02] 
[00:54:02] ---- [compile-fail] compile-fail/wf-trait-fn-where-clause.rs stdout ----
[00:54:02] 
[00:54:02] error: /checkout/src/test/compile-fail/wf-trait-fn-where-clause.rs:20: unexpected warning: '20:5: 20:41: the trait `Foo` cannot be made into an object [where_clauses_object_safety]'
[00:54:02] 
[00:54:02] error: /checkout/src/test/compile-fail/wf-trait-fn-where-clause.rs:20: unexpected warning: '20:5: 20:41: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!'
[00:54:02] 
[00:54:02] error: 2 unexpected errors found, 0 expected errors not found
[00:54:02] status: exit code: 101
[00:54:02] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/wf-trait-fn-where-clause.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/compile-fail/wf-trait-fn-where-clause/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/compile-fail/wf-trait-fn-where-clause/auxiliary" "-A" "unused"
[00:54:02] unexpected errors (from JSON output): [
[00:54:02]     Error {
[00:54:02]         line_num: 20,
[00:54:02]         kind: Some(
[00:54:02]         ),
[00:54:02]         ),
[00:54:02]         msg: "20:5: 20:41: the trait `Foo` cannot be made into an object [where_clauses_object_safety]"
[00:54:02]     Error {
[00:54:02]         line_num: 20,
[00:54:02]         kind: Some(
[00:54:02]             Warning
[00:54:02]             Warning
[00:54:02]         ),
[00:54:02]         msg: "20:5: 20:41: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!"
[00:54:02] ]
[00:54:02] 
[00:54:02] thread '[compile-fail] compile-fail/wf-trait-fn-where-clause.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[00:54:02] 

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)

@leoyvens leoyvens force-pushed the self-in-where-clauses-is-not-object-safe branch from d5ecf8f to 36aa9d4 Compare May 30, 2018 14:45
@nikomatsakis
Copy link
Contributor

Since typemap and anymap are unmaintained and pervasive in the ecosystem it's unlikely that we'll ever be able to use a hard error, but since the root regressions are few we could go for deny-by-default.

We may be able to get the author — @reem iirc? — to hand us over the keys so we can issue a patch release, presuming we have a fix in mind. I've not had a chance to look in more depth yet.

@nikomatsakis
Copy link
Contributor

OK so these are the failures from typemap etc are due to this trait. I have to say that I .. feel like we ought to be able to accept this. I kind of want to return to the original bug now and see if we can devise finer-grained rules.

#[doc(hidden)]
pub trait CloneToAny {
    /// Clone `self` into a new `Box<CloneAny>` object.
    fn clone_to_any(&self) -> Box<CloneAny>;

    /// Clone `self` into a new `Box<CloneAny + Send>` object.
    fn clone_to_any_send(&self) -> Box<CloneAny + Send> where Self: Send;

    /// Clone `self` into a new `Box<CloneAny + Sync>` object.
    fn clone_to_any_sync(&self) -> Box<CloneAny + Sync> where Self: Sync;

    /// Clone `self` into a new `Box<CloneAny + Send + Sync>` object.
    fn clone_to_any_send_sync(&self) -> Box<CloneAny + Send + Sync> where Self: Send + Sync;
}

@nikomatsakis
Copy link
Contributor

(cross-posted)

So I was discussing this problem with myself (I don't think @leodasvacas is around =) on Discord. You can search for this GUID to find it: 3b75dc47-42f1-44da-a39e-562f5875e932

However, the TL;DR is that we don't have to forbid all where clauses like Self: B where B is some bound. The key question is whether proving that dyn Trait: B implies that the hidden Self also satisfies B. This is true for lifetime bounds but also auto traits. It is not true for general traits (which can be implemented for a dyn Trait type but not necessarily other types).

So I think we should loosen the conditions in the PR, which should help with regressions.

tomaka pushed a commit to vulkano-rs/vulkano that referenced this pull request Jun 5, 2018
It was recently discovered in rust-lang/rust#50781 that `Self: Trait` bounds in trait methods are really not object-safe. This will be made into a warning by rust-lang/rust#50966, and vulkano will be affected by the warning .

Thankfully the fix looks simple, by just moving `fn len` from `BufferAccess` to being directly in `TypedBufferAccess`.
@TimNN TimNN 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 Jun 5, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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:48:20] ....................................................................................................
[00:48:23] ....................................................................................................
[00:48:28] ....................................................................................................
[00:48:32] ....................................................................................................
[00:48:38] ...........................................................F........................................
[00:48:49] ....i..............................................................................i................
[00:48:54] ....................................................................................................
[00:48:59] ....................................................................................................
[00:49:05] ....................................................................................................
[00:49:05] ....................................................................................................
[00:49:11] ................i.................iiiiiiiii...................................................
[00:49:11] 
[00:49:11] ---- [ui] ui/issue-50781.rs stdout ----
[00:49:11] diff of stderr:
[00:49:11] 
[00:49:11] 
[00:49:11] 10 LL | #![deny(where_clauses_object_safety)]
[00:49:11] 12    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[00:49:11] -    = note: for more information, see issue TBD
[00:49:11] -    = note: for more information, see issue TBD
[00:49:11] +    = note: for more information, see issue #5144e_start":16,"line_end":16,"column_start":5,"column_end":37,"is_primary":true,"text":[{"text":"    fn foo(&self) where Self: Trait; //~ ERROR the trait `X` cannot be made into an object","highlight_start":5,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"lint level defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-50781.rs","byte_start":475,"byte_end":502,"line_start":11,"line_end":11,"column_start":9,"column_end":36,"is_primary":true,"text":[{"text":"#![deny(where_clauses_object_safety)]","highlight_start":9,"highlight_end":36}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #51443 <https://github.com/rust-lang/rust/issues/51443>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"method `foo` references the `Self` type in where clauses","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: the trait `X` cannot be made into an object\n  --> /checkout/src/test/ui/issue-50781.rs:16:5\n   |\nLL |     fn foo(&self) where Self: Trait; //~ ERROR the trait `X` cannot be made into an object\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\nnote: lint level defined here\n  --> /checkout/src/test/ui/issue-50781.rs:11:9\n   u/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--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" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:49:11] 
[00:49:11] 
[00:49:11] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:49:11] Build completed unsuccessfully in 0:02:40
[00:49:11] Build completed unsuccessfully in 0:02:40
[00:49:11] make: *** [check] Error 1
[00:49:11] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:278d9b28
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Jun  8 22:18:34 UTC 2018
./obj/build/bootstrap/debug/incremental/bootstrap-c730863262pt
103812 ./obj/build/bootstrap/debug/incremental/bootstrap-c730863262pt/s-f1t1g1aztd-ovzgu6-3m5keuwh0gmzh
102908 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu
102904 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release
99524 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
91280 ./obj/build/x86_64-unknown-linux-gnu/stage1

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 Jun 9, 2018

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

@leoyvens leoyvens force-pushed the self-in-where-clauses-is-not-object-safe branch 2 times, most recently from 281ee1c to 697a66c Compare June 9, 2018 13:56
@bors
Copy link
Contributor

bors commented Jun 17, 2018

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

@pietroalbini
Copy link
Member

Ping from triage @leodasvacas! It's been a while since we heard from you, will you have time to work on this again?

This is virtually certain to cause regressions, needs crater.

In rust-lang#50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.

This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.

Fixes rust-lang#50781.

r? @nikomatsakis
@leoyvens leoyvens force-pushed the self-in-where-clauses-is-not-object-safe branch from 697a66c to cc60e01 Compare June 25, 2018 10:39
@leoyvens
Copy link
Contributor Author

I've rebased this. I think we still want to land this, and then try to follow up with something better.

@pietroalbini pietroalbini added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 25, 2018
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 25, 2018

📌 Commit cc60e01 has been approved by nikomatsakis

@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 Jun 25, 2018
@nikomatsakis
Copy link
Contributor

@bors r-

Actually, I want to check something. @leodasvacas, do you know precisely what set of conditions are needed to trigger the lint? Does it only trigger if you try to convert one of the affected traits into a trait object?

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 25, 2018
@nikomatsakis
Copy link
Contributor

@bors r+

Looks like yes.

@bors
Copy link
Contributor

bors commented Jun 25, 2018

📌 Commit cc60e01 has been approved by nikomatsakis

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 25, 2018
@bors
Copy link
Contributor

bors commented Jun 26, 2018

⌛ Testing commit cc60e01 with merge fdd9cdc...

bors added a commit that referenced this pull request Jun 26, 2018
…t-safe, r=nikomatsakis

`Self` in where clauses may not be object safe

Needs crater, virtually certain to cause regressions.

In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.

This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.

Part of #50781.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Jun 26, 2018

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

@bors bors merged commit cc60e01 into rust-lang:master Jun 26, 2018
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. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants