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

Confusing error for misspelled Option #3415

Closed
catamorphism opened this issue Sep 7, 2012 · 1 comment
Closed

Confusing error for misspelled Option #3415

catamorphism opened this issue Sep 7, 2012 · 1 comment
Labels
A-resolve Area: Name resolution A-syntaxext Area: Syntax extensions

Comments

@catamorphism
Copy link
Contributor

To reproduce this, go into syntax::ast and change a use of Option to option. This resulted in a unresolved name : serialize_option error. I think it would have been better to report that option was an unresolved name first. (The particular use I changed was in item_impl, but that's not checked in yet.)

It would be nice to report errors that don't involve macro-expanded code first, but I'm not sure how easy that would be.

@emberian
Copy link
Member

emberian commented Jul 3, 2013

Cannot reproduce. Current error message:

/home/cmr/hacking/rust/src/libsyntax/ast.rs:94:20: 94:33 error: use of undeclared type name `option`
/home/cmr/hacking/rust/src/libsyntax/ast.rs:94 pub type fn_ident = option<ident>;

@emberian emberian closed this as completed Jul 3, 2013
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
fix the comment for self are swallowed
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 31, 2024
…d-root, r=RalfJung

Tree Borrows: Make tree root always be initialized

This PR fixes a slight annoyance we discovered while formally proving that certain optimizations are sound with Tree Borrows. In particular... (copied from the commit message):

There should never be an `Active` but not initialized node in the borrow tree. If such a node exists, and if it has a protector, then on a foreign read, it could become disabled. This leads to some problems when formally proving that read moving optimizations are sound.

The root node is the only node for which this can happen, since all other nodes can only become `Active` when actually used. But special-casing the root node here is annoying to reason about, everything becomes much nicer if we can simply say that *all* `Active` nodes must be initialized. This requires making the root node default-initialized.

This is also more intuitive, since the root arguably becomes initialized during the allocation, which can be considered a write.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution A-syntaxext Area: Syntax extensions
Projects
None yet
Development

No branches or pull requests

2 participants