Skip to content

Parse external source mods in normal .rs files #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
4c68084
Convert most codemap types from records to structs
brson Nov 12, 2012
5f881b4
Remove filemap box typedef from codemap
brson Nov 13, 2012
1f33031
Move filemap ctors to static methods
brson Nov 13, 2012
9fc75e8
Move codemap doc comments to the proper place
brson Nov 13, 2012
385a466
Reformatting in codemap
brson Nov 13, 2012
5b248a6
Remove CodeMap box typedef from codemap
brson Nov 13, 2012
18a825b
Reorder codemap decls
brson Nov 13, 2012
d115944
Remove expn_info box typedef from codemap
brson Nov 13, 2012
15a5d2c
Convert codemap from legacy_exports
brson Nov 13, 2012
2ec09c4
Objectify the codemap
brson Nov 13, 2012
b22f941
Make it clearer which codemap functions use chars vs. bytes
brson Nov 13, 2012
38b9740
Remove unused get_snippet function from codemap
brson Nov 13, 2012
9ecf863
Camel case all the codemap types except span
brson Nov 13, 2012
f67bfe9
Add types for character position and byte position in the codemap
brson Nov 13, 2012
8069d2f
Track character and byte positions together in the parser
brson Nov 15, 2012
3a9ccd5
Factor out some position management code in the lexer
brson Nov 15, 2012
b1dff40
Create CodeMap.add_filemap
brson Nov 15, 2012
4a0f4f5
Refactor the lexer to use FilePos types
brson Nov 15, 2012
bcccf33
Add some comments to codemap and lexer
brson Nov 15, 2012
d5e35e3
Convert CodeMap and FileMap to use &self instead of @self
brson Nov 15, 2012
8cba337
Remove CodeMap.lookup_byte_pos
brson Nov 16, 2012
81d2015
Change spans to use byte offsets instead of char offsets
brson Nov 16, 2012
2374154
Stop storing char positions in CodeMap
brson Nov 16, 2012
4a5b28f
Stop tracking CodeMap offsets in the parse session. Big simplification
brson Nov 16, 2012
1ac28c3
Remove unused types from codemap
brson Nov 16, 2012
2af0885
Remove incorrect comment from codemap
brson Nov 16, 2012
428c58b
Forbid duplicate supertraits
catamorphism Nov 16, 2012
7c72fd8
Add some docs to codemap
brson Nov 16, 2012
e621e68
Remove unused MultiByteChar.sum field from codemap
brson Nov 16, 2012
ec8bfdd
Made Map.contains_key, contains_key_ref, and get pure.
jesse99 Nov 17, 2012
053ba74
Moved strptime and strftime into private helper functions.
jesse99 Nov 17, 2012
7c87ff3
Replace TmMut with inherited mutability
jesse99 Nov 17, 2012
d999588
Made the time to string functions pure as well as empty_tm.
jesse99 Nov 17, 2012
a3f845d
Made Result.get, get_ref, is_ok, is_err, and iter methods pure.
jesse99 Nov 17, 2012
e0805cb
Made most of the URL functions pure.
jesse99 Nov 17, 2012
dc5ff64
Made more stuff pure.
jesse99 Nov 17, 2012
27cca5b
Made merge_sort pure
jesse99 Nov 17, 2012
0c11a12
Fixing warnings for long and blank lines
jesse99 Nov 17, 2012
401093e
Made from_str pure
jesse99 Nov 17, 2012
1a1e99c
Merge remote-tracking branch 'brson/codemap'
brson Nov 17, 2012
340955b
Added support for options that take no arguments and may be repeated.
jesse99 Nov 18, 2012
68c852a
Made Map.contains_key, contains_key_ref, and get pure.
jesse99 Nov 17, 2012
a9e1358
Moved strptime and strftime into private helper functions.
jesse99 Nov 17, 2012
c58951e
Replace TmMut with inherited mutability
jesse99 Nov 17, 2012
2c0dab0
Made the time to string functions pure as well as empty_tm.
jesse99 Nov 17, 2012
c5ab47e
Made Result.get, get_ref, is_ok, is_err, and iter methods pure.
jesse99 Nov 17, 2012
15989ec
Made most of the URL functions pure.
jesse99 Nov 17, 2012
6d99a2f
Made more stuff pure.
jesse99 Nov 17, 2012
333d268
Made merge_sort pure
jesse99 Nov 17, 2012
361aea9
Fixing warnings for long and blank lines
jesse99 Nov 17, 2012
0fd9c9d
Made from_str pure
jesse99 Nov 17, 2012
e2f4f06
Merge with incoming.
jesse99 Nov 17, 2012
5e4ed70
Merge pull request #3998 from jesse99/feature/getopts
catamorphism Nov 18, 2012
a41903d
Remove some unused code from lexer
brson Nov 18, 2012
68c73dc
Whitespace
brson Nov 18, 2012
ddbff6f
syntax: Remove cdir_syntax. Unused
brson Nov 9, 2012
72cc1ac
Parse file mods from .rs files
brson Nov 10, 2012
74b2e99
Report errors better when failing to open files for sub-parsers
brson Nov 18, 2012
371be3c
Remove unused file_type enum from the parser
brson Nov 18, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,19 @@ pub pure fn to_digit(c: char, radix: uint) -> Option<uint> {
* - chars in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`
* - chars above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`
*/
pub fn escape_unicode(c: char) -> ~str {
pub pure fn escape_unicode(c: char) -> ~str {
let s = u32::to_str(c as u32, 16u);
let (c, pad) = (if c <= '\xff' { ('x', 2u) }
else if c <= '\uffff' { ('u', 4u) }
else { ('U', 8u) });
assert str::len(s) <= pad;
let mut out = ~"\\";
str::push_str(&mut out, str::from_char(c));
for uint::range(str::len(s), pad) |_i| { str::push_str(&mut out, ~"0"); }
str::push_str(&mut out, s);
unsafe {
str::push_str(&mut out, str::from_char(c));
for uint::range(str::len(s), pad) |_i|
{ str::push_str(&mut out, ~"0"); }
str::push_str(&mut out, s);
}
move out
}

Expand All @@ -151,7 +154,7 @@ pub fn escape_unicode(c: char) -> ~str {
* - Any other chars in the range [0x20,0x7e] are not escaped.
* - Any other chars are given hex unicode escapes; see `escape_unicode`.
*/
pub fn escape_default(c: char) -> ~str {
pub pure fn escape_default(c: char) -> ~str {
match c {
'\t' => ~"\\t",
'\r' => ~"\\r",
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/from_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
use option::Option;

pub trait FromStr {
static fn from_str(s: &str) -> Option<self>;
static pure fn from_str(s: &str) -> Option<self>;
}

9 changes: 6 additions & 3 deletions src/libcore/int-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl T: iter::Times {
* * buf - A byte buffer
* * radix - The base of the number
*/
pub fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
pub pure fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
if vec::len(buf) == 0u { return None; }
let mut i = vec::len(buf) - 1u;
let mut start = 0u;
Expand All @@ -129,10 +129,13 @@ pub fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
}

/// Parse a string to an int
pub fn from_str(s: &str) -> Option<T> { parse_bytes(str::to_bytes(s), 10u) }
pub pure fn from_str(s: &str) -> Option<T>
{
parse_bytes(str::to_bytes(s), 10u)
}

impl T : FromStr {
static fn from_str(s: &str) -> Option<T> { from_str(s) }
static pure fn from_str(s: &str) -> Option<T> { from_str(s) }
}

/// Convert to a string in a given base
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(Reader) -> t) -> t {
f(BytesReader { bytes: bytes, pos: 0u } as Reader)
}

pub fn with_str_reader<T>(s: &str, f: fn(Reader) -> T) -> T {
pub pure fn with_str_reader<T>(s: &str, f: fn(Reader) -> T) -> T {
str::byte_slice(s, |bytes| with_bytes_reader(bytes, f))
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<T> Data<T> {
}
}

fn borrow_const<R>(op: &fn(t: &const T) -> R) -> R {
pure fn borrow_const<R>(op: &fn(t: &const T) -> R) -> R {
op(&const self.value)
}

Expand Down
12 changes: 6 additions & 6 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ pub fn map_err<T: Copy, E, F: Copy>(res: &Result<T, E>, op: fn((&E)) -> F)
}

impl<T, E> Result<T, E> {
fn get_ref(&self) -> &self/T { get_ref(self) }
pure fn get_ref(&self) -> &self/T { get_ref(self) }

fn is_ok() -> bool { is_ok(&self) }
pure fn is_ok() -> bool { is_ok(&self) }

fn is_err() -> bool { is_err(&self) }
pure fn is_err() -> bool { is_err(&self) }

fn iter(f: fn((&T))) {
pure fn iter(f: fn((&T))) {
match self {
Ok(ref t) => f(t),
Err(_) => ()
Expand All @@ -226,7 +226,7 @@ impl<T, E> Result<T, E> {
}

impl<T: Copy, E> Result<T, E> {
fn get() -> T { get(&self) }
pure fn get() -> T { get(&self) }

fn map_err<F:Copy>(op: fn((&E)) -> F) -> Result<T,F> {
match self {
Expand All @@ -237,7 +237,7 @@ impl<T: Copy, E> Result<T, E> {
}

impl<T, E: Copy> Result<T, E> {
fn get_err() -> E { get_err(&self) }
pure fn get_err() -> E { get_err(&self) }

fn map<U:Copy>(op: fn((&T)) -> U) -> Result<U,E> {
match self {
Expand Down
9 changes: 6 additions & 3 deletions src/libcore/uint-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl T: iter::Times {
*
* `buf` must not be empty
*/
pub fn parse_bytes(buf: &[const u8], radix: uint) -> Option<T> {
pub pure fn parse_bytes(buf: &[const u8], radix: uint) -> Option<T> {
if vec::len(buf) == 0u { return None; }
let mut i = vec::len(buf) - 1u;
let mut power = 1u as T;
Expand All @@ -117,10 +117,13 @@ pub fn parse_bytes(buf: &[const u8], radix: uint) -> Option<T> {
}

/// Parse a string to an int
pub fn from_str(s: &str) -> Option<T> { parse_bytes(str::to_bytes(s), 10u) }
pub pure fn from_str(s: &str) -> Option<T>
{
parse_bytes(str::to_bytes(s), 10u)
}

impl T : FromStr {
static fn from_str(s: &str) -> Option<T> { from_str(s) }
static pure fn from_str(s: &str) -> Option<T> { from_str(s) }
}

/// Parse a string as an unsigned integer.
Expand Down
4 changes: 2 additions & 2 deletions src/libfuzzer/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn as_str(f: fn@(+x: io::Writer)) -> ~str {
io::with_str_writer(f)
}

fn check_variants_of_ast(crate: ast::crate, codemap: codemap::CodeMap,
fn check_variants_of_ast(crate: ast::crate, codemap: @codemap::CodeMap,
filename: &Path, cx: context) {
let stolen = steal(crate, cx.mode);
let extra_exprs = vec::filter(common_exprs(),
Expand All @@ -239,7 +239,7 @@ fn check_variants_of_ast(crate: ast::crate, codemap: codemap::CodeMap,

fn check_variants_T<T: Copy>(
crate: ast::crate,
codemap: codemap::CodeMap,
codemap: @codemap::CodeMap,
filename: &Path,
thing_label: ~str,
things: ~[T],
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ fn pretty_print_input(sess: Session, cfg: ast::crate_cfg, input: input,
ppm_expanded | ppm_normal => pprust::no_ann()
};
let is_expanded = upto != cu_parse;
let src = codemap::get_filemap(sess.codemap, source_name(input)).src;
let src = sess.codemap.get_filemap(source_name(input)).src;
do io::with_str_reader(*src) |rdr| {
pprust::print_crate(sess.codemap, sess.parse_sess.interner,
sess.span_diagnostic, crate,
Expand Down Expand Up @@ -586,7 +586,7 @@ fn build_session_options(binary: ~str,

fn build_session(sopts: @session::options,
demitter: diagnostic::emitter) -> Session {
let codemap = codemap::new_codemap();
let codemap = @codemap::CodeMap::new();
let diagnostic_handler =
diagnostic::mk_handler(Some(demitter));
let span_diagnostic_handler =
Expand All @@ -595,7 +595,7 @@ fn build_session(sopts: @session::options,
}

fn build_session_(sopts: @session::options,
cm: codemap::CodeMap,
cm: @codemap::CodeMap,
demitter: diagnostic::emitter,
span_diagnostic_handler: diagnostic::span_handler)
-> Session {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/driver/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type Session_ = {targ_cfg: @config,
opts: @options,
cstore: metadata::cstore::CStore,
parse_sess: parse_sess,
codemap: codemap::CodeMap,
codemap: @codemap::CodeMap,
// For a library crate, this is always none
mut main_fn: Option<(node_id, codemap::span)>,
span_diagnostic: diagnostic::span_handler,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::Serializer,
let add_to_index = |copy ebml_w| add_to_index_(item, ebml_w, index);

debug!("encoding info for item at %s",
syntax::codemap::span_to_str(item.span, ecx.tcx.sess.codemap));
ecx.tcx.sess.codemap.span_to_str(item.span));

match item.node {
item_const(_, _) => {
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ use std::map::HashMap;
use syntax::{visit, ast_util};
use syntax::print::pprust::{expr_to_str, block_to_str};
use visit::vt;
use syntax::codemap::{span, span_to_str};
use syntax::codemap::span;
use syntax::ast::*;
use io::WriterUtil;
use capture::{cap_move, cap_drop, cap_copy, cap_ref};
Expand Down Expand Up @@ -170,9 +170,9 @@ impl LiveNodeKind : cmp::Eq {
fn live_node_kind_to_str(lnk: LiveNodeKind, cx: ty::ctxt) -> ~str {
let cm = cx.sess.codemap;
match lnk {
FreeVarNode(s) => fmt!("Free var node [%s]", span_to_str(s, cm)),
ExprNode(s) => fmt!("Expr node [%s]", span_to_str(s, cm)),
VarDefNode(s) => fmt!("Var def node [%s]", span_to_str(s, cm)),
FreeVarNode(s) => fmt!("Free var node [%s]", cm.span_to_str(s)),
ExprNode(s) => fmt!("Expr node [%s]", cm.span_to_str(s)),
VarDefNode(s) => fmt!("Var def node [%s]", cm.span_to_str(s)),
ExitNode => ~"Exit node"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ fn trans_trace(bcx: block, sp_opt: Option<span>, trace_str: ~str) {
let {V_filename, V_line} = match sp_opt {
Some(sp) => {
let sess = bcx.sess();
let loc = codemap::lookup_char_pos(sess.parse_sess.cm, sp.lo);
let loc = sess.parse_sess.cm.lookup_char_pos(sp.lo);
{V_filename: C_cstr(bcx.ccx(), loc.file.name),
V_line: loc.line as int}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ fn _UndefReturn(cx: block, Fn: ValueRef) -> ValueRef {
fn add_span_comment(bcx: block, sp: span, text: ~str) {
let ccx = bcx.ccx();
if !ccx.sess.no_asm_comments() {
let s = text + ~" (" + codemap::span_to_str(sp, ccx.sess.codemap)
let s = text + ~" (" + ccx.sess.codemap.span_to_str(sp)
+ ~")";
log(debug, s);
add_comment(bcx, s);
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/controlflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ fn trans_fail_value(bcx: block, sp_opt: Option<span>, V_fail_str: ValueRef)
let {V_filename, V_line} = match sp_opt {
Some(sp) => {
let sess = bcx.sess();
let loc = codemap::lookup_char_pos(sess.parse_sess.cm, sp.lo);
let loc = sess.parse_sess.cm.lookup_char_pos(sp.lo);
{V_filename: C_cstr(bcx.ccx(), loc.file.name),
V_line: loc.line as int}
}
Expand All @@ -361,7 +361,7 @@ fn trans_fail_bounds_check(bcx: block, sp: span,
let _icx = bcx.insn_ctxt("trans_fail_bounds_check");
let ccx = bcx.ccx();

let loc = codemap::lookup_char_pos(bcx.sess().parse_sess.cm, sp.lo);
let loc = bcx.sess().parse_sess.cm.lookup_char_pos(sp.lo);
let line = C_int(ccx, loc.line as int);
let filename_cstr = C_cstr(bcx.ccx(), loc.file.name);
let filename = PointerCast(bcx, filename_cstr, T_ptr(T_i8()));
Expand Down
35 changes: 16 additions & 19 deletions src/librustc/middle/trans/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use trans::build::B;
use middle::ty;
use syntax::{ast, codemap, ast_util, ast_map};
use syntax::parse::token::ident_interner;
use codemap::span;
use codemap::{span, CharPos};
use ast::Ty;
use pat_util::*;
use util::ppaux::ty_to_str;
Expand Down Expand Up @@ -112,7 +112,7 @@ type compile_unit_md = {name: ~str};
type subprogram_md = {id: ast::node_id};
type local_var_md = {id: ast::node_id};
type tydesc_md = {hash: uint};
type block_md = {start: codemap::loc, end: codemap::loc};
type block_md = {start: codemap::Loc, end: codemap::Loc};
type argument_md = {id: ast::node_id};
type retval_md = {id: ast::node_id};

Expand Down Expand Up @@ -229,8 +229,8 @@ fn create_file(cx: @crate_ctxt, full_path: ~str) -> @metadata<file_md> {
return mdval;
}

fn line_from_span(cm: codemap::CodeMap, sp: span) -> uint {
codemap::lookup_char_pos(cm, sp.lo).line
fn line_from_span(cm: @codemap::CodeMap, sp: span) -> uint {
cm.lookup_char_pos(sp.lo).line
}

fn create_block(cx: block) -> @metadata<block_md> {
Expand All @@ -244,9 +244,9 @@ fn create_block(cx: block) -> @metadata<block_md> {
}
let sp = cx.node_info.get().span;

let start = codemap::lookup_char_pos(cx.sess().codemap, sp.lo);
let start = cx.sess().codemap.lookup_char_pos(sp.lo);
let fname = start.file.name;
let end = codemap::lookup_char_pos(cx.sess().codemap, sp.hi);
let end = cx.sess().codemap.lookup_char_pos(sp.hi);
let tg = LexicalBlockTag;
/*alt cached_metadata::<@metadata<block_md>>(
cache, tg,
Expand All @@ -266,8 +266,8 @@ fn create_block(cx: block) -> @metadata<block_md> {
};
let lldata = ~[lltag(tg),
parent,
lli32(start.line as int),
lli32(start.col as int),
lli32(start.line.to_int()),
lli32(start.col.to_int()),
file_node.node,
lli32(unique_id)
];
Expand Down Expand Up @@ -597,7 +597,7 @@ fn create_ty(_cx: @crate_ctxt, _t: ty::t, _ty: @ast::Ty)
}

fn filename_from_span(cx: @crate_ctxt, sp: codemap::span) -> ~str {
codemap::lookup_char_pos(cx.sess.codemap, sp.lo).file.name
cx.sess.codemap.lookup_char_pos(sp.lo).file.name
}

fn create_var(type_tag: int, context: ValueRef, name: ~str, file: ValueRef,
Expand Down Expand Up @@ -629,8 +629,7 @@ fn create_local_var(bcx: block, local: @ast::local)
// FIXME this should be handled (#2533)
_ => fail ~"no single variable name for local"
};
let loc = codemap::lookup_char_pos(cx.sess.codemap,
local.span.lo);
let loc = cx.sess.codemap.lookup_char_pos(local.span.lo);
let ty = node_id_type(bcx, local.node.id);
let tymd = create_ty(cx, ty, local.node.ty);
let filemd = create_file(cx, loc.file.name);
Expand Down Expand Up @@ -674,8 +673,7 @@ fn create_arg(bcx: block, arg: ast::arg, sp: span)
option::None => ()
}

let loc = codemap::lookup_char_pos(cx.sess.codemap,
sp.lo);
let loc = cx.sess.codemap.lookup_char_pos(sp.lo);
let ty = node_id_type(bcx, arg.id);
let tymd = create_ty(cx, ty, arg.ty);
let filemd = create_file(cx, loc.file.name);
Expand Down Expand Up @@ -714,9 +712,9 @@ fn update_source_pos(cx: block, s: span) {
}
let cm = cx.sess().codemap;
let blockmd = create_block(cx);
let loc = codemap::lookup_char_pos(cm, s.lo);
let scopedata = ~[lli32(loc.line as int),
lli32(loc.col as int),
let loc = cm.lookup_char_pos(s.lo);
let scopedata = ~[lli32(loc.line.to_int()),
lli32(loc.col.to_int()),
blockmd.node,
llnull()];
let dbgscope = llmdnode(scopedata);
Expand All @@ -731,7 +729,7 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
log(debug, fcx.id);

let sp = fcx.span.get();
log(debug, codemap::span_to_str(sp, cx.sess.codemap));
log(debug, cx.sess.codemap.span_to_str(sp));

let (ident, ret_ty, id) = match cx.tcx.items.get(fcx.id) {
ast_map::node_item(item, _) => {
Expand Down Expand Up @@ -773,8 +771,7 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
option::None => ()
}

let loc = codemap::lookup_char_pos(cx.sess.codemap,
sp.lo);
let loc = cx.sess.codemap.lookup_char_pos(sp.lo);
let file_node = create_file(cx, loc.file.name).node;
let ty_node = if cx.sess.opts.extra_debuginfo {
match ret_ty.node {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ fn ensure_supertraits(ccx: @crate_ctxt,
for trait_refs.each |trait_ref| {
let (did, tpt) = instantiate_trait_ref(ccx, *trait_ref, rp);
if instantiated.any(|other_trait: &InstantiatedTraitRef|
{ (*other_trait).def_id == did }) {
{ other_trait.def_id == did }) {
// This means a trait inherited from the same supertrait more
// than once.
tcx.sess.span_err(sp, ~"Duplicate supertrait in trait \
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/infer/region_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ impl RegionVarBindings {
self.undo_log.push(AddVar(vid));
}
debug!("created new region variable %? with span %?",
vid, codemap::span_to_str(span, self.tcx.sess.codemap));
vid, self.tcx.sess.codemap.span_to_str(span));
return vid;
}

Expand Down
Loading