-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
This error is related to #22050, not sure if it's a dupe. Some of the following code snippets rely on the term library (but the issue seems to be in Rust, not term).
The following builds fine:
fn foo() {
let mut s = String::new();
writeln!(s, "foo").unwrap();
}This gives an error:
extern crate term;
fn foo() {
let mut t = term::stdout().unwrap();
writeln!(t, "foo").unwrap();
}Output:
lib.rs:5:5: 5:23 error: source trait is private
lib.rs:5 writeln!(t, "foo").unwrap();
This is the error mentioned in #22050. Importing std::io::Write fixes the error. However, if println is used, we get no errors:
extern crate term;
fn foo() {
let mut t = term::stdout().unwrap();
writeln!(t, "foo").unwrap();
println!("foo");
}Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.