Skip to content

Commit 1d28e7d

Browse files
committed
---
yaml --- r: 148075 b: refs/heads/try2 c: 5f39d64 h: refs/heads/master i: 148073: f2c04ae 148071: 5456aba v: v3
1 parent 9299808 commit 1d28e7d

File tree

28 files changed

+213
-94
lines changed

28 files changed

+213
-94
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: 167d533fe0624963cb3f836ebce06a457043c816
8+
refs/heads/try2: 5f39d64f21759a57785731176df02feba24ee919
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ Lindsey Kuper <[email protected]>
225225
Luca Bruno <[email protected]>
226226
Luis de Bethencourt <[email protected]>
227227
Luqman Aden <[email protected]>
228+
228229
Magnus Auvinen <[email protected]>
229230
Mahmut Bulut <[email protected]>
230231
maikklein <[email protected]>
@@ -240,6 +241,7 @@ Martin DeMello <[email protected]>
240241
Marvin Löbel <[email protected]>
241242
Matt Brubeck <[email protected]>
242243
Matt Carberry <[email protected]>
244+
Matthew Auld <[email protected]>
243245
Matthew Iselin <[email protected]>
244246
Matthew McPherrin <[email protected]>
245247
Matthew O'Connor <[email protected]>

branches/try2/RELEASES.txt

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

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

66
* Language
77
* The `float` type has been removed. Use `f32` or `f64` instead.
@@ -22,6 +22,9 @@ 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.
2528
* The `#[link(...)]` attribute has been replaced with
2629
`#[crate_id = "name#vers"]`.
2730
* Empty `impl`s must be terminated with empty braces and may not be
@@ -32,6 +35,8 @@ Version 0.9 (January 2014)
3235
* `printf!` and `printfln!` (old-style formatting) removed in favor of
3336
`print!` and `println!`.
3437
* `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.
3540
* New reserved keywords: `alignof`, `offsetof`, `sizeof`.
3641
* Macros can have attributes.
3742
* Macros can expand to items with attributes.
@@ -76,6 +81,7 @@ Version 0.9 (January 2014)
7681
variables. Currently behind the `thread_local` feature gate.
7782
* The `return` keyword may be used in closures.
7883
* 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.
7985

8086
* Libraries
8187
* std: The `option` and `result` API's have been overhauled to make them
@@ -90,9 +96,14 @@ Version 0.9 (January 2014)
9096
* std: The reference counted pointer type `extra::rc` moved into std.
9197
* std: The `Gc` type in the `gc` module will replace `@` (it is currently
9298
just a wrapper around it).
99+
* std: The `Either` type has been removed.
93100
* std: `fmt::Default` can be implemented for any type to provide default
94101
formatting to the `format!` macro, as in `format!("{}", myfoo)`.
95102
* 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.
96107
* std: Functions dealing with type size and alignment have moved from the
97108
`sys` module to the `mem` module.
98109
* 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 dist
47+
$(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz $(PKG_NAME)-*.exe 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: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,22 @@ $$(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+
5764
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)): \
5865
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
5966
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
6067
| $$(TLIB$(1)_T_$(2)_H_$(3))/
6168
@$$(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
6669
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
6770
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
68-
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
71+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $$(LFLAGS_$(1)_$(2)_$(3)) \
72+
--out-dir $$(@D) $$< && touch $$@
6973
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
7074
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
7175

@@ -75,13 +79,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
7579
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
7680
| $$(TLIB$(1)_T_$(2)_H_$(3))/
7781
@$$(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)) --out-dir $$(@D) $$< && touch $$@
84+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $$(LFLAGS_$(1)_$(2)_$(3)) \
85+
--out-dir $$(@D) $$< && touch $$@
8586
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(2)),$$(notdir $$@))
8687
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_RGLOB_$(2)),$$(notdir $$@))
8788

@@ -98,6 +99,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTUV_$(2)): \
9899
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
99100
-L $$(UV_SUPPORT_DIR_$(2)) \
100101
-L $$(dir $$(LIBUV_LIB_$(2))) \
102+
$$(LFLAGS_$(1)_$(2)_$(3)) \
101103
--out-dir $$(@D) $$< && touch $$@
102104
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(2)),$$(notdir $$@))
103105
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_RGLOB_$(2)),$$(notdir $$@))
@@ -111,6 +113,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBGREEN_$(2)): \
111113
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_GLOB_$(2)),$$(notdir $$@))
112114
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_RGLOB_$(2)),$$(notdir $$@))
113115
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
116+
$$(LFLAGS_$(1)_$(2)_$(3)) \
114117
--out-dir $$(@D) $$< && touch $$@
115118
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_GLOB_$(2)),$$(notdir $$@))
116119
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_RGLOB_$(2)),$$(notdir $$@))
@@ -124,6 +127,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBNATIVE_$(2)): \
124127
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_GLOB_$(2)),$$(notdir $$@))
125128
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_RGLOB_$(2)),$$(notdir $$@))
126129
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
130+
$$(LFLAGS_$(1)_$(2)_$(3)) \
127131
--out-dir $$(@D) $$< && touch $$@
128132
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_GLOB_$(2)),$$(notdir $$@))
129133
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_RGLOB_$(2)),$$(notdir $$@))
@@ -135,13 +139,11 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
135139
$$(TEXTRALIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
136140
| $$(TLIB$(1)_T_$(2)_H_$(3))/
137141
@$$(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) --out-dir $$(@D) $$< && touch $$@
144+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $(BORROWCK) \
145+
$$(LFLAGS_$(1)_$(2)_$(3)) \
146+
--out-dir $$(@D) $$< && touch $$@
145147
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
146148
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_RGLOB_$(2)),$$(notdir $$@))
147149

@@ -164,14 +166,11 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
164166
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)) \
165167
| $$(TLIB$(1)_T_$(2)_H_$(3))/
166168
@$$(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
171169
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
172170
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
173171
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
174172
-L "$$(LLVM_LIBDIR_$(2))" \
173+
$$(LFLAGS_$(1)_$(2)_$(3)) \
175174
--out-dir $$(@D) $$< && touch $$@
176175
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
177176
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
@@ -182,11 +181,8 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(3)): \
182181
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)) \
183182
| $$(TBIN$(1)_T_$(2)_H_$(3))/
184183
@$$(call E, compile_and_link: $$@)
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 $$@ $$<
184+
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$< \
185+
$$(LFLAGS_$(1)_$(2)_$(3))
190186
ifdef CFG_ENABLE_PAX_FLAGS
191187
@$$(call E, apply PaX flags: $$@)
192188
@"$(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_WIN}-install
22+
OutputBaseFilename=rust-{#CFG_VERSION}-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 as uint);
83+
self.bits &= !(1<<i);
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 as uint, 4u);
650+
write_sized_vuint(self.writer, size, 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: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ impl cmp::Ord for Version {
141141
}
142142
}
143143

144-
condition! {
145-
bad_parse: () -> ();
146-
}
147-
148144
fn take_nonempty_prefix<T:Iterator<char>>(rdr: &mut T, pred: |char| -> bool)
149145
-> (~str, Option<char>) {
150146
let mut buf = ~"";
@@ -159,53 +155,66 @@ fn take_nonempty_prefix<T:Iterator<char>>(rdr: &mut T, pred: |char| -> bool)
159155
}
160156
}
161157
}
162-
if buf.is_empty() {
163-
bad_parse::cond.raise(())
164-
}
165158
debug!("extracted nonempty prefix: {}", buf);
166159
(buf, ch)
167160
}
168161

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

177-
fn take_ident<T: Iterator<char>>(rdr: &mut T) -> (Identifier, Option<char>) {
170+
fn take_ident<T: Iterator<char>>(rdr: &mut T) -> Option<(Identifier, Option<char>)> {
178171
let (s,ch) = take_nonempty_prefix(rdr, char::is_alphanumeric);
179172
if s.chars().all(char::is_digit) {
180173
match from_str::<uint>(s) {
181-
None => { bad_parse::cond.raise(()); (Numeric(0), ch) },
182-
Some(i) => (Numeric(i), ch)
174+
None => None,
175+
Some(i) => Some((Numeric(i), ch))
183176
}
184177
} else {
185-
(AlphaNumeric(s), ch)
178+
Some((AlphaNumeric(s), ch))
186179
}
187180
}
188181

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

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);
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+
};
201207

202208
let mut pre = ~[];
203209
let mut build = ~[];
204210

205211
let mut ch = ch;
206212
if ch == Some('-') {
207213
loop {
208-
let (id, c) = take_ident(rdr);
214+
let (id, c) = match take_ident(rdr) {
215+
Some((id, c)) => (id, c),
216+
None => return None
217+
};
209218
pre.push(id);
210219
ch = c;
211220
if ch != Some('.') { break; }
@@ -214,20 +223,23 @@ fn parse_iter<T: Iterator<char>>(rdr: &mut T) -> Version {
214223

215224
if ch == Some('+') {
216225
loop {
217-
let (id, c) = take_ident(rdr);
226+
let (id, c) = match take_ident(rdr) {
227+
Some((id, c)) => (id, c),
228+
None => return None
229+
};
218230
build.push(id);
219231
ch = c;
220232
if ch != Some('.') { break; }
221233
}
222234
}
223235

224-
Version {
236+
Some(Version {
225237
major: major,
226238
minor: minor,
227239
patch: patch,
228240
pre: pre,
229241
build: build,
230-
}
242+
})
231243
}
232244

233245

@@ -237,15 +249,17 @@ pub fn parse(s: &str) -> Option<Version> {
237249
return None;
238250
}
239251
let s = s.trim();
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)
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+
}
247260
}
248-
})
261+
None => None
262+
}
249263
}
250264

251265
#[test]

0 commit comments

Comments
 (0)