List all posts in custom post type by taxonomy

$args = array('post_type' => 'custom_post_type',
'tax_query' => array(
array(
'taxonomy' => 'custom_taxonomy',
'field' => 'slug',
'terms' => $custom_term->slug,
),
),
);

$loop = new WP_Query($args);
if($loop->have_posts()) {

while($loop->have_posts()) : $loop->the_post();
echo get_the_title();
endwhile;
}