Uh oh!
There was an error while loading. Please reload this page.
Allow parentheses in dyn (Trait) - #48481
Conversation
There's a test |
Oh, right, you can alias @nikomatsakis is this something we should just land (perhaps w/ crater) or make it an epoch breakage? If we do the latter, bear in mind that there will be no automated way to rustfix |
petrochenkov
commented
Feb 23, 2018
We should just land this, IMO, crater won't find anything. |
Manishearth
commented
Feb 23, 2018
brb publishing a crate to prove you wrong 😜 but yeah, perhaps. Though I'm really wary about breaking changes. Feel free to r+ |
nikomatsakis
commented
Feb 23, 2018
I agree with @petrochenkov we can probably get away with this one, though like @Manishearth I am getting ever more wary about breaking changes. =) |
nikomatsakis
commented
Feb 23, 2018
Nonehtless, tagging as relnotes. Description would be something like this: The @petrochenkov, that's the case you were thinking of, right? |
nikomatsakis
commented
Feb 23, 2018
I would like some tests that cover the precedence and the interesting cases. For example: let x:&dyn(Debug + Send) = ..;// this should work, right?let x:&dyn(Debug + Send + Sync) = ..;// this toolet x:&dyn(Debug + Send + ) = ..;// I think we support trailing `+` terminators elsewherelet x:Box<dyn(Debug + Send) + Sync> = ...;// what about this? =) I forget what we decided thereAlso, does this work for |
Manishearth
commented
Feb 23, 2018
ah, none of those work |
Manishearth
commented
Feb 23, 2018
We don't seem to allow parens in trait bounds, |
nikomatsakis
commented
Feb 23, 2018
@Manishearth yes, I know. I think the way to fix this is by allowing parens in trait bounds, or at least I think that's what @cramertj and I always had in mind (they can confirm) |
nikomatsakis
commented
Feb 23, 2018
This has been a historical point of disagreement with @petrochenkov though =) |
Manishearth
commented
Feb 23, 2018
I can make it work with dyn trait for now; it does not exacerbate any breakages, and is necessary to make |
This PR doesn't implement that extension, it does other thing - it supports already existing parentheses around a single bound (e.g. |
My personal preference is for |
petrochenkov
commented
Feb 24, 2018
@bors r+ ( |
bors
commented
Feb 24, 2018
📌 Commit 4c73f82 has been approved by |
Allow parentheses in `dyn (Trait)` r? @eddyb@nikomatsakis
ishitatsuyuki
commented
Feb 25, 2018
Regression in rollup, pretty print test failed. |
Manishearth
commented
Feb 25, 2018
This merged, I just messed up on including it in the rollup |
r? @eddyb@nikomatsakis