-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Description
When I run
fn f() {
};
let x: ~fn() = ~f;
I get the error message
rust> fn f() {}; let x: ~fn() = ~f;
<anon>:7:18: 7:19 error: obsolete syntax: managed or owned closure
<anon>:7 fn f() {}; let x: ~fn() = ~f;
^
note: managed closures have been removed and owned closures are now written `proc()`
error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /build/buildd/rust-nightly-201312020805~61443dc~precise/src/libsyntax/diagnos
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ben0x539 commentedon Dec 2, 2013
So, the parser still thinks
~fn()
is a heap closure but it's also the obvious way to write the type of a bare function (pointer) stored in a~
-box.let x: ~(fn()) = ~f;
works right now, too. I think the error message / type-to-string logic is right and the parser ought to give. :)emberian commentedon Dec 4, 2013
I don't actually think this is an issue.
~fn()
should be valid, though nonsensical, after the obsolete heap function handling is removed.@pcwalton is this accurate?
jvns commentedon Dec 4, 2013
Restated the issue as a parser bug.
huonw commentedon Dec 4, 2013
It's probably worth keeping the obsolete syntax warning around at least until the next release to help anyone tracking the releases and not master to upgrade.
(And also those who try Rust for the first time after the media storm we cook up for each release ;) , who chance upon some old code... Getting a sane error message rather than a mismatched types one is nicer.)
alexcrichton commentedon Feb 10, 2014
Closing
~fn()
has long been gone.alexcrichton commentedon Feb 10, 2014
Whoops, this isn't related to that, carry on!
huonw commentedon Feb 10, 2014
It's been enough time (and we've had a release), so I imagine we can remove the obsolete syntax warning now.
8 remaining items
auto merge of #13268 : alexcrichton/rust/parse-closure, r=cmr
Auto merge of rust-lang#10768 - c410-f3r:arith-3, r=Jarcho
tests/ui/issues/
: The Issues Strike Back [1/N] #144151