diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-25 22:37:12 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-26 16:26:34 +1100 |
| commit | eafdc7135b79d2e51da740b67946512d949632a1 (patch) | |
| tree | 3fc901423b11f7bd8b5aacb4a3d930972749be42 /src/rustllvm/ExecutionEngineWrapper.cpp | |
| parent | 19cb8f32d894719ece5b2308dabab45be1b94fcf (diff) | |
| download | rust-eafdc7135b79d2e51da740b67946512d949632a1.tar.gz rust-eafdc7135b79d2e51da740b67946512d949632a1.zip | |
Record the publicity of struct fields and enum variants.
The stability check checks the `PublicItems` map when giving errors if
there is a #[stable] item with a public contents that doesn't not have
its own stability. Without recording this, struct fields and enum
variants will not get errors for e.g. stable modules with unmarked
functions internally.
This is just improving the compiler's precision to give the standard
library developers more information earlier.
E.g.
#![staged_api]
#![feature(staged_api)]
#![crate_type = "lib"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Foo {
pub x: i32
}
#[stable(feature = "rust1", since = "1.0.0")]
pub mod bar {
pub fn baz() {}
}
Without the patch it gives:
test.rs:12:5: 12:20 error: This node does not have a stability attribute
test.rs:12 pub fn baz() {}
^~~~~~~~~~~~~~~
error: aborting due to previous error
With the patch it gives:
test.rs:7:9: 7:15 error: This node does not have a stability attribute
test.rs:7 pub x: i32
^~~~~~
test.rs:12:5: 12:20 error: This node does not have a stability attribute
test.rs:12 pub fn baz() {}
^~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
