From 987dd375c9bff233dc6729fe6c5aa9f6ecdcf069 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 30 Jun 2017 16:35:03 +0200 Subject: [PATCH] Update to rustc 1.20.0-nightly (3bfc18a96 2017-06-29) --- Cargo.toml | 2 +- src/appkit.rs | 54 +++++++++++++++++++++++------------------------ src/foundation.rs | 22 +++++++++---------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1ffc6bf..947efce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cocoa" description = "Bindings to Cocoa for OS X" homepage = "https://github.com/servo/cocoa-rs" repository = "https://github.com/servo/cocoa-rs" -version = "0.9.1" +version = "0.9.2" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" diff --git a/src/appkit.rs b/src/appkit.rs index 1040675..39fe70c 100644 --- a/src/appkit.rs +++ b/src/appkit.rs @@ -316,7 +316,7 @@ pub enum NSBezelStyle { pub static NSMainMenuWindowLevel: libc::int32_t = 24; -pub trait NSApplication { +pub trait NSApplication: Sized { unsafe fn sharedApplication(_: Self) -> id { msg_send![class("NSApplication"), sharedApplication] } @@ -401,7 +401,7 @@ impl NSApplication for id { } } -pub trait NSRunningApplication { +pub trait NSRunningApplication: Sized { unsafe fn currentApplication(_: Self) -> id { msg_send![class("NSRunningApplication"), currentApplication] } @@ -414,7 +414,7 @@ impl NSRunningApplication for id { } } -pub trait NSPasteboard { +pub trait NSPasteboard: Sized { unsafe fn generalPasteboard(_: Self) -> id { msg_send![class("NSPasteboard"), generalPasteboard] } @@ -573,7 +573,7 @@ impl NSPasteboard for id { } -pub trait NSPasteboardItem { +pub trait NSPasteboardItem: Sized { unsafe fn types(self) -> id; unsafe fn setDataProvider_forTypes(self, dataProvider: id, types: id) -> BOOL; @@ -620,7 +620,7 @@ impl NSPasteboardItem for id { } } -pub trait NSPasteboardItemDataProvider { +pub trait NSPasteboardItemDataProvider: Sized { unsafe fn pasteboard_item_provideDataForType(self, pasteboard: id, item: id, _type: id); unsafe fn pasteboardFinishedWithDataProvider(self, pasteboard: id); } @@ -635,7 +635,7 @@ impl NSPasteboardItemDataProvider for id { } } -pub trait NSPasteboardWriting { +pub trait NSPasteboardWriting: Sized { unsafe fn writableTypesForPasteboard(self, pasteboard: id) -> id; unsafe fn writingOptionsForType_pasteboard(self, _type: id, pasteboard: id) -> NSPasteboardWritingOptions; @@ -656,7 +656,7 @@ impl NSPasteboardWriting for id { } } -pub trait NSPasteboardReading { +pub trait NSPasteboardReading: Sized { unsafe fn initWithPasteboardPropertyList_ofType(self, propertyList: id, _type: id) -> id; unsafe fn readableTypesForPasteboard(self, pasteboard: id) -> id; @@ -693,7 +693,7 @@ pub enum NSPasteboardWritingOptions { NSPasteboardWritingPromised = 1 << 9, } -pub trait NSMenu { +pub trait NSMenu: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSMenu"), alloc] } @@ -732,7 +732,7 @@ impl NSMenu for id { } } -pub trait NSMenuItem { +pub trait NSMenuItem: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSMenuItem"), alloc] } @@ -790,7 +790,7 @@ bitflags! { } } -pub trait NSWindow { +pub trait NSWindow: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSWindow"), alloc] } @@ -1638,7 +1638,7 @@ impl NSWindow for id { // TODO: Constraint-Based Layouts } -pub trait NSView { +pub trait NSView: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSView"), alloc] } @@ -1744,7 +1744,7 @@ pub const NSViewMinYMargin: u64 = 8; pub const NSViewHeightSizable: u64 = 16; pub const NSViewMaxYMargin: u64 = 32; -pub trait NSOpenGLView { +pub trait NSOpenGLView: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSOpenGLView"), alloc] } @@ -1773,7 +1773,7 @@ impl NSOpenGLView for id { } } -pub trait NSOpenGLPixelFormat { +pub trait NSOpenGLPixelFormat: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSOpenGLPixelFormat"), alloc] } @@ -1807,7 +1807,7 @@ impl NSOpenGLPixelFormat for id { } } -pub trait NSOpenGLContext { +pub trait NSOpenGLContext: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSOpenGLContext"), alloc] } @@ -2153,7 +2153,7 @@ pub const NSFindFunctionKey: libc::c_ushort = 0xF745; pub const NSHelpFunctionKey: libc::c_ushort = 0xF746; pub const NSModeSwitchFunctionKey: libc::c_ushort = 0xF747; -pub trait NSEvent { +pub trait NSEvent: Sized { // Creating Events unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_( _: Self, @@ -2694,7 +2694,7 @@ impl NSEvent for id { } } -pub trait NSScreen { +pub trait NSScreen: Sized { // Getting NSScreen Objects unsafe fn mainScreen(_: Self) -> id /* (NSScreen *) */; unsafe fn deepestScreen(_: Self) -> id /* (NSScreen *) */; @@ -2780,7 +2780,7 @@ impl NSScreen for id { } } -pub trait NSButton { +pub trait NSButton: Sized { unsafe fn setImage_(self, img: id /* (NSImage *) */); unsafe fn setBezelStyle_(self, style: NSBezelStyle); unsafe fn setTitle_(self, title: id /* (NSString*) */); @@ -2805,7 +2805,7 @@ impl NSButton for id { } } -pub trait NSImage { +pub trait NSImage: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSImage"), alloc] } @@ -3214,7 +3214,7 @@ pub enum NSImageLoadStatus { NSImageLoadStatusReadError } -pub trait NSSound { +pub trait NSSound: Sized { unsafe fn canInitWithPasteboard_(_: Self, pasteboard: id) -> BOOL { msg_send![class("NSSound"), canInitWithPasteboard:pasteboard] } @@ -3323,7 +3323,7 @@ impl NSSound for id { pub const NSVariableStatusItemLength: CGFloat = -1.0; pub const NSSquareStatusItemLength: CGFloat = -2.0; -pub trait NSStatusItem { +pub trait NSStatusItem: Sized { unsafe fn statusBar(self) -> id /* (NSStatusBar *) */; unsafe fn button(self) -> id /* (NSStatusBarButton *) */; unsafe fn menu(self) -> id; @@ -3358,7 +3358,7 @@ impl NSStatusItem for id { } } -pub trait NSStatusBar { +pub trait NSStatusBar: Sized { unsafe fn systemStatusBar(_: Self) -> id { msg_send![class("NSStatusBar"), systemStatusBar] } @@ -3386,7 +3386,7 @@ extern { pub fn NSRectFill(rect: NSRect); } -pub trait NSTextField { +pub trait NSTextField: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSTextField"), alloc] } @@ -3418,7 +3418,7 @@ pub enum NSTabViewType { NSNoTabsNoBorder = 6 } -pub trait NSTabView { +pub trait NSTabView: Sized { unsafe fn new(_: Self) -> id { msg_send![class("NSTabView"), new] } @@ -3593,7 +3593,7 @@ pub enum NSTabState { NSPressedTab = 2 } -pub trait NSTabViewItem { +pub trait NSTabViewItem: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSTabViewItem"), alloc] } @@ -3689,7 +3689,7 @@ impl NSTabViewItem for id { } } -pub trait NSLayoutConstraint { +pub trait NSLayoutConstraint: Sized { unsafe fn activateConstraints(_: Self, constraints: id) -> id; } @@ -3699,7 +3699,7 @@ impl NSLayoutConstraint for id { } } -pub trait NSLayoutDimension { +pub trait NSLayoutDimension: Sized { unsafe fn constraintEqualToConstant(self, c: CGFloat) -> id; unsafe fn constraintLessThanOrEqualToConstant(self, c: CGFloat) -> id; unsafe fn constraintGreaterThanOrEqualToConstant(self, c: CGFloat) -> id; @@ -3719,7 +3719,7 @@ impl NSLayoutDimension for id { } } -pub trait NSColor { +pub trait NSColor: Sized { unsafe fn clearColor(_: Self) -> id; } diff --git a/src/foundation.rs b/src/foundation.rs index 4d8e5bc..1693aad 100644 --- a/src/foundation.rs +++ b/src/foundation.rs @@ -152,7 +152,7 @@ extern { pub static NSDefaultRunLoopMode: id; } -pub trait NSAutoreleasePool { +pub trait NSAutoreleasePool: Sized { unsafe fn new(_: Self) -> id { msg_send![class("NSAutoreleasePool"), new] } @@ -171,7 +171,7 @@ impl NSAutoreleasePool for id { } } -pub trait NSProcessInfo { +pub trait NSProcessInfo: Sized { unsafe fn processInfo(_: Self) -> id { msg_send![class("NSProcessInfo"), processInfo] } @@ -187,7 +187,7 @@ impl NSProcessInfo for id { pub type NSTimeInterval = libc::c_double; -pub trait NSValue { +pub trait NSValue: Sized { unsafe fn valueWithPoint(_: Self, point: NSPoint) -> id { msg_send![class("NSValue"), valueWithPoint:point] } @@ -200,7 +200,7 @@ pub trait NSValue { impl NSValue for id { } -pub trait NSArray { +pub trait NSArray: Sized { unsafe fn array(_: Self) -> id { msg_send![class("NSArray"), array] } @@ -228,7 +228,7 @@ impl NSArray for id { } } -pub trait NSDictionary { +pub trait NSDictionary: Sized { unsafe fn dictionary(_: Self) -> id { msg_send![class("NSDictionary"), dictionary] } @@ -530,7 +530,7 @@ pub enum NSComparisonResult { NSOrderedDescending = 1 } -pub trait NSString { +pub trait NSString: Sized { unsafe fn alloc(_: Self) -> id { msg_send![class("NSString"), alloc] } @@ -569,7 +569,7 @@ impl NSString for id { } } -pub trait NSDate { +pub trait NSDate: Sized { unsafe fn distantPast(_: Self) -> id { msg_send![class("NSDate"), distantPast] } @@ -624,7 +624,7 @@ impl Iterator for NSFastIterator { if self.idx < self.len { let object = unsafe { *self.state.items_ptr.offset(self.idx as isize) - }; + }; self.mut_val = Some(new_mut); self.idx += 1; Some(object) @@ -634,7 +634,7 @@ impl Iterator for NSFastIterator { } } -pub trait NSFastEnumeration { +pub trait NSFastEnumeration: Sized { unsafe fn iter(self) -> NSFastIterator; } @@ -661,7 +661,7 @@ extern { fn NSInsetRect(rect: NSRect, x: CGFloat, y: CGFloat) -> NSRect; } -pub trait NSRunLoop { +pub trait NSRunLoop: Sized { unsafe fn currentRunLoop() -> Self; unsafe fn performSelector_target_argument_order_modes_(self, @@ -691,7 +691,7 @@ impl NSRunLoop for id { } } -pub trait NSData { +pub trait NSData: Sized { unsafe fn data(_: Self) -> id { msg_send![class("NSData"), data] }