Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

So many warnings that need fixing #62

Closed
jdm opened this issue Jun 20, 2017 · 6 comments · Fixed by servo/core-graphics-rs#90
Closed

So many warnings that need fixing #62

jdm opened this issue Jun 20, 2017 · 6 comments · Fixed by servo/core-graphics-rs#90
Labels

Comments

@jdm
Copy link
Member

jdm commented Jun 20, 2017

warning: unnecessary parentheses around `if` condition
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:277:16
    |
277 |             if (value.is_null()) {
    |                ^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(unused_parens)] on by default

warning: private type `font::__CTFont` in public interface (error E0446)
  --> target/package/core-text-5.0.1/src/font.rs:75:1
   |
75 | pub type CTFontRef = *const __CTFont;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(private_in_public)] on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:196:50
    |
196 |         let value = get_string_by_name_key(self, kCTFontFamilyNameKey);
    |                                                  ^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:201:50
    |
201 |         let value = get_string_by_name_key(self, kCTFontSubFamilyNameKey);
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:206:50
    |
206 |         let value = get_string_by_name_key(self, kCTFontUniqueNameKey);
    |                                                  ^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:211:50
    |
211 |         let value = get_string_by_name_key(self, kCTFontPostScriptNameKey);
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: variable does not need to be mutable
   --> target/package/core-text-5.0.1/src/font.rs:310:17
    |
310 |             let mut result = CTFontGetBoundingRectsForGlyphs(self.as_concrete_TypeRef(),
    |                 ^^^^^^^^^^
    |
    = note: #[warn(unused_mut)] on by default

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:360:56
    |
360 |     println!("kCTFontFamilyNameKey: {}", get_key(font, kCTFontFamilyNameKey));
    |                                                        ^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:361:59
    |
361 |     println!("kCTFontSubFamilyNameKey: {}", get_key(font, kCTFontSubFamilyNameKey));
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:362:55
    |
362 |     println!("kCTFontStyleNameKey: {}", get_key(font, kCTFontStyleNameKey));
    |                                                       ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:363:56
    |
363 |     println!("kCTFontUniqueNameKey: {}", get_key(font, kCTFontUniqueNameKey));
    |                                                        ^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:364:54
    |
364 |     println!("kCTFontFullNameKey: {}", get_key(font, kCTFontFullNameKey));
    |                                                      ^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font.rs:365:60
    |
365 |     println!("kCTFontPostScriptNameKey: {}", get_key(font, kCTFontPostScriptNameKey));
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: found Rust tuple type in foreign module; consider using a struct instead
   --> target/package/core-text-5.0.1/src/font.rs:439:71
    |
439 |     fn CTFontCreateWithName(name: CFStringRef, size: CGFloat, matrix: *const CGAffineTransform) -> CTFontRef;
    |                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:439:100
    |
439 |     fn CTFontCreateWithName(name: CFStringRef, size: CGFloat, matrix: *const CGAffineTransform) -> CTFontRef;
    |                                                                                                    ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:441:51
    |
441 |     fn CTFontCreateWithFontDescriptor(descriptor: CTFontDescriptorRef, size: CGFloat,
    |                                                   ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found Rust tuple type in foreign module; consider using a struct instead
   --> target/package/core-text-5.0.1/src/font.rs:442:47
    |
442 |                                       matrix: *const CGAffineTransform) -> CTFontRef;
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:442:76
    |
442 |                                       matrix: *const CGAffineTransform) -> CTFontRef;
    |                                                                            ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:445:45
    |
445 |     fn CTFontCreateCopyWithAttributes(font: CTFontRef, size: CGFloat, matrix: *const CGAffineTransform,
    |                                             ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found Rust tuple type in foreign module; consider using a struct instead
   --> target/package/core-text-5.0.1/src/font.rs:445:79
    |
445 |     fn CTFontCreateCopyWithAttributes(font: CTFontRef, size: CGFloat, matrix: *const CGAffineTransform,
    |                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:446:51
    |
446 |                                       attributes: CTFontDescriptorRef) -> CTFontRef;
    |                                                   ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:446:75
    |
446 |                                       attributes: CTFontDescriptorRef) -> CTFontRef;
    |                                                                           ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:453:34
    |
453 |     fn CTFontCopyAttribute(font: CTFontRef, attribute: CFStringRef) -> CFTypeRef;
    |                                  ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:454:28
    |
454 |     fn CTFontGetSize(font: CTFontRef) -> CGFloat;
    |                            ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:456:38
    |
456 |     fn CTFontGetSymbolicTraits(font: CTFontRef) -> CTFontSymbolicTraits;
    |                                      ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:457:31
    |
457 |     fn CTFontCopyTraits(font: CTFontRef) -> CFDictionaryRef;
    |                               ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:464:29
    |
464 |     fn CTFontCopyName(font: CTFontRef, nameKey: CFStringRef) -> CFStringRef;
    |                             ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:468:55
    |
468 |     fn CTFontCopyDefaultCascadeListForLanguages(font: CTFontRef, languagePrefList: CFArrayRef) -> CFArrayRef;
    |                                                       ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:477:30
    |
477 |     fn CTFontGetAscent(font: CTFontRef) -> CGFloat;
    |                              ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:478:31
    |
478 |     fn CTFontGetDescent(font: CTFontRef) -> CGFloat;
    |                               ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:479:31
    |
479 |     fn CTFontGetLeading(font: CTFontRef) -> CGFloat;
    |                               ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:480:34
    |
480 |     fn CTFontGetUnitsPerEm(font: CTFontRef) -> libc::c_uint;
    |                                  ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:482:35
    |
482 |     fn CTFontGetBoundingBox(font: CTFontRef) -> CGRect;
    |                                   ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:483:41
    |
483 |     fn CTFontGetUnderlinePosition(font: CTFontRef) -> CGFloat;
    |                                         ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:484:42
    |
484 |     fn CTFontGetUnderlineThickness(font: CTFontRef) -> CGFloat;
    |                                          ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:487:31
    |
487 |     fn CTFontGetXHeight(font: CTFontRef) -> CGFloat;
    |                               ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:492:46
    |
492 |     fn CTFontGetBoundingRectsForGlyphs(font: CTFontRef,
    |                                              ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:498:41
    |
498 |     fn CTFontGetAdvancesForGlyphs(font: CTFontRef, orientation: CTFontOrientation, glyphs: *const CGGlyph, advances: *mut CGSize, count: CFIndex) -> libc::c_double;
    |                                         ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:510:43
    |
510 |     fn CTFontGetGlyphsForCharacters(font: CTFontRef, characters: *const UniChar, glyphs: *mut CGGlyph, count: CFIndex) -> bool;
    |                                           ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:511:31
    |
511 |     fn CTFontDrawGlyphs(font: CTFontRef,
    |                               ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:515:34
    |
515 |                         context: CGContextRef);
    |                                  ^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:519:37
    |
519 |     fn CTFontCopyGraphicsFont(font: CTFontRef, attributes: *mut CTFontDescriptorRef) -> CGFontRef;
    |                                     ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:519:60
    |
519 |     fn CTFontCopyGraphicsFont(font: CTFontRef, attributes: *mut CTFontDescriptorRef) -> CGFontRef;
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:519:89
    |
519 |     fn CTFontCopyGraphicsFont(font: CTFontRef, attributes: *mut CTFontDescriptorRef) -> CGFontRef;
    |                                                                                         ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:520:51
    |
520 |     fn CTFontCreateWithGraphicsFont(graphicsFont: CGFontRef, size: CGFloat,
    |                                                   ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found Rust tuple type in foreign module; consider using a struct instead
   --> target/package/core-text-5.0.1/src/font.rs:521:45
    |
521 |                                     matrix: *const CGAffineTransform,
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:522:49
    |
522 |                                     attributes: CTFontDescriptorRef) -> CTFontRef;
    |                                                 ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:522:73
    |
522 |                                     attributes: CTFontDescriptorRef) -> CTFontRef;
    |                                                                         ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font.rs:529:30
    |
529 |     fn CTFontCopyTable(font: CTFontRef, table: CTFontTableTag, options: CTFontTableOptions) -> CFDataRef;
    |                              ^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: private type `font_collection::__CTFontCollection` in public interface (error E0446)
  --> target/package/core-text-5.0.1/src/font_collection.rs:27:1
   |
27 | pub type CTFontCollectionRef = *const __CTFontCollection;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(private_in_public)] on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_collection.rs:151:78
    |
151 |     fn CTFontCollectionCreateFromAvailableFonts(options: CFDictionaryRef) -> CTFontCollectionRef;
    |                                                                              ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_collection.rs:155:66
    |
155 |     fn CTFontCollectionCreateMatchingFontDescriptors(collection: CTFontCollectionRef) -> CFArrayRef;
    |                                                                  ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_collection.rs:157:79
    |
157 |                                                  options: CFDictionaryRef) -> CTFontCollectionRef;
    |                                                                               ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font.rs:441:5
    |
441 | /     fn CTFontCreateWithFontDescriptor(descriptor: CTFontDescriptorRef, size: CGFloat,
442 | |                                       matrix: *const CGAffineTransform) -> CTFontRef;
    | |_____________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font.rs:445:5
    |
445 | /     fn CTFontCreateCopyWithAttributes(font: CTFontRef, size: CGFloat, matrix: *const CGAffineTransform,
446 | |                                       attributes: CTFontDescriptorRef) -> CTFontRef;
    | |____________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font.rs:519:5
    |
519 |     fn CTFontCopyGraphicsFont(font: CTFontRef, attributes: *mut CTFontDescriptorRef) -> CGFontRef;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font.rs:520:5
    |
520 | /     fn CTFontCreateWithGraphicsFont(graphicsFont: CGFontRef, size: CGFloat,
521 | |                                     matrix: *const CGAffineTransform,
522 | |                                     attributes: CTFontDescriptorRef) -> CTFontRef;
    | |__________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:187:1
    |
187 | pub type CTFontDescriptorRef = *const __CTFontDescriptor;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:347:5
    |
347 | /     pub fn CTFontDescriptorCopyAttribute(descriptor: CTFontDescriptorRef,
348 | |                                          attribute: CFStringRef) -> CFTypeRef;
    | |______________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:349:5
    |
349 |     pub fn CTFontDescriptorCopyAttributes(descriptor: CTFontDescriptorRef) -> CFDictionaryRef;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:350:5
    |
350 | /     pub fn CTFontDescriptorCopyLocalizedAttribute(descriptor: CTFontDescriptorRef,
351 | |                                                   attribute: CFStringRef,
352 | |                                                   language: *mut CFStringRef) -> CFTypeRef;
    | |___________________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:353:5
    |
353 | /     pub fn CTFontDescriptorCreateCopyWithAttributes(original: CTFontDescriptorRef,
354 | |                                                     attributes: CFDictionaryRef) -> CTFontDescriptorRef;
    | |________________________________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:355:5
    |
355 | /     pub fn CTFontDescriptorCreateCopyWithFeature(original: CTFontDescriptorRef,
356 | |                                                  featureTypeIdentifier: CFNumberRef,
357 | |                                                  featureSelectorIdentifier: CFNumberRef) -> CTFontDescriptorRef;
    | |________________________________________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:358:5
    |
358 | /     pub fn CTFontDescriptorCreateCopyWithVariation(original: CTFontDescriptorRef,
359 | |                                                    variationIdentifier: CFNumberRef,
360 | |                                                    variationValue: CGFloat) -> CTFontDescriptorRef;
    | |___________________________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:361:5
    |
361 | /     pub fn CTFontDescriptorCreateMatchingFontDescriptor(descriptor: CTFontDescriptorRef,
362 | |                                                         mandatoryAttributes: CFSetRef) -> CTFontDescriptorRef;
    | |______________________________________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:363:5
    |
363 |     pub fn CTFontDescriptorCreateWithAttributes(attributes: CFDictionaryRef) -> CTFontDescriptorRef;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:364:5
    |
364 |     pub fn CTFontDescriptorCreateWithNameAndSize(name: CFStringRef, size: CGFloat) -> CTFontDescriptorRef;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: private type `font_descriptor::__CTFontDescriptor` in public interface (error E0446)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:369:5
    |
369 | /     pub fn CTFontDescriptorCreateMatchingFontDescriptors(descriptor: CTFontDescriptorRef,
370 | |                                                          mandatoryAttributes: CFSetRef) -> CFArrayRef;
    | |______________________________________________________________________________________________________^
    |
    = note: #[warn(private_in_public)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:255:47
    |
255 |         let value = self.get_string_attribute(kCTFontDisplayNameAttribute);
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:260:47
    |
260 |         let value = self.get_string_attribute(kCTFontNameAttribute);
    |                                               ^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:265:47
    |
265 |         let value = self.get_string_attribute(kCTFontStyleNameAttribute);
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: use of extern static requires unsafe function or block (error E0133)
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:270:47
    |
270 |         let value = self.get_string_attribute(kCTFontDisplayNameAttribute);
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(safe_extern_statics)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247>

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:347:54
    |
347 |     pub fn CTFontDescriptorCopyAttribute(descriptor: CTFontDescriptorRef,
    |                                                      ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:349:55
    |
349 |     pub fn CTFontDescriptorCopyAttributes(descriptor: CTFontDescriptorRef) -> CFDictionaryRef;
    |                                                       ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:350:63
    |
350 |     pub fn CTFontDescriptorCopyLocalizedAttribute(descriptor: CTFontDescriptorRef,
    |                                                               ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:353:63
    |
353 |     pub fn CTFontDescriptorCreateCopyWithAttributes(original: CTFontDescriptorRef,
    |                                                               ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:354:85
    |
354 |                                                     attributes: CFDictionaryRef) -> CTFontDescriptorRef;
    |                                                                                     ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:355:60
    |
355 |     pub fn CTFontDescriptorCreateCopyWithFeature(original: CTFontDescriptorRef,
    |                                                            ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:356:73
    |
356 |                                                  featureTypeIdentifier: CFNumberRef,
    |                                                                         ^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:357:77
    |
357 |                                                  featureSelectorIdentifier: CFNumberRef) -> CTFontDescriptorRef;
    |                                                                             ^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:357:93
    |
357 |                                                  featureSelectorIdentifier: CFNumberRef) -> CTFontDescriptorRef;
    |                                                                                             ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:358:62
    |
358 |     pub fn CTFontDescriptorCreateCopyWithVariation(original: CTFontDescriptorRef,
    |                                                              ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:359:73
    |
359 |                                                    variationIdentifier: CFNumberRef,
    |                                                                         ^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:360:80
    |
360 |                                                    variationValue: CGFloat) -> CTFontDescriptorRef;
    |                                                                                ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:361:69
    |
361 |     pub fn CTFontDescriptorCreateMatchingFontDescriptor(descriptor: CTFontDescriptorRef,
    |                                                                     ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:362:91
    |
362 |                                                         mandatoryAttributes: CFSetRef) -> CTFontDescriptorRef;
    |                                                                                           ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:363:81
    |
363 |     pub fn CTFontDescriptorCreateWithAttributes(attributes: CFDictionaryRef) -> CTFontDescriptorRef;
    |                                                                                 ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:364:87
    |
364 |     pub fn CTFontDescriptorCreateWithNameAndSize(name: CFStringRef, size: CGFloat) -> CTFontDescriptorRef;
    |                                                                                       ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default

warning: found zero-size struct in foreign module, consider adding a member to this struct
   --> target/package/core-text-5.0.1/src/font_descriptor.rs:369:70
    |
369 |     pub fn CTFontDescriptorCreateMatchingFontDescriptors(descriptor: CTFontDescriptorRef,
    |                                                                      ^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(improper_ctypes)] on by default
@jdm jdm added the E-easy label Jun 20, 2017
bors-servo pushed a commit that referenced this issue Jun 29, 2017
Deal with two ultra-trivial warnings

I was too lazy to set git up and clone the repo locally, so these are the only warnings from the mondo list in #62 that I could do anything about right now. I'd like to get to at least some of the rest—the private-type-in-public-interface ones seem at first glance to be pretty doable, but I'd need to be able to run the compiler over the code to check for cascades.

(The fact I did this entirely in the Github UI also means I couldn't squash the two commits myself. Sorry.)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/64)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jul 5, 2017
Fix core-text related warnings (#62)

### Fix private-in-public warnings (error E0446)
Fixed by prepending `pub` to the offending types. Not sure if its the best way but it was the only thing that worked. Other methods I've tried to maintain privateness:
* Replace with an empty enum. That threw an error.
* Make it public and wrap within a private module. That threw an error too as `#[repr(C)]` does not accept modules

### Fix use of extern static warnings by wrapping in unsafe block (error E0133)
I think this is self-explanatory.

### Fix zero-size struct warnings on certain CT* types
Wrap around c_void as I believe the types are only used as pointers. Again, let me know if there is a better way to do this. I've tried following [this discussion](rust-lang/rust#27303) on opaque C types but I don't think there is a consensus. I came across this [discussion](Rust-SDL2/rust-sdl2#442) from the Rust SDL2 bindings and they eventually [opted](Rust-SDL2/rust-sdl2#445) for the solution that I implemented.

This is my first pull request (hence, first open source contribution) and I've been playing with Rust for the past few weeks. So please, if anything isnt up to standards or correctness, let me know! Also, to squash the other warnings, those changes would have to made in the modules where those types reside (core-graphics and core-foundation). I would gladly open a PR to fix those too if all looks good.

Thanks!

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/65)
<!-- Reviewable:end -->
@rthomas
Copy link
Contributor

rthomas commented Jul 24, 2017

I'm interested at plodding through these.

@jdm
Copy link
Member Author

jdm commented Jul 24, 2017

That would be great!

@rthomas
Copy link
Contributor

rthomas commented Jul 24, 2017

It looks like the warnings from CFNumberRef and CGAffineTransform are coming from foundation and graphics - and it looks like sorting those will fix the remaining warnings here.

I'm going to take a look at those first, and that should help here when they're updated.

rthomas added a commit to rthomas/core-text-rs that referenced this issue Jul 24, 2017
The remaining warnings are from types in
core-foundation(CGAffineTransform) and core-graphics(CFNumberRef). When
they are rectified the warnings can be turned back on.
@rthomas
Copy link
Contributor

rthomas commented Jul 27, 2017

This issue will be resolved when the PR's are merged and core-foundation and core-graphics crates are released and updated in this crate to 0.4 and 0.9 respectively.

bors-servo pushed a commit to servo/core-foundation-rs that referenced this issue Jul 27, 2017
Remove zero-sized struct warning. #106.

This change will fix the remaining warnings in servo/core-text-rs#62 when it is released and the core-text crate is updated.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/107)
<!-- Reviewable:end -->
bors-servo pushed a commit to servo/core-graphics-rs that referenced this issue Jul 27, 2017
Remove warnings for zero-sized structs

This change removes a bunch of warnings from the crate.

The only remaining warnings are due to the bitflags macro usage.

This will help fix servo/core-text-rs#62 when it upgrades to `core-graphics = 0.9`.

@jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/90)
<!-- Reviewable:end -->
bors-servo pushed a commit to servo/core-foundation-rs that referenced this issue Jul 27, 2017
Remove zero-sized struct warning. #106.

This change will fix the remaining warnings in servo/core-text-rs#62 when it is released and the core-text crate is updated.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/107)
<!-- Reviewable:end -->
@jdm jdm reopened this Jul 27, 2017
rthomas added a commit to rthomas/core-text-rs that referenced this issue Aug 1, 2017
bors-servo pushed a commit that referenced this issue Aug 1, 2017
Bump foundation and graphics versions for #62.

This removes the last of the compiler warnings.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/68)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Aug 2, 2017
Bump foundation and graphics versions for #62.

This removes the last of the compiler warnings.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/68)
<!-- Reviewable:end -->
@tamird
Copy link

tamird commented Aug 18, 2017

@jdm time to give this a close?

@jdm
Copy link
Member Author

jdm commented Aug 18, 2017

Yep!

@jdm jdm closed this as completed Aug 18, 2017
rthomas added a commit to rthomas/core-text-rs that referenced this issue Aug 22, 2017
Due to servo/webrender#1592 the dependency upgrade was reverted for 6.x
and added to 7.x.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants