1. 27 2月, 2015 1 次提交
  2. 26 2月, 2015 3 次提交
    • H
      Record the publicity of struct fields and enum variants. · eafdc713
      Huon Wilson 提交于
      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
      eafdc713
    • H
      Check stability of struct fields. · 19cb8f32
      Huon Wilson 提交于
      We were recording stability attributes applied to fields in the
      compiler, and even annotating it in the libs, but the compiler didn't
      actually do the checks to give errors/warnings in user crates.
      19cb8f32
    • B
      Auto merge of #22796 - Manishearth:rollup, r=Manishearth · 4db0b324
      bors 提交于
      4db0b324
  3. 25 2月, 2015 36 次提交