Skip to content

Backticks for ~ and & syntax elements in error messages #12351

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

Merged
merged 1 commit into from
Feb 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
e, actual)})},
Some(expected),
format!("{} pattern", match pointer_kind {
Send => "a ~-box",
Borrowed => "an &-pointer"
Send => "a `~`-box",
Borrowed => "an `&`-pointer"
}),
None);
fcx.write_error(pat_id);
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-4972.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum TraitWrapper {

fn get_tw_map<'lt>(tw: &'lt TraitWrapper) -> &'lt MyTrait {
match *tw {
A(~ref map) => map, //~ ERROR found a ~-box pattern
A(~ref map) => map, //~ ERROR found a `~`-box pattern
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-5100.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ fn main() {

match (true, false) {
~(true, false) => ()
//~^ ERROR mismatched types: expected `(bool,bool)` but found a ~-box pattern
//~^ ERROR mismatched types: expected `(bool,bool)` but found a `~`-box pattern
}

match (true, false) {
&(true, false) => ()
//~^ ERROR mismatched types: expected `(bool,bool)` but found an &-pointer pattern
//~^ ERROR mismatched types: expected `(bool,bool)` but found an `&`-pointer pattern
}


Expand Down