Skip to content

std::str methods dont work if incuded before std::util #11408

Closed
@sunny1304

Description

@sunny1304
use std::bool::* ; 
use std::iter::* ;
use std::str::*  ;
use std::util::* ;
fn main(){
    let mut myStr = ~"rust";
    myStr = replace(myStr, "t", "ty");
    println!("{}", myStr);

    println!("{}", id(10));
}

Error :

type_check_rust.rs:9:9: 9:35 error: this function takes 2 parameters but 3 parameters were supplied
type_check_rust.rs:9    myStr = replace(myStr, "t", "ty");
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

but if I import the str module after util then prints result as expected:

rusty
10

Platform: Ubuntu 12.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions