Skip to content

Commit 9e99aec

Browse files
committed
---
yaml --- r: 142820 b: refs/heads/try2 c: a9eb868 h: refs/heads/master v: v3
1 parent c161c1e commit 9e99aec

File tree

9 files changed

+30
-33
lines changed

9 files changed

+30
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c095a5c6cb5f749613672ab26c492fd55459b125
8+
refs/heads/try2: a9eb86823049c2eff98e74fcac8ae75cc8760f33
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/vim/ftplugin/rust.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,11 @@ if exists("g:ftplugin_rust_source_path")
3333
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
3434
endif
3535

36-
let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<"
36+
if exists("g:loaded_delimitMate")
37+
if exists("b:delimitMate_excluded_regions")
38+
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
39+
endif
40+
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
41+
endif
42+
43+
let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< | if exists('b:rust_original_delimitMate_excluded_regions') | let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions | unlet b:rust_original_delimitMate_excluded_regions | elseif exists('b:delimitMate_excluded_regions') | unlet b:delimitMate_excluded_regions | endif"

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\>
113113
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>"
114114
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
115115

116+
" For the benefit of delimitMate
117+
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime
118+
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
119+
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime
120+
116121
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
117122
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
118123
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"

branches/try2/src/librustc/middle/lint.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ fn check_item_ctypes(cx: &Context, it: &ast::item) {
745745
_ => ()
746746
}
747747
}
748+
ast::ty_ptr(ref mt) => { check_ty(cx, mt.ty) }
748749
_ => ()
749750
}
750751
}

branches/try2/src/libstd/unstable/global.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ avoid hitting the mutex.
2828
use cast::{transmute};
2929
use clone::Clone;
3030
use kinds::Send;
31-
use libc::{c_void};
31+
use libc::{c_void, intptr_t};
3232
use option::{Option, Some, None};
3333
use ops::Drop;
3434
use unstable::sync::{Exclusive, exclusive};
@@ -228,7 +228,7 @@ fn key_ptr<T:Send>(key: GlobalDataKey<T>) -> uint {
228228
}
229229

230230
extern {
231-
fn rust_get_global_data_ptr() -> *mut int;
231+
fn rust_get_global_data_ptr() -> *mut intptr_t;
232232
}
233233

234234
#[test]

branches/try2/src/rt/rust_builtin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ rust_register_exit_function(spawn_fn runner, fn_env_pair *f) {
769769
task->kernel->register_exit_function(runner, f);
770770
}
771771

772-
extern "C" void *
772+
extern "C" intptr_t*
773773
rust_get_global_data_ptr() {
774774
rust_task *task = rust_get_current_task();
775775
return &task->kernel->global_data;

branches/try2/src/rt/rust_kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class rust_kernel {
124124

125125
public:
126126
struct rust_env *env;
127-
uintptr_t global_data;
127+
intptr_t global_data;
128128

129129
rust_kernel(rust_env *env);
130130

branches/try2/src/test/compile-fail/warn-ctypes-err-attr.rs renamed to branches/try2/src/test/compile-fail/lint-ctypes.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:found rust type
1211
#[deny(ctypes)];
1312

14-
mod libc {
15-
#[nolink]
16-
pub extern {
17-
pub fn malloc(size: int) -> *u8;
18-
}
13+
use std::libc;
14+
15+
#[nolink]
16+
extern {
17+
pub fn bare_type1(size: int); //~ ERROR: found rust type
18+
pub fn bare_type2(size: uint); //~ ERROR: found rust type
19+
pub fn ptr_type1(size: *int); //~ ERROR: found rust type
20+
pub fn ptr_type2(size: *uint); //~ ERROR: found rust type
21+
22+
pub fn good1(size: *libc::c_int);
23+
pub fn good2(size: *libc::c_uint);
1924
}
2025

2126
fn main() {

branches/try2/src/test/compile-fail/warn-ctypes.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)