Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upType inference of a diverging function is weird #20172
Comments
This comment has been minimized.
This comment has been minimized.
|
There is no longer a bottom type; it was removed (see issue #14973), replaced with treating a function returning It is not clear to me from the issue description whether the problem here is merely one of documentation needing updating, or if there is some more fundamental issue that needs to be addressed. |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix Oh, I didn't know it had already been removed. Then these statements should at least be updated accordingly:
The way I understood your explanation is: "diverging-ness" of a function is specific to each function marked with But then, I think |
kmcallister
added
A-typesystem
A-docs
labels
Jan 16, 2015
This comment has been minimized.
This comment has been minimized.
|
The semicolon example not compiling doesn't have anything to do with bottom. |
nodakai commentedDec 23, 2014
These two codes compile fine:
but this does not (note the semicolon after
f()):Though the Rust language reference seems to say there's an (inhabitable) type called the "bottom type," the behavior of
rustcis almost as if the bottom type does not really exist in Rust. These examples gave me an impression that a type equation involving a diverging function is simply discarded (otherwiseRin the last example should correctly be inferred as the bottom type and there should be no difference betweenfoo();andpanic();,) though I'm awarelibrustc/middle/infer/combine.rsdoes consistency check ofFnDiverigng...See also #20105 which was originally filed as a complaint for not allowing this code: