Skip to content

Commit e1a98a8

Browse files
committed
---
yaml --- r: 148069 b: refs/heads/try2 c: a0643ee h: refs/heads/master i: 148067: 835d6ce v: v3
1 parent 037b958 commit e1a98a8

File tree

29 files changed

+262
-213
lines changed

29 files changed

+262
-213
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: ba6ed004b0a7bf40dbd906ba9c8677133213c6ef
8+
refs/heads/try2: a0643ee9ae5726edaa382a1a125319688477ec98
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/AUTHORS.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ Lindsey Kuper <[email protected]>
225225
Luca Bruno <[email protected]>
226226
Luis de Bethencourt <[email protected]>
227227
Luqman Aden <[email protected]>
228-
229228
Magnus Auvinen <[email protected]>
230229
Mahmut Bulut <[email protected]>
231230
maikklein <[email protected]>
@@ -241,7 +240,6 @@ Martin DeMello <[email protected]>
241240
Marvin Löbel <[email protected]>
242241
Matt Brubeck <[email protected]>
243242
Matt Carberry <[email protected]>
244-
Matthew Auld <[email protected]>
245243
Matthew Iselin <[email protected]>
246244
Matthew McPherrin <[email protected]>
247245
Matthew O'Connor <[email protected]>

branches/try2/RELEASES.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version 0.9 (January 2014)
22
--------------------------
33

4-
* ~1800 changes, numerous bugfixes
4+
* ~1600 changes, numerous bugfixes
55

66
* Language
77
* The `float` type has been removed. Use `f32` or `f64` instead.
@@ -22,9 +22,6 @@ Version 0.9 (January 2014)
2222
* `@fn`s have been removed.
2323
* `do` only works with procs in order to make it obvious what the cost
2424
of `do` is.
25-
* Single-element tuple-like structs can no longer be dereferenced to
26-
obtain the inner value. A more comprehensive solution for overloading
27-
the dereference operator will be provided in the future.
2825
* The `#[link(...)]` attribute has been replaced with
2926
`#[crate_id = "name#vers"]`.
3027
* Empty `impl`s must be terminated with empty braces and may not be
@@ -35,8 +32,6 @@ Version 0.9 (January 2014)
3532
* `printf!` and `printfln!` (old-style formatting) removed in favor of
3633
`print!` and `println!`.
3734
* `mut` works in patterns now, as in `let (mut x, y) = (1, 2);`.
38-
* The `extern mod foo (name = "bar")` syntax has been removed. Use
39-
`extern mod foo = "bar"` instead.
4035
* New reserved keywords: `alignof`, `offsetof`, `sizeof`.
4136
* Macros can have attributes.
4237
* Macros can expand to items with attributes.
@@ -81,7 +76,6 @@ Version 0.9 (January 2014)
8176
variables. Currently behind the `thread_local` feature gate.
8277
* The `return` keyword may be used in closures.
8378
* Types that can be copied via a memcpy implement the `Pod` kind.
84-
* The `cfg` attribute can now be used on struct fields and enum variants.
8579

8680
* Libraries
8781
* std: The `option` and `result` API's have been overhauled to make them
@@ -96,14 +90,9 @@ Version 0.9 (January 2014)
9690
* std: The reference counted pointer type `extra::rc` moved into std.
9791
* std: The `Gc` type in the `gc` module will replace `@` (it is currently
9892
just a wrapper around it).
99-
* std: The `Either` type has been removed.
10093
* std: `fmt::Default` can be implemented for any type to provide default
10194
formatting to the `format!` macro, as in `format!("{}", myfoo)`.
10295
* std: The `rand` API continues to be tweaked.
103-
* std: The `rust_begin_unwind` function, useful for insterting breakpoints
104-
on failure in gdb, is now named `rust_fail`.
105-
* std: The `each_key` and `each_value` methods on `HashMap` have been
106-
replaced by the `keys` and `values` iterators.
10796
* std: Functions dealing with type size and alignment have moved from the
10897
`sys` module to the `mem` module.
10998
* std: The `path` module was written and API changed.

branches/try2/mk/clean.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ clean-misc:
4444
$(Q)rm -Rf $(DOCS)
4545
$(Q)rm -Rf $(GENERATED)
4646
$(Q)rm -Rf tmp/*
47-
$(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz $(PKG_NAME)-*.exe dist
47+
$(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz dist
4848
$(Q)rm -Rf $(foreach ext, \
4949
html aux cp fn ky log pdf pg toc tp vr cps epub, \
5050
$(wildcard doc/*.$(ext)))

branches/try2/mk/target.mk

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,18 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
5454
@$$(call E, cp: $$@)
5555
$$(Q)cp $$< $$@
5656

57-
# SNAP a5fa1d9 remove this after the stage0 snapshot from rules below
58-
ifeq ($(1),0)
59-
LFLAGS_$(1)_$(2)_$(3) := -L $$(TLIB$(1)_T_$(2)_H_$(3))
60-
else
61-
LFLAGS_$(1)_$(2)_$(3) :=
62-
endif
63-
6457
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)): \
6558
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
6659
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
6760
| $$(TLIB$(1)_T_$(2)_H_$(3))/
6861
@$$(call E, compile_and_link: $$@)
62+
ifeq ($(1),0)
63+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
64+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
65+
endif
6966
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
7067
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
71-
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $$(LFLAGS_$(1)_$(2)_$(3)) \
72-
--out-dir $$(@D) $$< && touch $$@
68+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
7369
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
7470
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
7571

@@ -79,10 +75,13 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
7975
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
8076
| $$(TLIB$(1)_T_$(2)_H_$(3))/
8177
@$$(call E, compile_and_link: $$@)
78+
ifeq ($(1),0)
79+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
80+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
81+
endif
8282
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(2)),$$(notdir $$@))
8383
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_RGLOB_$(2)),$$(notdir $$@))
84-
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $$(LFLAGS_$(1)_$(2)_$(3)) \
85-
--out-dir $$(@D) $$< && touch $$@
84+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
8685
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(2)),$$(notdir $$@))
8786
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_RGLOB_$(2)),$$(notdir $$@))
8887

@@ -99,7 +98,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTUV_$(2)): \
9998
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
10099
-L $$(UV_SUPPORT_DIR_$(2)) \
101100
-L $$(dir $$(LIBUV_LIB_$(2))) \
102-
$$(LFLAGS_$(1)_$(2)_$(3)) \
103101
--out-dir $$(@D) $$< && touch $$@
104102
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(2)),$$(notdir $$@))
105103
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_RGLOB_$(2)),$$(notdir $$@))
@@ -113,7 +111,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBGREEN_$(2)): \
113111
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_GLOB_$(2)),$$(notdir $$@))
114112
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_RGLOB_$(2)),$$(notdir $$@))
115113
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
116-
$$(LFLAGS_$(1)_$(2)_$(3)) \
117114
--out-dir $$(@D) $$< && touch $$@
118115
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_GLOB_$(2)),$$(notdir $$@))
119116
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_RGLOB_$(2)),$$(notdir $$@))
@@ -127,7 +124,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBNATIVE_$(2)): \
127124
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_GLOB_$(2)),$$(notdir $$@))
128125
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_RGLOB_$(2)),$$(notdir $$@))
129126
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
130-
$$(LFLAGS_$(1)_$(2)_$(3)) \
131127
--out-dir $$(@D) $$< && touch $$@
132128
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_GLOB_$(2)),$$(notdir $$@))
133129
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_RGLOB_$(2)),$$(notdir $$@))
@@ -139,11 +135,13 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
139135
$$(TEXTRALIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
140136
| $$(TLIB$(1)_T_$(2)_H_$(3))/
141137
@$$(call E, compile_and_link: $$@)
138+
ifeq ($(1),0)
139+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
140+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
141+
endif
142142
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
143143
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_RGLOB_$(2)),$$(notdir $$@))
144-
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $(BORROWCK) \
145-
$$(LFLAGS_$(1)_$(2)_$(3)) \
146-
--out-dir $$(@D) $$< && touch $$@
144+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $(BORROWCK) --out-dir $$(@D) $$< && touch $$@
147145
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
148146
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_RGLOB_$(2)),$$(notdir $$@))
149147

@@ -166,11 +164,14 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
166164
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)) \
167165
| $$(TLIB$(1)_T_$(2)_H_$(3))/
168166
@$$(call E, compile_and_link: $$@)
167+
ifeq ($(1),0)
168+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
169+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
170+
endif
169171
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
170172
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
171173
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
172174
-L "$$(LLVM_LIBDIR_$(2))" \
173-
$$(LFLAGS_$(1)_$(2)_$(3)) \
174175
--out-dir $$(@D) $$< && touch $$@
175176
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
176177
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
@@ -181,8 +182,11 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(3)): \
181182
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)) \
182183
| $$(TBIN$(1)_T_$(2)_H_$(3))/
183184
@$$(call E, compile_and_link: $$@)
184-
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$< \
185-
$$(LFLAGS_$(1)_$(2)_$(3))
185+
ifeq ($(1),0)
186+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
187+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
188+
endif
189+
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$<
186190
ifdef CFG_ENABLE_PAX_FLAGS
187191
@$$(call E, apply PaX flags: $$@)
188192
@"$(CFG_PAXCTL)" -cm "$$@"

branches/try2/src/etc/pkg/rust.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DisableStartupPrompt=true
1919

2020
OutputDir=.\
2121
SourceDir=.\
22-
OutputBaseFilename=rust-{#CFG_VERSION}-install
22+
OutputBaseFilename=rust-{#CFG_VERSION_WIN}-install
2323
DefaultDirName={pf32}\Rust
2424

2525
Compression=lzma2/ultra

branches/try2/src/libextra/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl SmallBitv {
8080
self.bits |= 1<<i;
8181
}
8282
else {
83-
self.bits &= !(1<<i);
83+
self.bits &= !(1<<i as uint);
8484
}
8585
}
8686

branches/try2/src/libextra/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ pub mod writer {
647647
let cur_pos = self.writer.tell();
648648
self.writer.seek(last_size_pos as i64, io::SeekSet);
649649
let size = (cur_pos as uint - last_size_pos - 4);
650-
write_sized_vuint(self.writer, size, 4u);
650+
write_sized_vuint(self.writer, size as uint, 4u);
651651
self.writer.seek(cur_pos as i64, io::SeekSet);
652652

653653
debug!("End tag (size = {})", size);

branches/try2/src/libextra/semver.rs

Lines changed: 34 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ impl cmp::Ord for Version {
141141
}
142142
}
143143

144+
condition! {
145+
bad_parse: () -> ();
146+
}
147+
144148
fn take_nonempty_prefix<T:Iterator<char>>(rdr: &mut T, pred: |char| -> bool)
145149
-> (~str, Option<char>) {
146150
let mut buf = ~"";
@@ -155,66 +159,53 @@ fn take_nonempty_prefix<T:Iterator<char>>(rdr: &mut T, pred: |char| -> bool)
155159
}
156160
}
157161
}
162+
if buf.is_empty() {
163+
bad_parse::cond.raise(())
164+
}
158165
debug!("extracted nonempty prefix: {}", buf);
159166
(buf, ch)
160167
}
161168

162-
fn take_num<T: Iterator<char>>(rdr: &mut T) -> Option<(uint, Option<char>)> {
169+
fn take_num<T: Iterator<char>>(rdr: &mut T) -> (uint, Option<char>) {
163170
let (s, ch) = take_nonempty_prefix(rdr, char::is_digit);
164171
match from_str::<uint>(s) {
165-
None => None,
166-
Some(i) => Some((i, ch))
172+
None => { bad_parse::cond.raise(()); (0, ch) },
173+
Some(i) => (i, ch)
167174
}
168175
}
169176

170-
fn take_ident<T: Iterator<char>>(rdr: &mut T) -> Option<(Identifier, Option<char>)> {
177+
fn take_ident<T: Iterator<char>>(rdr: &mut T) -> (Identifier, Option<char>) {
171178
let (s,ch) = take_nonempty_prefix(rdr, char::is_alphanumeric);
172179
if s.chars().all(char::is_digit) {
173180
match from_str::<uint>(s) {
174-
None => None,
175-
Some(i) => Some((Numeric(i), ch))
181+
None => { bad_parse::cond.raise(()); (Numeric(0), ch) },
182+
Some(i) => (Numeric(i), ch)
176183
}
177184
} else {
178-
Some((AlphaNumeric(s), ch))
185+
(AlphaNumeric(s), ch)
179186
}
180187
}
181188

182-
fn expect(ch: Option<char>, c: char) -> Option<()> {
189+
fn expect(ch: Option<char>, c: char) {
183190
if ch != Some(c) {
184-
None
185-
} else {
186-
Some(())
191+
bad_parse::cond.raise(())
187192
}
188193
}
189194

190-
fn parse_iter<T: Iterator<char>>(rdr: &mut T) -> Option<Version> {
191-
let maybe_vers = take_num(rdr).and_then(|(major, ch)| {
192-
expect(ch, '.').and_then(|_| Some(major))
193-
}).and_then(|major| {
194-
take_num(rdr).and_then(|(minor, ch)| {
195-
expect(ch, '.').and_then(|_| Some((major, minor)))
196-
})
197-
}).and_then(|(major, minor)| {
198-
take_num(rdr).and_then(|(patch, ch)| {
199-
Some((major, minor, patch, ch))
200-
})
201-
});
202-
203-
let (major, minor, patch, ch) = match maybe_vers {
204-
Some((a, b, c, d)) => (a, b, c, d),
205-
None => return None
206-
};
195+
fn parse_iter<T: Iterator<char>>(rdr: &mut T) -> Version {
196+
let (major, ch) = take_num(rdr);
197+
expect(ch, '.');
198+
let (minor, ch) = take_num(rdr);
199+
expect(ch, '.');
200+
let (patch, ch) = take_num(rdr);
207201

208202
let mut pre = ~[];
209203
let mut build = ~[];
210204

211205
let mut ch = ch;
212206
if ch == Some('-') {
213207
loop {
214-
let (id, c) = match take_ident(rdr) {
215-
Some((id, c)) => (id, c),
216-
None => return None
217-
};
208+
let (id, c) = take_ident(rdr);
218209
pre.push(id);
219210
ch = c;
220211
if ch != Some('.') { break; }
@@ -223,23 +214,20 @@ fn parse_iter<T: Iterator<char>>(rdr: &mut T) -> Option<Version> {
223214

224215
if ch == Some('+') {
225216
loop {
226-
let (id, c) = match take_ident(rdr) {
227-
Some((id, c)) => (id, c),
228-
None => return None
229-
};
217+
let (id, c) = take_ident(rdr);
230218
build.push(id);
231219
ch = c;
232220
if ch != Some('.') { break; }
233221
}
234222
}
235223

236-
Some(Version {
224+
Version {
237225
major: major,
238226
minor: minor,
239227
patch: patch,
240228
pre: pre,
241229
build: build,
242-
})
230+
}
243231
}
244232

245233

@@ -249,17 +237,15 @@ pub fn parse(s: &str) -> Option<Version> {
249237
return None;
250238
}
251239
let s = s.trim();
252-
let v = parse_iter(&mut s.chars());
253-
match v {
254-
Some(v) => {
255-
if v.to_str().equiv(&s) {
256-
Some(v)
257-
} else {
258-
None
259-
}
240+
let mut bad = false;
241+
bad_parse::cond.trap(|_| { debug!("bad"); bad = true }).inside(|| {
242+
let v = parse_iter(&mut s.chars());
243+
if bad || v.to_str() != s.to_owned() {
244+
None
245+
} else {
246+
Some(v)
260247
}
261-
None => None
262-
}
248+
})
263249
}
264250

265251
#[test]

0 commit comments

Comments
 (0)